12 #ifndef CT_SHOMATEPOLY1_H
13 #define CT_SHOMATEPOLY1_H
85 ShomatePoly(
size_t n, doublereal tlow, doublereal thigh, doublereal pref,
86 const doublereal* coeffs) :
103 ShomatePoly(
double tlow,
double thigh,
double pref,
const double* coeffs) :
125 SpeciesThermoInterpType::operator=(b);
132 duplMyselfAsSpeciesThermoInterpType()
const {
144 doublereal tt = 1.e-3*T;
147 T_poly[2] = T_poly[1] * tt;
148 T_poly[3] = 1.0/T_poly[1];
149 T_poly[4] = std::log(tt);
176 doublereal* cp_R, doublereal* h_RT,
177 doublereal* s_R)
const {
180 doublereal Bt =
m_coeff[1]*tt[0];
181 doublereal Ct2 =
m_coeff[2]*tt[1];
182 doublereal Dt3 =
m_coeff[3]*tt[2];
183 doublereal Etm2 =
m_coeff[4]*tt[3];
188 cp = A + Bt + Ct2 + Dt3 + Etm2;
189 h = tt[0]*(A + 0.5*Bt + 1.0/3.0*Ct2 + 0.25*Dt3 - Etm2) + F;
190 s = A*tt[4] + Bt + 0.5*Ct2 + 1.0/3.0*Dt3 - 0.5*Etm2 + G;
201 cp_R[
m_index] = 1.e3 * cp * tt[5];
202 h_RT[
m_index] = 1.e6 * h * tt[6];
203 s_R[
m_index] = 1.e3 * s * tt[5];
207 doublereal* cp_R, doublereal* h_RT,
208 doublereal* s_R)
const {
215 doublereal& tlow, doublereal& thigh,
217 doublereal*
const coeffs)
const {
223 for (
int i = 0; i < 7; i++) {
236 "modifying something that hasn't been initialized");
238 std::copy(coeffs, coeffs + 7,
m_coeff.begin());
241 virtual doublereal
reportHf298(doublereal*
const h298 = 0)
const {
245 doublereal Bt =
m_coeff[1]*tPoly[0];
246 doublereal Ct2 =
m_coeff[2]*tPoly[1];
247 doublereal Dt3 =
m_coeff[3]*tPoly[2];
248 doublereal Etm2 =
m_coeff[4]*tPoly[3];
251 doublereal h = tPoly[0]*(A + 0.5*Bt + 1.0/3.0*Ct2 + 0.25*Dt3 - Etm2) + F;
253 double hh = 1.e6 * h;
262 doublereal delH = Hf298New - hnow;
337 ShomatePoly2(
size_t n, doublereal tlow, doublereal thigh, doublereal pref,
338 const doublereal* coeffs) :
341 msp_low(n, tlow, coeffs[0], pref, coeffs+1),
342 msp_high(n, coeffs[0], thigh, pref, coeffs+8),
355 ShomatePoly2(
double tlow,
double thigh,
double pref,
const double* coeffs) :
358 msp_low(tlow, coeffs[0], pref, coeffs+1),
359 msp_high(coeffs[0], thigh, pref, coeffs+8),
383 SpeciesThermoInterpType::operator=(b);
393 duplMyselfAsSpeciesThermoInterpType()
const {
435 doublereal* cp_R, doublereal* h_RT,
436 doublereal* s_R)
const {
437 double T = 1000 * tt[0];
448 doublereal* s_R)
const {
457 doublereal& tlow, doublereal& thigh,
459 doublereal*
const coeffs)
const {
465 for (
int i = 0; i < 15; i++) {
478 std::copy(coeffs, coeffs + 15,
m_coeff.begin());
484 virtual doublereal
reportHf298(doublereal*
const h298 = 0)
const {
503 doublereal delH = Hf298New - h298now;
505 double hnew = h + delH;
doublereal m_midT
Midrange temperature (kelvin)
virtual size_t temperaturePolySize() const
Number of terms in the temperature polynomial for this parameterization.
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
ShomatePoly2(size_t n, doublereal tlow, doublereal thigh, doublereal pref, const doublereal *coeffs)
Constructor used in templated instantiations.
#define SHOMATE
Two regions of Shomate Polynomials.
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) ...
vector_fp m_coeff
Array of coefficients.
virtual void modifyParameters(doublereal *coeffs)
Modify parameters for the standard state.
ShomatePoly()
Empty constructor.
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.
size_t m_index
species index
virtual void setIndex(size_t index)
ShomatePoly(size_t n, doublereal tlow, doublereal thigh, doublereal pref, const doublereal *coeffs)
Constructor used in templated instantiations.
vector_fp m_coeff
Array of the original coefficients.
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) ...
ShomatePoly(const ShomatePoly &b)
copy constructor
ShomatePoly msp_high
Shomate polynomial for the high temperature region.
virtual int reportType() const
Returns an integer representing the type of parameterization.
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
virtual void updateTemperaturePoly(double T, double *T_poly) const
Given the temperature T, compute the terms of the temperature polynomial T_poly.
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) ...
ShomatePoly2(const ShomatePoly2 &b)
Copy constructor.
The Shomate polynomial parameterization for one temperature range for one species.
The Shomate polynomial parameterization for two temperature ranges for one species.
virtual void updateTemperaturePoly(double T, double *T_poly) const
Given the temperature T, compute the terms of the temperature polynomial T_poly.
doublereal m_highT
Highest valid temperature.
virtual void modifyParameters(doublereal *coeffs)
Modify parameters for the standard state.
Base class for exceptions thrown by Cantera classes.
ShomatePoly msp_low
Shomate polynomial for the low temperature region.
#define SHOMATE2
Two regions of Shomate Polynomials.
doublereal m_lowT
lowest valid temperature
ShomatePoly2(double tlow, double thigh, double pref, const double *coeffs)
Normal constructor.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
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...
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
virtual int reportType() const
Returns an integer representing the type of parameterization.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
ShomatePoly & operator=(const ShomatePoly &b)
Assignment operator.
virtual void setIndex(size_t index)
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.
doublereal m_Pref
Reference state pressure.
ShomatePoly2()
Empty constructor.
virtual size_t temperaturePolySize() const
Number of terms in the temperature polynomial for this parameterization.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
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) ...
ShomatePoly2 & operator=(const ShomatePoly2 &b)
Assignment operator.
ShomatePoly(double tlow, double thigh, double pref, const double *coeffs)
Normal constructor.