24 m_speciesLoc(b.m_speciesLoc),
25 m_tlow_max(b.m_tlow_max),
26 m_thigh_min(b.m_thigh_min),
31 for (STIT_map::const_iterator iter = b.
m_sp.begin();
34 for (
size_t k = 0; k < iter->second.size(); k++) {
35 size_t i = iter->second[k].first;
36 shared_ptr<SpeciesThermoInterpType> spec(
37 iter->second[k].second->duplMyselfAsSpeciesThermoInterpType());
38 m_sp[iter->first].push_back(std::make_pair(i, spec));
50 SpeciesThermo::operator=(b);
53 for (STIT_map::const_iterator iter = b.
m_sp.begin();
56 for (
size_t k = 0; k < iter->second.size(); k++) {
57 size_t i = iter->second[k].first;
58 shared_ptr<SpeciesThermoInterpType> spec(
59 iter->second[k].second->duplMyselfAsSpeciesThermoInterpType());
60 m_sp[iter->first].push_back(std::make_pair(i, spec));
65 m_speciesLoc = b.m_speciesLoc;
85 doublereal refPressure_)
88 "Use newSpeciesThermoInterpType and "
89 "GeneralSpeciesThermo::install_STIT instead");
90 if (minTemp_ <= 0.0) {
92 "T_min must be positive");
99 minTemp_, maxTemp_, refPressure_, c));
105 shared_ptr<SpeciesThermoInterpType> stit_ptr)
108 throw CanteraError(
"GeneralSpeciesThermo::install_STIT",
111 AssertThrow(m_speciesLoc.find(index) == m_speciesLoc.end(),
112 "Index position isn't null, duplication of assignment: " +
int2str(index));
113 int type = stit_ptr->reportType();
114 m_speciesLoc[index] = std::make_pair(type,
m_sp[type].size());
115 m_sp[type].push_back(std::make_pair(index, stit_ptr));
116 if (
m_sp[type].size() == 1) {
117 m_tpoly[type].resize(stit_ptr->temperaturePolySize());
129 shared_ptr<SpeciesThermoInterpType> stit_ptr(
new STITbyPDSS(k, vpssmgr_ptr, PDSS_ptr));
134 doublereal* h_RT, doublereal* s_R)
const
143 doublereal* h_RT, doublereal* s_R)
const
145 STIT_map::const_iterator iter =
m_sp.begin();
146 tpoly_map::iterator jter =
m_tpoly.begin();
147 for (; iter !=
m_sp.end(); iter++, jter++) {
148 const std::vector<index_STIT>& species = iter->second;
149 double* tpoly = &jter->second[0];
150 species[0].second->updateTemperaturePoly(t, tpoly);
151 for (
size_t k = 0; k < species.size(); k++) {
152 size_t i = species[k].first;
153 species[k].second->updateProperties(tpoly, cp_R+i, h_RT+i, s_R+i);
168 doublereal*
const c, doublereal& minTemp_, doublereal& maxTemp_,
169 doublereal& refPressure_)
const
217 const std::pair<int, size_t>& loc =
getValue(m_speciesLoc, k);
218 return getValue(
m_sp, loc.first)[loc.second].second.get();
219 }
catch (std::out_of_range&) {
227 const std::pair<int, size_t>& loc =
getValue(m_speciesLoc, k);
228 return getValue(
m_sp, loc.first)[loc.second].second.get();
229 }
catch (std::out_of_range&) {
SpeciesThermoInterpType * provideSTIT(size_t k)
Provide the SpeciesthermoInterpType object.
std::string int2str(const int n, const std::string &fmt)
Convert an int to a string using a format converter.
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
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) ...
STIT_map m_sp
This is the main data structure, which contains the SpeciesThermoInterpType objects, sorted by the parameterization type.
const doublereal OneAtm
One atmosphere [Pa].
SpeciesThermoInterpType * newSpeciesThermoInterpType(int type, double tlow, double thigh, double pref, const double *coeffs)
Create a new SpeciesThermoInterpType object given a corresponding constant.
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 base class for the classes that manage the calculation of standard state properties for all t...
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.
const size_t npos
index returned by functions to indicate "no position"
virtual SpeciesThermo * duplMyselfAsSpeciesThermo() const
Duplication routine for objects derived from SpeciesThermo.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
doublereal m_tlow_max
Maximum value of the lowest temperature.
Pure Virtual base class for the species thermo manager classes.
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) ...
virtual int reportType() const =0
Returns an integer representing the type of parameterization.
void markInstalled(size_t k)
Mark species k as having its thermodynamic data installed.
virtual doublereal refPressure() const
Returns the reference pressure (Pa)
virtual doublereal maxTemp() const
Returns the maximum temperature that the thermo parameterization is valid.
A species thermodynamic property manager for a phase.
GeneralSpeciesThermo & operator=(const GeneralSpeciesThermo &b)
Assignment operator.
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...
Class for the thermodynamic manager for an individual species' reference state which uses the PDSS ba...
#define AssertThrow(expr, procedure)
Assertion must be true or an error is thrown.
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.
Base class for exceptions thrown by Cantera classes.
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature.
virtual void install_STIT(size_t index, shared_ptr< SpeciesThermoInterpType > stit_ptr)
Install a new species thermodynamic property parameterization for one species.
const U & getValue(const std::map< T, U > &m, const T &key)
Const accessor for a value in a std::map.
virtual doublereal minTemp() const
Returns the minimum temperature that the thermo parameterization is valid.
Header for factory to build instances of classes that manage the standard-state thermodynamic propert...
Headers for a completely general species thermodynamic property manager for a phase (see Managers for...
doublereal m_p0
reference pressure (Pa)
Virtual base class for a species with a pressure dependent standard state.
virtual doublereal refPressure(size_t k=npos) const
The reference-state pressure for species k.
tpoly_map m_tpoly
Temperature polynomials for each thermo parameterization.
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.
doublereal m_thigh_min
Minimum value of the highest temperature.
virtual int reportType(size_t index) const
This utility function reports the type of parameterization used for the species with index number ind...
GeneralSpeciesThermo()
Constructor.
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 install(const std::string &name, size_t index, int type, const doublereal *c, doublereal minTemp, doublereal maxTemp, doublereal refPressure)
Install a new species thermodynamic property parameterization for one species.
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 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 ...
void installPDSShandler(size_t k, PDSS *PDSS_ptr, VPSSMgr *vpssmgr_ptr)
Install a PDSS object to handle the reference state thermodynamics calculation.