diff --git a/include/cantera/base/Solution.h b/include/cantera/base/Solution.h index d50b0762a..f50200835 100644 --- a/include/cantera/base/Solution.h +++ b/include/cantera/base/Solution.h @@ -67,33 +67,18 @@ public: //! Set the Transport object void setTransport(shared_ptr transport); - //! Accessor for the ThermoPhase object - ThermoPhase& thermo() { - return *m_thermo; - } - - //! Accessor for the Kinetics object - Kinetics& kinetics() { - return *m_kinetics; - } - - //! Accessor for the Transport object - Transport& transport() { - return *m_transport; - } - //! Accessor for the ThermoPhase pointer - shared_ptr thermoPtr() { + shared_ptr thermo() { return m_thermo; } //! Accessor for the Kinetics pointer - shared_ptr kineticsPtr() { + shared_ptr kinetics() { return m_kinetics; } //! Accessor for the Transport pointer - shared_ptr transportPtr() { + shared_ptr transport() { return m_transport; } diff --git a/include/cantera/kinetics/GasKinetics.h b/include/cantera/kinetics/GasKinetics.h index b3056d79d..3e9c41367 100644 --- a/include/cantera/kinetics/GasKinetics.h +++ b/include/cantera/kinetics/GasKinetics.h @@ -119,19 +119,6 @@ protected: void updateKc(); }; -/** - * Return a pointer to an GasKinetics object contained in Solution. - */ -inline shared_ptr getGasKineticsPtr(shared_ptr sol) { - auto kin = sol->kineticsPtr(); - if (kin->kineticsType()=="Surf") { - return std::dynamic_pointer_cast(kin); - } else { - throw CanteraError("getGasKineticsPtr", - "Incompatible kinetics"); - } -} - } #endif diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index ac7a78244..b8eb86de7 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -679,19 +679,6 @@ protected: size_t m_nDim; }; -/** - * Return a pointer to an InterfaceKinetics object contained in Solution. - */ -inline shared_ptr getInterfaceKineticsPtr(shared_ptr sol) { - auto kin = sol->kineticsPtr(); - if (kin->kineticsType()=="Surf") { - return std::dynamic_pointer_cast(kin); - } else { - throw CanteraError("getInterfaceKineticsPtr", - "Incompatible kinetics"); - } -} - } #endif diff --git a/include/cantera/thermo/IdealGasPhase.h b/include/cantera/thermo/IdealGasPhase.h index 4e3437ea3..c62ac0682 100644 --- a/include/cantera/thermo/IdealGasPhase.h +++ b/include/cantera/thermo/IdealGasPhase.h @@ -632,19 +632,6 @@ private: void _updateThermo() const; }; -/** - * Return a pointer to an IdealGasPhase object contained in Solution. - */ -inline shared_ptr getIdealGasPhasePtr(shared_ptr sol) { - auto ph = sol->thermoPtr(); - if (ph->type()=="IdealGas") { - return std::dynamic_pointer_cast(ph); - } else { - throw CanteraError("getIdealGasPhasePtr", - "Incompatible phase"); - } -} - } #endif diff --git a/include/cantera/thermo/SurfPhase.h b/include/cantera/thermo/SurfPhase.h index 0319c9b96..07381e92a 100644 --- a/include/cantera/thermo/SurfPhase.h +++ b/include/cantera/thermo/SurfPhase.h @@ -448,19 +448,6 @@ private: void _updateThermo(bool force=false) const; }; -/** - * Return a pointer to an SurfPhase object contained in Solution. - */ - inline shared_ptr getSurfPhasePtr(shared_ptr sol) { - auto ph = sol->thermoPtr(); - if (ph->type()=="Surf") { - return std::dynamic_pointer_cast(ph); - } else { - throw CanteraError("getSurfPhasePtr", - "Incompatible phase"); - } -} - } #endif diff --git a/include/cantera/zeroD/Reactor.h b/include/cantera/zeroD/Reactor.h index 83ba78460..920f87c12 100644 --- a/include/cantera/zeroD/Reactor.h +++ b/include/cantera/zeroD/Reactor.h @@ -65,8 +65,8 @@ public: } void insert(shared_ptr sol) { - setThermoMgr(sol->thermo()); - setKineticsMgr(sol->kinetics()); + setThermoMgr(*(sol->thermo())); + setKineticsMgr(*(sol->kinetics())); } virtual void setKineticsMgr(Kinetics& kin); diff --git a/include/cantera/zeroD/Reservoir.h b/include/cantera/zeroD/Reservoir.h index 2884cf288..65728881f 100644 --- a/include/cantera/zeroD/Reservoir.h +++ b/include/cantera/zeroD/Reservoir.h @@ -37,7 +37,7 @@ public: } void insert(shared_ptr sol) { - setThermoMgr(sol->thermo()); + setThermoMgr(*(sol->thermo())); } }; diff --git a/samples/cxx/NASA_coeffs/NASA_coeffs.cpp b/samples/cxx/NASA_coeffs/NASA_coeffs.cpp index 880d855ca..9bef969cb 100644 --- a/samples/cxx/NASA_coeffs/NASA_coeffs.cpp +++ b/samples/cxx/NASA_coeffs/NASA_coeffs.cpp @@ -12,7 +12,7 @@ void demoprog() writelog("\n**** Testing modifying NASA polynomial coefficients ****\n"); auto sol = newSolution("h2o2.yaml", "ohmech"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); int nsp = gas->nSpecies(); int type; diff --git a/samples/cxx/combustor/combustor.cpp b/samples/cxx/combustor/combustor.cpp index e07757750..c85d67161 100644 --- a/samples/cxx/combustor/combustor.cpp +++ b/samples/cxx/combustor/combustor.cpp @@ -18,7 +18,7 @@ void runexample() { // use reaction mechanism GRI-Mech 3.0 auto sol = newSolution("gri30.yaml", "gri30", "None"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); // create a reservoir for the fuel inlet, and set to pure methane. Reservoir fuel_in; @@ -27,7 +27,7 @@ void runexample() double fuel_mw = gas->meanMolecularWeight(); auto air = newSolution("air.cti"); - double air_mw = air->thermo().meanMolecularWeight(); + double air_mw = air->thermo()->meanMolecularWeight(); // create a reservoir for the air inlet Reservoir air_in; diff --git a/samples/cxx/demo.cpp b/samples/cxx/demo.cpp index 7c66d225c..fe678c86f 100644 --- a/samples/cxx/demo.cpp +++ b/samples/cxx/demo.cpp @@ -29,7 +29,7 @@ void demoprog() writelog("\n**** C++ Test Program ****\n"); auto sol = newSolution("h2o2.yaml", "ohmech"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); double temp = 1200.0; double pres = OneAtm; gas->setState_TPX(temp, pres, "H2:1, O2:1, AR:2"); @@ -66,7 +66,7 @@ void demoprog() // Reaction information - auto kin = getGasKineticsPtr(sol); + auto kin = getGasKinetics(sol); int irxns = kin->nReactions(); vector_fp qf(irxns); vector_fp qr(irxns); diff --git a/samples/cxx/flamespeed/flamespeed.cpp b/samples/cxx/flamespeed/flamespeed.cpp index c36ea26c2..6ad4c2a37 100644 --- a/samples/cxx/flamespeed/flamespeed.cpp +++ b/samples/cxx/flamespeed/flamespeed.cpp @@ -17,8 +17,7 @@ int flamespeed(double phi) { try { auto sol = newSolution("gri30.yaml", "gri30", "None"); - auto gas = getIdealGasPhasePtr(sol); - + auto gas = std::dynamic_pointer_cast(sol->thermo()); double temp = 300.0; // K double pressure = 1.0*OneAtm; //atm double uin = 0.3; //m/sec @@ -69,11 +68,11 @@ int flamespeed(double phi) // specify the objects to use to compute kinetic rates and // transport properties - std::unique_ptr trmix(newTransportMgr("Mix", sol->thermoPtr().get())); - std::unique_ptr trmulti(newTransportMgr("Multi", sol->thermoPtr().get())); + std::unique_ptr trmix(newTransportMgr("Mix", sol->thermo().get())); + std::unique_ptr trmulti(newTransportMgr("Multi", sol->thermo().get())); flow.setTransport(*trmix); - flow.setKinetics(sol->kinetics()); + flow.setKinetics(*(sol->kinetics())); flow.setPressure(pressure); //------- step 2: create the inlet ----------------------- diff --git a/samples/cxx/kinetics1/kinetics1.cpp b/samples/cxx/kinetics1/kinetics1.cpp index 27e10daa5..edb0ebfad 100644 --- a/samples/cxx/kinetics1/kinetics1.cpp +++ b/samples/cxx/kinetics1/kinetics1.cpp @@ -23,7 +23,7 @@ int kinetics1(int np, void* p) // create an ideal gas mixture that corresponds to GRI-Mech 3.0 auto sol = newSolution("gri30.yaml", "gri30", "None"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); // set the state gas->setState_TPX(1001.0, OneAtm, "H2:2.0, O2:1.0, N2:4.0"); @@ -45,7 +45,7 @@ int kinetics1(int np, void* p) // create a 2D array to hold the output variables, // and store the values for the initial state Array2D soln(nsp+4, 1); - saveSoln(0, 0.0, sol->thermo(), soln); + saveSoln(0, 0.0, *(sol->thermo()), soln); // create a container object to run the simulation // and add the reactor to it @@ -58,15 +58,15 @@ int kinetics1(int np, void* p) double tm = i*dt; sim.advance(tm); cout << "time = " << tm << " s" << endl; - saveSoln(tm, sol->thermo(), soln); + saveSoln(tm, *(sol->thermo()), soln); } clock_t t1 = clock(); // save end time // make a Tecplot data file and an Excel spreadsheet std::string plotTitle = "kinetics example 1: constant-pressure ignition"; - plotSoln("kin1.dat", "TEC", plotTitle, sol->thermo(), soln); - plotSoln("kin1.csv", "XL", plotTitle, sol->thermo(), soln); + plotSoln("kin1.dat", "TEC", plotTitle, *(sol->thermo()), soln); + plotSoln("kin1.csv", "XL", plotTitle, *(sol->thermo()), soln); // print final temperature and timing data diff --git a/samples/cxx/openmp_ignition/openmp_ignition.cpp b/samples/cxx/openmp_ignition/openmp_ignition.cpp index d68b22560..1f0bbba3b 100644 --- a/samples/cxx/openmp_ignition/openmp_ignition.cpp +++ b/samples/cxx/openmp_ignition/openmp_ignition.cpp @@ -55,7 +55,7 @@ void run() for (int i = 0; i < nPoints; i++) { // Get the Cantera objects that were initialized for this thread size_t j = omp_get_thread_num(); - auto gas = getIdealGasPhasePtr(sols[j]); + auto gas = sols[j]->thermo(); Reactor& reactor = *reactors[j]; ReactorNet& net = *nets[j]; diff --git a/samples/f77/demo_ftnlib.cpp b/samples/f77/demo_ftnlib.cpp index 4d92974fe..9e5b19bc0 100644 --- a/samples/f77/demo_ftnlib.cpp +++ b/samples/f77/demo_ftnlib.cpp @@ -94,9 +94,9 @@ extern "C" { string fth = string(id, lenid); trmodel = string(transport, lentr); _sol = newSolution(fin, fth, trmodel); - _gas = getIdealGasPhasePtr(_sol); - _kin = getGasKineticsPtr(_sol); - _trans = _sol->transportPtr(); + _gas = std::dynamic_pointer_cast(_sol->thermo()); + _kin = std::dynamic_pointer_cast(_sol->kinetics()); + _trans = _sol->transport(); } catch (CanteraError& err) { handleError(err); } diff --git a/src/base/Solution.cpp b/src/base/Solution.cpp index 8c4f8b20a..2f621e489 100644 --- a/src/base/Solution.cpp +++ b/src/base/Solution.cpp @@ -28,7 +28,7 @@ Solution::Solution() {} // kinetics std::vector phases; for (auto & adj : adjacent) { - phases.push_back(adj->thermoPtr().get()); + phases.push_back(adj->thermo().get()); } phases.push_back(m_thermo.get()); m_kinetics = std::move(newKinetics(phases, infile, name)); diff --git a/test/kinetics/kineticsFromYaml.cpp b/test/kinetics/kineticsFromYaml.cpp index fe494341d..7cb3792b5 100644 --- a/test/kinetics/kineticsFromYaml.cpp +++ b/test/kinetics/kineticsFromYaml.cpp @@ -15,7 +15,7 @@ TEST(Reaction, ElementaryFromYaml) " rate-constant: [-2.70000E+13 cm^3/mol/s, 0, 355 cal/mol]," " negative-A: true}"); - auto R = newReaction(rxn, sol->kinetics()); + auto R = newReaction(rxn, *(sol->kinetics())); EXPECT_EQ(R->reactants.at("NO"), 1); EXPECT_EQ(R->products.at("N2"), 1); EXPECT_EQ(R->reaction_type, ELEMENTARY_RXN); @@ -36,7 +36,7 @@ TEST(Reaction, ThreeBodyFromYaml1) " rate-constant: [1.20000E+17 cm^6/mol^2/s, -1, 0]," " efficiencies: {AR: 0.83, H2O: 5}}"); - auto R = newReaction(rxn, sol->kinetics()); + auto R = newReaction(rxn, *(sol->kinetics())); EXPECT_EQ(R->reactants.count("M"), (size_t) 0); auto TBR = dynamic_cast(*R); @@ -53,7 +53,7 @@ TEST(Reaction, ThreeBodyFromYaml2) " type: three-body," " rate-constant: [1.20000E+17, -1, 0]}"); - EXPECT_THROW(newReaction(rxn, sol->kinetics()), CanteraError); + EXPECT_THROW(newReaction(rxn, *(sol->kinetics())), CanteraError); } TEST(Reaction, FalloffFromYaml1) @@ -67,7 +67,7 @@ TEST(Reaction, FalloffFromYaml1) " SRI: {A: 1.1, B: 700.0, C: 1234.0, D: 56.0, E: 0.7}," " efficiencies: {AR: 0.625}}"); - auto R = newReaction(rxn, sol->kinetics()); + auto R = newReaction(rxn, *(sol->kinetics())); auto FR = dynamic_cast(*R); EXPECT_DOUBLE_EQ(FR.third_body.efficiency("AR"), 0.625); EXPECT_DOUBLE_EQ(FR.third_body.efficiency("N2"), 1.0); @@ -84,7 +84,7 @@ TEST(Reaction, FalloffFromYaml2) " Troe: {A: 0.562, T3: 91, T1: 5836}," " source: somewhere}"); - auto R = newReaction(rxn, sol->kinetics()); + auto R = newReaction(rxn, *(sol->kinetics())); auto FR = dynamic_cast(*R); EXPECT_DOUBLE_EQ(FR.third_body.efficiency("N2"), 1.0); EXPECT_DOUBLE_EQ(FR.third_body.efficiency("H2O"), 0.0); @@ -109,7 +109,7 @@ TEST(Reaction, ChemicallyActivatedFromYaml) " high-P-rate-constant: [5.88E-14, 6.721, -3022.227]," " low-P-rate-constant: [282320.078, 1.46878, -3270.56495]}"); - auto R = newReaction(rxn, sol->kinetics()); + auto R = newReaction(rxn, *(sol->kinetics())); auto CAR = dynamic_cast(*R); EXPECT_DOUBLE_EQ(CAR.high_rate.preExponentialFactor(), 5.88e-14); EXPECT_DOUBLE_EQ(CAR.low_rate.preExponentialFactor(), 2.82320078e2); @@ -129,7 +129,7 @@ TEST(Reaction, PlogFromYaml) "- {P: 1.0 atm, A: 1.230000e+04, b: 2.68, Ea: 6335.0}\n" "- {P: 1.01325 MPa, A: 1.680000e+16, b: -0.6, Ea: 14754.0}"); - auto R = newReaction(rxn, sol->kinetics()); + auto R = newReaction(rxn, *(sol->kinetics())); auto PR = dynamic_cast(*R); const auto& rates = PR.rate.rates(); EXPECT_EQ(rates.size(), (size_t) 4); @@ -156,7 +156,7 @@ TEST(Reaction, ChebyshevFromYaml) " [-2.26210e-01, 1.69190e-01, 4.85810e-03, -2.38030e-03],\n" " [-1.43220e-01, 7.71110e-02, 1.27080e-02, -6.41540e-04]]\n"); - auto R = newReaction(rxn, sol->kinetics()); + auto R = newReaction(rxn, *(sol->kinetics())); EXPECT_EQ(R->reactants.size(), (size_t) 1); auto CR = dynamic_cast(*R); double logP = std::log10(2e6); diff --git a/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp b/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp index eb585249b..71523e604 100644 --- a/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp +++ b/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp @@ -15,7 +15,7 @@ int main(int argc, char** argv) #endif try { auto sol = newSolution("air_below6000K.cti", "air_below6000K"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); vector_fp IndVar2(6, 0.0); IndVar2[0] = 1.5E5; diff --git a/test_problems/CpJump/CpJump.cpp b/test_problems/CpJump/CpJump.cpp index cddcc644f..c3d849a23 100644 --- a/test_problems/CpJump/CpJump.cpp +++ b/test_problems/CpJump/CpJump.cpp @@ -15,7 +15,7 @@ int main(int argc, char** argv) #endif try { auto sol = newSolution("bad_air.xml", "air"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); double pres = 1.0E5; gas->setState_TPX(1000.1, pres, "O2:0.4, N2:0.6"); gas->equilibrate("TP", "auto"); diff --git a/test_problems/cxx_ex/equil_example1.cpp b/test_problems/cxx_ex/equil_example1.cpp index 5cd868adb..e3de5bcde 100644 --- a/test_problems/cxx_ex/equil_example1.cpp +++ b/test_problems/cxx_ex/equil_example1.cpp @@ -63,7 +63,7 @@ int equil_example1(int job) // create a gas mixture, and set its state auto sol = newSolution("silane.xml", "silane"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); size_t nsp = gas->nSpecies(); int ntemps = 50; // number of temperatures diff --git a/test_problems/cxx_ex/kinetics_example1.cpp b/test_problems/cxx_ex/kinetics_example1.cpp index 02880a3a6..d4affeda3 100644 --- a/test_problems/cxx_ex/kinetics_example1.cpp +++ b/test_problems/cxx_ex/kinetics_example1.cpp @@ -43,7 +43,7 @@ int kinetics_example1(int job) // create an ideal gas mixture that corresponds to GRI-Mech // 3.0 auto sol = newSolution("gri30.yaml", "gri30", "None"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); // set the state gas->setState_TPX(1001.0, OneAtm, "H2:2.0, O2:1.0, N2:4.0"); @@ -81,19 +81,19 @@ int kinetics_example1(int job) // create a 2D array to hold the output variables, // and store the values for the initial state Array2D soln(kk+4, 1); - saveSoln(0, 0.0, sol->thermo(), soln); + saveSoln(0, 0.0, *(sol->thermo()), soln); // main loop for (int i = 1; i <= nsteps; i++) { tm = i*dt; sim.advance(tm); - saveSoln(tm, sol->thermo(), soln); + saveSoln(tm, *(sol->thermo()), soln); } // make a Tecplot data file and an Excel spreadsheet string plotTitle = "kinetics example 1: constant-pressure ignition"; - plotSoln("kin1.dat", "TEC", plotTitle, sol->thermo(), soln); - plotSoln("kin1.csv", "XL", plotTitle, sol->thermo(), soln); + plotSoln("kin1.dat", "TEC", plotTitle, *(sol->thermo()), soln); + plotSoln("kin1.csv", "XL", plotTitle, *(sol->thermo()), soln); // print final temperature cout << " Tfinal = " << r.temperature() << endl; diff --git a/test_problems/cxx_ex/kinetics_example3.cpp b/test_problems/cxx_ex/kinetics_example3.cpp index dfafb0073..7be04ac04 100644 --- a/test_problems/cxx_ex/kinetics_example3.cpp +++ b/test_problems/cxx_ex/kinetics_example3.cpp @@ -45,7 +45,7 @@ int kinetics_example3(int job) // create an ideal gas mixture that corresponds to GRI-Mech // 3.0 auto sol = newSolution("gri30.yaml", "gri30", "None"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); // set the state gas->setState_TPX(1001.0, OneAtm, "H2:2.0, O2:1.0, N2:4.0"); @@ -79,19 +79,19 @@ int kinetics_example3(int job) // create a 2D array to hold the output variables, // and store the values for the initial state Array2D soln(kk+4, 1); - saveSoln(0, 0.0, sol->thermo(), soln); + saveSoln(0, 0.0, *(sol->thermo()), soln); // main loop for (int i = 1; i <= nsteps; i++) { tm = i*dt; sim.advance(tm); - saveSoln(tm, sol->thermo(), soln); + saveSoln(tm, *(sol->thermo()), soln); } // make a Tecplot data file and an Excel spreadsheet std::string plotTitle = "kinetics example 3: constant-pressure ignition"; - plotSoln("kin3.dat", "TEC", plotTitle, sol->thermo(), soln); - plotSoln("kin3.csv", "XL", plotTitle, sol->thermo(), soln); + plotSoln("kin3.dat", "TEC", plotTitle, *(sol->thermo()), soln); + plotSoln("kin3.csv", "XL", plotTitle, *(sol->thermo()), soln); // print final temperature diff --git a/test_problems/cxx_ex/rxnpath_example1.cpp b/test_problems/cxx_ex/rxnpath_example1.cpp index 057d0f55f..dd1289ede 100644 --- a/test_problems/cxx_ex/rxnpath_example1.cpp +++ b/test_problems/cxx_ex/rxnpath_example1.cpp @@ -89,7 +89,7 @@ int rxnpath_example1(int job) // create an ideal gas mixture that corresponds to GRI-Mech // 3.0 auto sol = newSolution("gri30.yaml", "gri30", "None"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); gas->setState_TPX(1001.0, OneAtm, "H2:2.0, O2:1.0, N2:4.0"); // create a reactor @@ -124,13 +124,13 @@ int rxnpath_example1(int job) ReactionPathBuilder b; std::ofstream rplog("rp1.log"); // log file std::ofstream rplot("rp1.dot"); // output file - b.init(rplog, sol->kinetics()); // initialize + b.init(rplog, *(sol->kinetics())); // initialize // main loop for (int i = 1; i <= nsteps; i++) { tm = i*dt; sim.advance(tm); - writeRxnPathDiagram(tm, b, sol->kinetics(), rplog, rplot); + writeRxnPathDiagram(tm, b, *(sol->kinetics()), rplog, rplot); } // print final temperature diff --git a/test_problems/cxx_ex/transport_example1.cpp b/test_problems/cxx_ex/transport_example1.cpp index 4fe6d0e2b..5b1d0f0b7 100644 --- a/test_problems/cxx_ex/transport_example1.cpp +++ b/test_problems/cxx_ex/transport_example1.cpp @@ -31,7 +31,7 @@ int transport_example1(int job) // create a gas mixture, and set its state auto sol = newSolution("gri30.yaml", "gri30", "Mix"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); double temp = 500.0; double pres = 2.0*OneAtm; gas->setState_TPX(temp, pres, "H2:1.0, CH4:0.1"); @@ -39,7 +39,7 @@ int transport_example1(int job) // create a transport manager that implements // mixture-averaged transport properties - auto tr = sol->transportPtr(); + auto tr = sol->transport(); size_t nsp = gas->nSpecies(); @@ -61,8 +61,8 @@ int transport_example1(int job) // make a Tecplot data file and an Excel spreadsheet std::string plotTitle = "transport example 1: " "mixture-averaged transport properties"; - plotTransportSoln("tr1.dat", "TEC", plotTitle, sol->thermo(), output); - plotTransportSoln("tr1.csv", "XL", plotTitle, sol->thermo(), output); + plotTransportSoln("tr1.dat", "TEC", plotTitle, *(sol->thermo()), output); + plotTransportSoln("tr1.csv", "XL", plotTitle, *(sol->thermo()), output); // print final temperature cout << "Output files:" << endl diff --git a/test_problems/cxx_ex/transport_example2.cpp b/test_problems/cxx_ex/transport_example2.cpp index 2d0169cdb..0516a4d39 100644 --- a/test_problems/cxx_ex/transport_example2.cpp +++ b/test_problems/cxx_ex/transport_example2.cpp @@ -31,7 +31,7 @@ int transport_example2(int job) // create a gas mixture, and set its state auto sol = newSolution("gri30.yaml", "gri30", "Multi"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); double temp = 2000.0; double pres = 2.0*OneAtm; gas->setState_TPX(temp, pres, "H2:1.0, O2:0.5, CH4:0.1, N2:0.2"); @@ -40,7 +40,7 @@ int transport_example2(int job) // create a transport manager that implements // multicomponent transport properties - auto tr = sol->transportPtr(); + auto tr = sol->transport(); size_t nsp = gas->nSpecies(); // create a 2D array to hold the outputs @@ -60,8 +60,8 @@ int transport_example2(int job) // make a Tecplot data file and an Excel spreadsheet std::string plotTitle = "transport example 2: " "multicomponent transport properties"; - plotTransportSoln("tr2.dat", "TEC", plotTitle, sol->thermo(), output); - plotTransportSoln("tr2.csv", "XL", plotTitle, sol->thermo(), output); + plotTransportSoln("tr2.dat", "TEC", plotTitle, *(sol->thermo()), output); + plotTransportSoln("tr2.csv", "XL", plotTitle, *(sol->thermo()), output); // print final temperature cout << "Output files:" << endl diff --git a/test_problems/mixGasTransport/mixGasTransport.cpp b/test_problems/mixGasTransport/mixGasTransport.cpp index a3572371a..1a6fc47c1 100644 --- a/test_problems/mixGasTransport/mixGasTransport.cpp +++ b/test_problems/mixGasTransport/mixGasTransport.cpp @@ -37,7 +37,7 @@ int main(int argc, char** argv) try { auto sol = newSolution("gri30.yaml", "gri30", "Mix"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); size_t nsp = gas->nSpecies(); double pres = 1.0E5; vector_fp Xset(nsp, 0.0); @@ -133,7 +133,7 @@ int main(int argc, char** argv) grad_T[0] = (T2 - T1) / dist; grad_T[1] = (T3 - T1) / dist; - auto tran = sol->transportPtr(); + auto tran = sol->transport(); auto tranMix = dynamic_pointer_cast(tran); gas->setState_TPX(1500.0, pres, Xset.data()); diff --git a/test_problems/multiGasTransport/multiGasTransport.cpp b/test_problems/multiGasTransport/multiGasTransport.cpp index e758c57b7..9b3882fd9 100644 --- a/test_problems/multiGasTransport/multiGasTransport.cpp +++ b/test_problems/multiGasTransport/multiGasTransport.cpp @@ -45,7 +45,7 @@ int main(int argc, char** argv) try { auto sol = newSolution("gri30.yaml", "gri30", "Multi"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); size_t nsp = gas->nSpecies(); double pres = 1.0E5; vector_fp Xset(nsp, 0.0); @@ -141,7 +141,7 @@ int main(int argc, char** argv) grad_T[0] = (T2 - T1) / dist; grad_T[1] = (T3 - T1) / dist; - auto tran = sol->transportPtr(); + auto tran = sol->transport(); auto tranMix = dynamic_pointer_cast(tran); gas->setState_TPX(1500.0, pres, Xset.data()); vector_fp mixDiffs(nsp, 0.0); diff --git a/test_problems/silane_equil/silane_equil.cpp b/test_problems/silane_equil/silane_equil.cpp index 5159956c4..5106e544e 100644 --- a/test_problems/silane_equil/silane_equil.cpp +++ b/test_problems/silane_equil/silane_equil.cpp @@ -15,7 +15,7 @@ int main(int argc, char** argv) #endif try { auto sol = newSolution("silane.xml", "silane"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); gas->setState_TPX(1500.0, 100.0, "SIH4:0.01, H2:0.99"); gas->equilibrate("TP"); return 0; diff --git a/test_problems/surfkin/surfdemo.cpp b/test_problems/surfkin/surfdemo.cpp index 907138f15..de69f79d0 100644 --- a/test_problems/surfkin/surfdemo.cpp +++ b/test_problems/surfkin/surfdemo.cpp @@ -19,13 +19,13 @@ int main() { try { auto sol = newSolution("gri30.yaml", "gri30"); - auto gas = getIdealGasPhasePtr(sol); + auto gas = sol->thermo(); gas->setState_TPX(1200.0, OneAtm, "H2:2, O2:1, OH:0.01, H:0.01, O:0.01"); auto surf = newSolution("surface.xml", "surface", "None", {sol}); - auto surf_ph = getSurfPhasePtr(surf); - auto surf_kin = getInterfaceKineticsPtr(surf); + auto surf_ph = std::dynamic_pointer_cast(surf->thermo()); + auto surf_kin = std::dynamic_pointer_cast(surf->kinetics()); vector_fp cov { 0.8, 0.2 }; cout.precision(4);