Go to the documentation of this file.
27 shared_ptr<SpeciesThermoInterpType> stit_ptr)
34 "MultiSpeciesThermo::install_STIT",
35 "Index position isn't null, duplication of assignment: {}", index);
36 int type = stit_ptr->reportType();
38 m_sp[type].emplace_back(index, stit_ptr);
39 if (
m_sp[type].size() == 1) {
40 m_tpoly[type].resize(stit_ptr->temperaturePolySize());
50 shared_ptr<SpeciesThermoInterpType> spthermo)
58 "Species with this index not previously added: {}",
61 int type = spthermo->reportType();
64 "Type of parameterization changed: {} != {}", type,
69 "Cannot increase minimum temperature for phase from {} to {}",
74 "Cannot increase minimum temperature for phase from {} to {}",
82 double* h_RT,
double* s_R)
const
91 doublereal* h_RT, doublereal* s_R)
const
93 auto iter =
m_sp.begin();
95 for (; iter !=
m_sp.end(); iter++, jter++) {
96 const std::vector<index_STIT>& species = iter->second;
97 double* tpoly = &jter->second[0];
98 species[0].second->updateTemperaturePoly(t, tpoly);
99 for (
size_t k = 0; k < species.size(); k++) {
100 size_t i = species[k].first;
101 species[k].second->updateProperties(tpoly, cp_R+i, h_RT+i, s_R+i);
116 doublereal*
const c, doublereal& minTemp_, doublereal& maxTemp_,
117 doublereal& refPressure_)
const
166 return m_sp.at(loc.first)[loc.second].second.get();
167 }
catch (std::out_of_range&) {
176 return m_sp.at(loc.first)[loc.second].second.get();
177 }
catch (std::out_of_range&) {
212 for (
size_t k = 0; k < nSpecies; k++) {
std::vector< bool > m_installed
indicates if data for species has been installed
virtual void update_single(size_t k, double T, double *cp_R, double *h_RT, double *s_R) const
Like update_one, but without applying offsets to the output pointers.
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1)
tpoly_map m_tpoly
Temperature polynomials for each thermo parameterization.
virtual doublereal maxTemp() const
Returns the maximum temperature that the thermo parameterization is valid.
MultiSpeciesThermo()
Constructor.
bool ready(size_t nSpecies)
Check if data for all species (0 through nSpecies-1) has been installed.
#define AssertThrowMsg(expr, procedure,...)
Assertion must be true or an error is thrown.
virtual void resetHf298(const size_t k)
Restore the original heat of formation of one or more species.
virtual doublereal refPressure(size_t k=npos) const
The reference-state pressure for species k.
virtual void reportParams(size_t index, int &type, doublereal *const c, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure) const
This utility function reports back the type of parameterization and all of the parameters for the spe...
virtual doublereal minTemp() const
Returns the minimum temperature that the thermo parameterization is valid.
virtual void modifySpecies(size_t index, shared_ptr< SpeciesThermoInterpType > spec)
Modify the species thermodynamic property parameterization for a species.
virtual void update(doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of the standard state of one species in the phase (J ...
Abstract Base class for the thermodynamic manager for an individual species' reference state.
virtual void reportParameters(size_t &index, int &type, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure, doublereal *const coeffs) const
This utility function returns the type of parameterization and all of the parameters for the species.
void markInstalled(size_t k)
Mark species k as having its thermodynamic data installed.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
std::map< size_t, std::pair< int, size_t > > m_speciesLoc
Map from species index to location within m_sp, such that m_sp[m_speciesLoc[k].first][m_speciesLoc[k]...
doublereal m_tlow_max
Maximum value of the lowest temperature.
doublereal m_p0
reference pressure (Pa)
STIT_map m_sp
This is the main data structure, which contains the SpeciesThermoInterpType objects,...
doublereal m_thigh_min
Minimum value of the highest temperature.
virtual doublereal reportHf298(doublereal *const h298=0) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1)
virtual int reportType(size_t index) const
This utility function reports the type of parameterization used for the species with index number ind...
const double OneAtm
One atmosphere [Pa].
virtual int reportType() const
Returns an integer representing the type of parameterization.
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature.
SpeciesThermoInterpType * provideSTIT(size_t k)
Provide the SpeciesThermoInterpType object.
virtual void resetHf298()
Restore the original heat of formation for this species.
virtual doublereal refPressure() const
Returns the reference pressure (Pa)
Base class for exceptions thrown by Cantera classes.
const size_t npos
index returned by functions to indicate "no position"
Namespace for the Cantera kernel.
virtual void install_STIT(size_t index, shared_ptr< SpeciesThermoInterpType > stit)
Install a new species thermodynamic property parameterization for one species.
virtual doublereal reportOneHf298(const size_t k) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1)
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.