14#ifndef CT_SHOMATEPOLY1_H
15#define CT_SHOMATEPOLY1_H
74 ShomatePoly(
double tlow,
double thigh,
double pref,
const double* coeffs) :
78 for (
size_t i = 0; i < 7; i++) {
87 if (coeffs.size() != 7) {
88 throw CanteraError(
"ShomatePoly::setParameters",
"Array must "
89 "contain 7 coefficients, but {} were given.", coeffs.size());
91 for (
size_t i = 0; i < 7; i++) {
104 doublereal tt = 1.e-3*T;
107 T_poly[2] = T_poly[1] * tt;
108 T_poly[3] = 1.0/T_poly[1];
109 T_poly[4] = std::log(tt);
126 doublereal* cp_R, doublereal* h_RT,
127 doublereal* s_R)
const {
129 doublereal Bt =
m_coeff[1]*tt[0];
130 doublereal Ct2 =
m_coeff[2]*tt[1];
131 doublereal Dt3 =
m_coeff[3]*tt[2];
132 doublereal Etm2 =
m_coeff[4]*tt[3];
133 doublereal Ftm1 =
m_coeff[5]*tt[5];
136 *cp_R = A + Bt + Ct2 + Dt3 + Etm2;
137 *h_RT = A + 0.5*Bt + 1.0/3.0*Ct2 + 0.25*Dt3 - Etm2 + Ftm1;
138 *s_R = A*tt[4] + Bt + 0.5*Ct2 + 1.0/3.0*Dt3 - 0.5*Etm2 + G;
142 doublereal* cp_R, doublereal* h_RT,
143 doublereal* s_R)
const {
150 doublereal& tlow, doublereal& thigh,
152 doublereal*
const coeffs)
const {
158 for (
int i = 0; i < 7; i++) {
167 for (
size_t i = 0; i <
m_coeff.size(); i++) {
170 thermo[
"data"].asVector<
vector_fp>().push_back(dimensioned_coeffs);
173 virtual doublereal
reportHf298(doublereal*
const h298 = 0)
const {
174 double cp_R, h_RT, s_R;
181 doublereal delH = Hf298New - hnow;
192 double m_coeff5_orig;
249 ShomatePoly2(
double tlow,
double thigh,
double pref,
const double* coeffs) :
252 msp_low(tlow, coeffs[0], pref, coeffs+1),
253 msp_high(coeffs[0], thigh, pref, coeffs+8)
299 doublereal* cp_R, doublereal* h_RT,
300 doublereal* s_R)
const {
301 double T = 1000 * tt[0];
312 doublereal* s_R)
const {
323 doublereal& tlow, doublereal& thigh,
325 doublereal*
const coeffs)
const {
333 thermo[
"model"] =
"Shomate";
335 thermo[
"temperature-ranges"].setQuantity(Tranges,
"K");
336 thermo[
"data"] = std::vector<vector_fp>();
341 virtual doublereal
reportHf298(doublereal*
const h298 = 0)
const {
356 doublereal delH = Hf298New - h298now;
358 double hnew = h + delH;
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
A map of string keys to values whose type can vary at runtime.
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 getParameters(AnyMap &thermo) const
Store the parameters of the species thermo object such that an identical species thermo object could ...
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.
virtual void getParameters(AnyMap &thermo) const
Store the parameters of the species thermo object such that an identical species thermo object could ...
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].
virtual void getParameters(AnyMap &thermo) const
Store the parameters of the species thermo object such that an identical species thermo object could ...
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.
Namespace for the Cantera kernel.
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].
#define SHOMATE
Two regions of Shomate Polynomials.
#define SHOMATE2
Two regions of Shomate Polynomials.