10 #ifndef CT_SHOMATETHERMO_H
11 #define CT_SHOMATETHERMO_H
78 "Cantera 2.2. Use GeneralSpeciesThermo instead.");
100 if (&right ==
this) {
104 SpeciesThermo::operator=(right);
151 virtual void install(
const std::string& name,
size_t index,
int type,
157 "Incompatible thermo parameterization: Got " +
161 int imid = int(c[0]);
164 std::vector<ShomatePoly> v;
174 doublereal tmid = c[0];
177 const doublereal* clow = c + 1;
178 const doublereal* chigh = c + 8;
180 refPressure, chigh));
185 if (
m_tlow.size() < index + 1) {
186 m_tlow.resize(index + 1, tlow);
187 m_thigh.resize(index + 1, thigh);
194 }
else if (fabs(
m_p0 - refPressure) > 0.1) {
195 std::string logmsg =
" ERROR ShomateThermo: New Species, " + name
196 +
", has a different reference pressure, "
197 +
fp2str(refPressure) +
", than existing reference pressure, " +
fp2str(
m_p0) +
"\n";
199 logmsg =
" This is now a fatal error\n";
201 throw CanteraError(
"install()",
"Species have different reference pressures");
208 shared_ptr<SpeciesThermoInterpType> stit_ptr) {
220 virtual void update_one(
size_t k, doublereal t, doublereal* cp_R,
221 doublereal* h_RT, doublereal* s_R)
const {
222 doublereal tt = 1.e-3*t;
233 const std::vector<ShomatePoly> &mlg =
m_low[grp-1];
239 const std::vector<ShomatePoly> &mhg =
m_high[grp-1];
245 virtual void update(doublereal t, doublereal* cp_R,
246 doublereal* h_RT, doublereal* s_R)
const {
247 doublereal tt = 1.e-3*t;
256 std::vector<ShomatePoly>::const_iterator _begin, _end;
259 _begin =
m_high[i].begin();
262 _begin =
m_low[i].begin();
263 _end =
m_low[i].end();
265 for (; _begin != _end; ++_begin) {
266 _begin->updateProperties(&
m_t[0], cp_R, h_RT, s_R);
305 const std::vector<ShomatePoly> &mlg =
m_low[grp-1];
306 const std::vector<ShomatePoly> &mhg =
m_high[grp-1];
309 doublereal tmid = lowPoly->
maxTemp();
317 "Index mismatch in low-T polynomial");
321 "Thermo type mismatch in low-T polynomial");
327 "Index mismatch in high-T polynomial");
331 "Thermo type mismatch in high-T polynomial");
334 throw CanteraError(
"ShomateThermo::reportParams",
"Thermo type mismatch");
359 double delH = Hf298New - hnow;
363 double hnew = h + delH;
368 double hnew = h + delH;
381 std::vector<std::vector<ShomatePoly> >
m_high;
389 std::vector<std::vector<ShomatePoly> >
m_low;
vector_fp m_tlow
Vector of low temperature limits (species index)
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 using Shomate polynomia...
std::string int2str(const int n, const std::string &fmt)
Convert an int to a string using a format converter.
virtual int reportType(size_t index) const
This utility function reports the type of parameterization used for the species with index number ind...
const int ID
Initialized to the type of parameterization.
#define SHOMATE
Two regions of Shomate Polynomials.
doublereal m_p0
Reference pressure (Pa)
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
const size_t npos
index returned by functions to indicate "no position"
virtual void reportParameters(size_t &n, int &type, doublereal &tlow, doublereal &thigh, doublereal &pref, doublereal *const coeffs) const
This utility function reports back the type of parameterization and all of the parameters for the spe...
virtual void updateProperties(const doublereal *tt, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Update the properties for this species, given a temperature polynomial.
std::vector< std::vector< ShomatePoly > > m_low
Vector of vector of NasaPoly1's for the low temp region.
vector_fp m_t
Vector of temperature polynomials.
doublereal m_tlow_max
Maximum value of the low temperature limit.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen).
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 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...
Pure Virtual base class for the species thermo manager classes.
ShomateThermo(const ShomateThermo &right)
Copy Constructor.
std::map< size_t, size_t > m_posInGroup_map
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) ...
std::map< size_t, size_t > m_group_map
void markInstalled(size_t k)
Mark species k as having its thermodynamic data installed.
virtual doublereal maxTemp() const
Returns the maximum temperature that the thermo parameterization is valid.
std::vector< std::vector< ShomatePoly > > m_high
Vector of vector of NasaPoly1's for the high temp region.
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_thigh_min
Minimum value of the high temperature limit.
std::map< int, int > m_index
Map between the midpoint temperature, as an int, to the group number.
The Shomate polynomial parameterization for one temperature range for one species.
Header for a single-species standard state object derived from SpeciesThermoInterpType based on the S...
ShomateThermo & operator=(const ShomateThermo &right)
Assignment Operator.
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
virtual void install_STIT(size_t index, shared_ptr< SpeciesThermoInterpType > stit_ptr)
Install a new species thermodynamic property parameterization for one species.
virtual void update(doublereal t, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
Base class for exceptions thrown by Cantera classes.
const U & getValue(const std::map< T, U > &m, const T &key)
Const accessor for a value in a std::map.
vector_fp m_thigh
Vector of low temperature limits (species index)
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature.
virtual doublereal refPressure(size_t k=npos) const
The reference-state pressure for species k.
int m_ngroups
number of groups
This file contains descriptions of templated subclasses of the virtual base class, SpeciesThermo, which includes SpeciesThermoDuo (see Managers for Calculating Reference-State Thermodynamics and class SpeciesThermoDuo)
A species thermodynamic property manager for the Shomate polynomial parameterization.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.
virtual SpeciesThermo * duplMyselfAsSpeciesThermo() const
Duplication routine for objects derived from SpeciesThermo.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
vector_fp m_tmid
Vector of log temperature limits.
ShomateThermo()
constructor
void writelog(const std::string &msg)
Write a message to the screen.
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 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.
#define SHOMATE1
one region of Shomate Polynomials used in NIST database This is implemented in the NIST database...