Skip to content

Commit

Permalink
[oneD] Switch between StFlow/IonFlow in factory
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Jun 27, 2023
1 parent 7a99440 commit 14e9b7f
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/oneD/DomainFactory.cpp
Expand Up @@ -7,6 +7,7 @@
#include "cantera/oneD/Boundary1D.h"
#include "cantera/oneD/StFlow.h"
#include "cantera/oneD/IonFlow.h"
#include "cantera/transport/Transport.h"

namespace Cantera
{
Expand Down Expand Up @@ -44,17 +45,32 @@ DomainFactory::DomainFactory()
return new IonFlow(solution, id);
});
reg("free-flow", [](shared_ptr<Solution> solution, const string& id) {
StFlow* ret = new StFlow(solution, id);
StFlow* ret;
if (solution->transport()->transportModel() == "ionized-gas") {
ret = new IonFlow(solution, id);
} else {
ret = new StFlow(solution, id);
}
ret->setFreeFlow();
return ret;
});
reg("axisymmetric-flow", [](shared_ptr<Solution> solution, const string& id) {
StFlow* ret = new StFlow(solution, id);
StFlow* ret;
if (solution->transport()->transportModel() == "ionized-gas") {
ret = new IonFlow(solution, id);
} else {
ret = new StFlow(solution, id);
}
ret->setAxisymmetricFlow();
return ret;
});
reg("unstrained-flow", [](shared_ptr<Solution> solution, const string& id) {
StFlow* ret = new StFlow(solution, id);
StFlow* ret;
if (solution->transport()->transportModel() == "ionized-gas") {
ret = new IonFlow(solution, id);
} else {
ret = new StFlow(solution, id);
}
ret->setUnstrainedFlow();
return ret;
});
Expand Down

0 comments on commit 14e9b7f

Please sign in to comment.