14 #ifndef CT_SHOMATEPOLY1_H
15 #define CT_SHOMATEPOLY1_H
73 ShomatePoly(
double tlow,
double thigh,
double pref,
const double* coeffs) :
77 for (
size_t i = 0; i < 7; i++) {
86 if (coeffs.size() != 7) {
87 throw CanteraError(
"ShomatePoly::setParameters",
"Array must "
88 "contain 7 coefficients, but {} were given.", coeffs.size());
90 for (
size_t i = 0; i < 7; i++) {
103 doublereal tt = 1.e-3*T;
106 T_poly[2] = T_poly[1] * tt;
107 T_poly[3] = 1.0/T_poly[1];
108 T_poly[4] = std::log(tt);
125 doublereal* cp_R, doublereal* h_RT,
126 doublereal* s_R)
const {
128 doublereal Bt =
m_coeff[1]*tt[0];
129 doublereal Ct2 =
m_coeff[2]*tt[1];
130 doublereal Dt3 =
m_coeff[3]*tt[2];
131 doublereal Etm2 =
m_coeff[4]*tt[3];
132 doublereal Ftm1 =
m_coeff[5]*tt[5];
135 *cp_R = A + Bt + Ct2 + Dt3 + Etm2;
136 *h_RT = A + 0.5*Bt + 1.0/3.0*Ct2 + 0.25*Dt3 - Etm2 + Ftm1;
137 *s_R = A*tt[4] + Bt + 0.5*Ct2 + 1.0/3.0*Dt3 - 0.5*Etm2 + G;
141 doublereal* cp_R, doublereal* h_RT,
142 doublereal* s_R)
const {
149 doublereal& tlow, doublereal& thigh,
151 doublereal*
const coeffs)
const {
157 for (
int i = 0; i < 7; i++) {
162 virtual doublereal
reportHf298(doublereal*
const h298 = 0)
const {
163 double cp_R, h_RT, s_R;
170 doublereal delH = Hf298New - hnow;
181 double m_coeff5_orig;
238 ShomatePoly2(
double tlow,
double thigh,
double pref,
const double* coeffs) :
241 msp_low(tlow, coeffs[0], pref, coeffs+1),
242 msp_high(coeffs[0], thigh, pref, coeffs+8)
288 doublereal* cp_R, doublereal* h_RT,
289 doublereal* s_R)
const {
290 double T = 1000 * tt[0];
301 doublereal* s_R)
const {
312 doublereal& tlow, doublereal& thigh,
314 doublereal*
const coeffs)
const {
320 virtual doublereal
reportHf298(doublereal*
const h298 = 0)
const {
335 doublereal delH = Hf298New - h298now;
337 double hnew = h + delH;
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
Base class for exceptions thrown by Cantera classes.
The Shomate polynomial parameterization for two temperature ranges for one species.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
ShomatePoly msp_low
Shomate polynomial for the low temperature region.
virtual void updateTemperaturePoly(double T, double *T_poly) const
Given the temperature T, compute the terms of the temperature polynomial T_poly.
virtual void setRefPressure(double Pref)
Set the reference pressure [Pa].
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.
ShomatePoly2(double tlow, double thigh, double pref, const double *coeffs)
Constructor with all input data.
virtual void resetHf298()
Restore the original heat of formation for this species.
void setParameters(double Tmid, const vector_fp &low, const vector_fp &high)
ShomatePoly msp_high
Shomate polynomial for the high temperature region.
virtual void reportParameters(size_t &n, int &type, doublereal &tlow, doublereal &thigh, doublereal &pref, doublereal *const coeffs) const
This utility function returns the type of parameterization and all of the parameters for the species.
virtual void setMinTemp(double Tmin)
Set the minimum temperature at which the thermo parameterization is valid.
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_midT
Midrange temperature (kelvin)
virtual size_t temperaturePolySize() const
Number of terms in the temperature polynomial for this parameterization.
virtual void setMaxTemp(double Tmax)
Set the maximum temperature at which the thermo parameterization is valid.
virtual int reportType() const
Returns an integer representing the type of parameterization.
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 size_t nCoeffs() const
This utility function returns the number of coefficients for a given type of species parameterization...
The Shomate polynomial parameterization for one temperature range for one species.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
vector_fp m_coeff
Array of coefficients.
virtual void updateTemperaturePoly(double T, double *T_poly) const
Given the temperature T, compute the terms of the temperature polynomial T_poly.
void setParameters(const vector_fp &coeffs)
Set array of 7 polynomial coefficients.
ShomatePoly(double tlow, double thigh, double pref, const double *coeffs)
Constructor with all input data.
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.
virtual void resetHf298()
Restore the original heat of formation for this species.
virtual void reportParameters(size_t &n, int &type, doublereal &tlow, doublereal &thigh, doublereal &pref, doublereal *const coeffs) const
This utility function returns the type of parameterization and all of the parameters for the species.
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 size_t temperaturePolySize() const
Number of terms in the temperature polynomial for this parameterization.
virtual int reportType() const
Returns an integer representing the type of parameterization.
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)
Abstract Base class for the thermodynamic manager for an individual species' reference state.
virtual void setRefPressure(double Pref)
Set the reference pressure [Pa].
doublereal m_lowT
lowest valid temperature
virtual void setMinTemp(double Tmin)
Set the minimum temperature at which the thermo parameterization is valid.
doublereal m_highT
Highest valid temperature.
virtual void setMaxTemp(double Tmax)
Set the maximum temperature at which the thermo parameterization is valid.
doublereal m_Pref
Reference state pressure.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
const double GasConstant
Universal Gas Constant [J/kmol/K].
Namespace for the Cantera kernel.
#define SHOMATE
Two regions of Shomate Polynomials.
#define SHOMATE2
Two regions of Shomate Polynomials.