11 #ifndef CT_SPECIESTHERMO_MGR_H
12 #define CT_SPECIESTHERMO_MGR_H
35 +
") does not match any known type.") {}
43 CanteraError(proc,
"Specified species parameterization type (" + stype
44 +
") does not match any known type.") {}
56 template<
class T1,
class T2>
63 "Cantera 2.2. Use GeneralSpeciesThermo instead.");
82 virtual void install(
const std::string& name,
size_t sp,
int type,
88 shared_ptr<SpeciesThermoInterpType> stit_ptr) {
92 virtual void update(doublereal t, doublereal* cp_R,
93 doublereal* h_RT, doublereal* s_R)
const;
140 template<
class T1,
class T2>
144 if (&right ==
this) {
148 SpeciesThermo::operator=(right);
157 template<
class T1,
class T2>
164 template<
class T1,
class T2>
170 doublereal refPressure_)
173 if (type == m_thermo1.ID) {
174 m_thermo1.install(name, sp, type, c, minTemp_, maxTemp_,
176 speciesToType[sp] = m_thermo1.ID;
177 }
else if (type == m_thermo2.ID) {
178 m_thermo2.install(name, sp, type, c, minTemp_, maxTemp_,
180 speciesToType[sp] = m_thermo2.ID;
187 template<
class T1,
class T2>
190 doublereal* h_RT, doublereal* s_R)
const
192 m_thermo1.update(t, cp_R, h_RT, s_R);
193 m_thermo2.update(t, cp_R, h_RT, s_R);
196 template<
class T1,
class T2>
200 return getValue(speciesToType, k, -1);
203 template<
class T1,
class T2>
207 doublereal& minTemp_,
208 doublereal& maxTemp_,
209 doublereal& refPressure_)
const
211 int ctype = reportType(index);
212 if (ctype == m_thermo1.ID) {
213 m_thermo1.reportParams(index, type, c, minTemp_, maxTemp_,
215 }
else if (ctype == m_thermo2.ID) {
216 m_thermo2.reportParams(index, type, c, minTemp_, maxTemp_,
219 throw CanteraError(
"SpeciesThermoDuo",
"mismatched SpeciesThermoInterpType");
UnknownSpeciesThermo(const std::string &proc, const std::string &stype)
Alternate constructor.
std::string int2str(const int n, const std::string &fmt)
Convert an int to a string using a format converter.
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.
T2 m_thermo2
Thermo Type 2.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature.
const size_t npos
index returned by functions to indicate "no position"
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Virtual base class for the calculation of multiple-species thermodynamic reference-state property man...
doublereal m_p0
Reference pressure.
Pure Virtual base class for the species thermo manager classes.
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...
SpeciesThermoDuo & operator=(const SpeciesThermoDuo &right)
Assignment operator.
UnknownSpeciesThermo(const std::string &proc, int type)
constructor
virtual void install_STIT(size_t index, shared_ptr< SpeciesThermoInterpType > stit_ptr)
Install a new species thermodynamic property parameterization for one species.
virtual void install(const std::string &name, size_t sp, int type, const doublereal *c, doublereal minTemp, doublereal maxTemp, doublereal refPressure)
Install a new species thermodynamic property parameterization for one species.
SpeciesThermoDuo(const SpeciesThermoDuo &right)
copy constructor
Base class for exceptions thrown by Cantera classes.
virtual doublereal refPressure(size_t k=npos) const
The reference-state pressure for species k.
const U & getValue(const std::map< T, U > &m, const T &key)
Const accessor for a value in a std::map.
SpeciesThermoDuo()
Constructor.
virtual SpeciesThermo * duplMyselfAsSpeciesThermo() const
Duplication routine for objects derived from SpeciesThermo.
This species thermo manager requires that all species have one of two parameterizations.
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) ...
Unknown species thermo manager string error.
Contains declarations for string manipulation functions within Cantera.
T1 m_thermo1
Thermo Type 1.
virtual void update(doublereal t, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
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 ...
virtual int reportType(size_t k) const
This utility function reports the type of parameterization used for the species with index number ind...
std::map< size_t, int > speciesToType
map from species to type