28 m_speciesLoc(b.m_speciesLoc),
29 m_tlow_max(b.m_tlow_max),
30 m_thigh_min(b.m_thigh_min),
34 "To be removed after Cantera 2.3");
37 for (
const auto& sp : b.
m_sp) {
38 for (
size_t k = 0; k < sp.second.size(); k++) {
39 size_t i = sp.second[k].first;
40 shared_ptr<SpeciesThermoInterpType> spec(
41 sp.second[k].second->duplMyselfAsSpeciesThermoInterpType());
42 m_sp[sp.first].emplace_back(i, spec);
51 "To be removed after Cantera 2.3");
58 for (
const auto& sp : b.
m_sp) {
59 for (
size_t k = 0; k < sp.second.size(); k++) {
60 size_t i = sp.second[k].first;
61 shared_ptr<SpeciesThermoInterpType> spec(
62 sp.second[k].second->duplMyselfAsSpeciesThermoInterpType());
63 m_sp[sp.first].emplace_back(i, spec);
78 "To be removed after Cantera 2.3");
83 shared_ptr<SpeciesThermoInterpType> stit_ptr)
90 "MultiSpeciesThermo::install_STIT",
91 "Index position isn't null, duplication of assignment: {}", index);
92 int type = stit_ptr->reportType();
94 m_sp[type].emplace_back(index, stit_ptr);
95 if (
m_sp[type].size() == 1) {
96 m_tpoly[type].resize(stit_ptr->temperaturePolySize());
106 shared_ptr<SpeciesThermoInterpType> spthermo)
114 "Species with this index not previously added: {}",
117 int type = spthermo->reportType();
120 "Type of parameterization changed: {} != {}", type,
125 "Cannot increase minimum temperature for phase from {} to {}",
130 "Cannot increase minimum temperature for phase from {} to {}",
140 auto stit_ptr = make_shared<STITbyPDSS>(vpssmgr_ptr, PDSS_ptr);
145 doublereal* h_RT, doublereal* s_R)
const 154 doublereal* h_RT, doublereal* s_R)
const 156 auto iter =
m_sp.begin();
158 for (; iter !=
m_sp.end(); iter++, jter++) {
159 const std::vector<index_STIT>& species = iter->second;
160 double* tpoly = &jter->second[0];
161 species[0].second->updateTemperaturePoly(t, tpoly);
162 for (
size_t k = 0; k < species.size(); k++) {
163 size_t i = species[k].first;
164 species[k].second->updateProperties(tpoly, cp_R+i, h_RT+i, s_R+i);
179 doublereal*
const c, doublereal& minTemp_, doublereal& maxTemp_,
180 doublereal& refPressure_)
const 229 return m_sp.at(loc.first)[loc.second].second.get();
230 }
catch (std::out_of_range&) {
239 return m_sp.at(loc.first)[loc.second].second.get();
240 }
catch (std::out_of_range&) {
275 for (
size_t k = 0; k < nSpecies; k++) {
Header for a general species thermodynamic property manager for a phase (see MultiSpeciesThermo).
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.
Abstract Base class for the thermodynamic manager for an individual species' reference state...
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 reportHf298(doublereal *const h298=0) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) ...
const doublereal OneAtm
One atmosphere [Pa].
bool ready(size_t nSpecies)
Check if data for all species (0 through nSpecies-1) has been installed.
virtual doublereal minTemp() const
Returns the minimum temperature that the thermo parameterization is valid.
virtual void resetHf298(const size_t k)
Restore the original heat of formation of one or more species.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
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 base class for the classes that manage the calculation of standard state properties for all t...
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 ...
const size_t npos
index returned by functions to indicate "no position"
void installPDSShandler(size_t k, PDSS *PDSS_ptr, VPSSMgr *vpssmgr_ptr)
Install a PDSS object to handle the reference state thermodynamics calculation.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
virtual doublereal refPressure(size_t k=npos) const
The reference-state pressure for species k.
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) ...
doublereal m_p0
reference pressure (Pa)
virtual int reportType() const =0
Returns an integer representing the type of parameterization.
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]...
virtual int reportType(size_t index) const
This utility function reports the type of parameterization used for the species with index number ind...
doublereal m_tlow_max
Maximum value of the lowest temperature.
virtual void reportParameters(size_t &index, int &type, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure, doublereal *const coeffs) const =0
This utility function reports back the type of parameterization and all of the parameters for the spe...
void markInstalled(size_t k)
Mark species k as having its thermodynamic data installed.
SpeciesThermoInterpType * provideSTIT(size_t k)
Provide the SpeciesthermoInterpType object.
Base class for exceptions thrown by Cantera classes.
STIT_map m_sp
This is the main data structure, which contains the SpeciesThermoInterpType objects, sorted by the parameterization type.
doublereal m_thigh_min
Minimum value of the highest temperature.
virtual MultiSpeciesThermo * duplMyselfAsSpeciesThermo() const
Duplication routine for objects derived from MultiSpeciesThermo.
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature.
virtual doublereal refPressure() const
Returns the reference pressure (Pa)
#define AssertThrowMsg(expr, procedure,...)
Assertion must be true or an error is thrown.
Header for factory functions to build instances of classes that manage the standard-state thermodynam...
Virtual base class for a species with a pressure dependent standard state.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const =0
Compute the reference-state property of one species.
MultiSpeciesThermo & operator=(const MultiSpeciesThermo &b)
Contains declarations for string manipulation functions within Cantera.
virtual void update_one(size_t k, doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Like update(), but only updates the single species k.
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() const
Returns the maximum temperature that the thermo parameterization is valid.
A species thermodynamic property manager for a phase.
virtual void resetHf298()
Restore the original heat of formation for this species.
virtual void install_STIT(size_t index, shared_ptr< SpeciesThermoInterpType > stit)
Install a new species thermodynamic property parameterization for one species.
Namespace for the Cantera kernel.
tpoly_map m_tpoly
Temperature polynomials for each thermo parameterization.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
MultiSpeciesThermo()
Constructor.
std::vector< bool > m_installed
indicates if data for species has been installed