[oneD] change thermo type passed to StFlow constructor
- allow for 'ThermoPhase`, and cast to 'IdealGasPhase' internally
This commit is contained in:
parent
2a9554c134
commit
cf315f7c5e
3 changed files with 15 additions and 5 deletions
|
|
@ -45,7 +45,12 @@ public:
|
|||
//! to evaluate all thermodynamic, kinetic, and transport properties.
|
||||
//! @param nsp Number of species.
|
||||
//! @param points Initial number of grid points
|
||||
StFlow(IdealGasPhase* ph = 0, size_t nsp = 1, size_t points = 1);
|
||||
StFlow(ThermoPhase* ph = 0, size_t nsp = 1, size_t points = 1);
|
||||
|
||||
//! Delegating constructor
|
||||
StFlow(shared_ptr<ThermoPhase> th, size_t nsp = 1, size_t points = 1) :
|
||||
StFlow(th.get(), nsp, points) {
|
||||
}
|
||||
|
||||
//! @name Problem Specification
|
||||
//! @{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ int flamespeed(double phi)
|
|||
{
|
||||
try {
|
||||
auto sol = newSolution("gri30.yaml", "gri30", "None");
|
||||
auto gas = std::dynamic_pointer_cast<IdealGasPhase>(sol->thermo());
|
||||
auto gas = sol->thermo();
|
||||
double temp = 300.0; // K
|
||||
double pressure = 1.0*OneAtm; //atm
|
||||
double uin = 0.3; //m/sec
|
||||
|
|
@ -51,7 +51,7 @@ int flamespeed(double phi)
|
|||
|
||||
//-------- step 1: create the flow -------------
|
||||
|
||||
StFlow flow(gas.get());
|
||||
StFlow flow(gas);
|
||||
flow.setFreeFlow();
|
||||
|
||||
// create an initial grid
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using namespace std;
|
|||
namespace Cantera
|
||||
{
|
||||
|
||||
StFlow::StFlow(IdealGasPhase* ph, size_t nsp, size_t points) :
|
||||
StFlow::StFlow(ThermoPhase* ph, size_t nsp, size_t points) :
|
||||
Domain1D(nsp+c_offset_Y, points),
|
||||
m_press(-1.0),
|
||||
m_nsp(nsp),
|
||||
|
|
@ -30,9 +30,14 @@ StFlow::StFlow(IdealGasPhase* ph, size_t nsp, size_t points) :
|
|||
m_zfixed(Undef),
|
||||
m_tfixed(Undef)
|
||||
{
|
||||
if (ph->type() == "IdealGas") {
|
||||
m_thermo = (IdealGasPhase*)ph;
|
||||
} else {
|
||||
throw CanteraError("StFlow::StFlow",
|
||||
"Unsupported phase type: need 'IdealGasPhase'");
|
||||
}
|
||||
m_type = cFlowType;
|
||||
m_points = points;
|
||||
m_thermo = ph;
|
||||
|
||||
if (ph == 0) {
|
||||
return; // used to create a dummy object
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue