12 #ifndef CT_SHOMATEPOLY1_H
13 #define CT_SHOMATEPOLY1_H
82 ShomatePoly(
size_t n, doublereal tlow, doublereal thigh, doublereal pref,
83 const doublereal* coeffs) :
87 std::copy(coeffs, coeffs + 7,
m_coeff.begin());
109 SpeciesThermoInterpType::operator=(b);
150 doublereal* cp_R, doublereal* h_RT,
151 doublereal* s_R)
const {
154 doublereal Bt =
m_coeff[1]*tt[0];
155 doublereal Ct2 =
m_coeff[2]*tt[1];
156 doublereal Dt3 =
m_coeff[3]*tt[2];
157 doublereal Etm2 =
m_coeff[4]*tt[3];
162 cp = A + Bt + Ct2 + Dt3 + Etm2;
163 h = tt[0]*(A + 0.5*Bt +
OneThird*Ct2 + 0.25*Dt3 - Etm2) + F;
164 s = A*tt[4] + Bt + 0.5*Ct2 +
OneThird*Dt3 - 0.5*Etm2 + G;
175 cp_R[
m_index] = 1.e3 * cp * tt[5];
176 h_RT[
m_index] = 1.e6 * h * tt[6];
177 s_R[
m_index] = 1.e3 * s * tt[5];
181 doublereal* cp_R, doublereal* h_RT,
182 doublereal* s_R)
const {
184 doublereal tt = 1.e-3*temp;
187 tPoly[2] = tPoly[1] * tt;
188 tPoly[3] = 1.0/tPoly[1];
189 tPoly[4] = std::log(tt);
197 doublereal& tlow, doublereal& thigh,
199 doublereal*
const coeffs)
const {
206 for (
int i = 0; i < 7; i++) {
220 "modifying something that hasn't been initialized");
222 std::copy(coeffs, coeffs + 7,
m_coeff.begin());
225 #ifdef H298MODIFY_CAPABILITY
227 virtual doublereal reportHf298(doublereal*
const h298 = 0)
const {
229 doublereal tt = 1.e-3*298.15;
232 tPoly[2] = tPoly[1] * tt;
233 tPoly[3] = 1.0/tPoly[1];
236 doublereal Bt =
m_coeff[1]*tPoly[0];
237 doublereal Ct2 =
m_coeff[2]*tPoly[1];
238 doublereal Dt3 =
m_coeff[3]*tPoly[2];
239 doublereal Etm2 =
m_coeff[4]*tPoly[3];
242 doublereal h = tPoly[0]*(A + 0.5*Bt +
OneThird*Ct2 + 0.25*Dt3 - Etm2) + F;
244 double hh = 1.e6 * h;
251 virtual void modifyOneHf298(
const int k,
const doublereal Hf298New) {
252 doublereal hnow = reportHf298();
253 doublereal delH = Hf298New - hnow;
330 ShomatePoly2(
size_t n, doublereal tlow, doublereal thigh, doublereal pref,
331 const doublereal* coeffs) :
338 std::copy(coeffs, coeffs + 15,
m_coeff.begin());
370 SpeciesThermoInterpType::operator=(b);
422 doublereal* cp_R, doublereal* h_RT,
423 doublereal* s_R)
const {
424 double T = 1000 * tt[0];
435 doublereal* s_R)
const {
445 doublereal& tlow, doublereal& thigh,
447 doublereal*
const coeffs)
const {
454 for (
int i = 0; i < 15; i++) {
470 std::copy(coeffs, coeffs + 15,
m_coeff.begin());
476 #ifdef H298MODIFY_CAPABILITY
478 virtual doublereal reportHf298(doublereal*
const h298 = 0)
const {
481 h =
msp_low->reportHf298(h298);
491 virtual void modifyOneHf298(
const size_t& k,
const doublereal Hf298New) {
496 doublereal h298now = reportHf298(0);
497 doublereal delH = Hf298New - h298now;
498 double h =
msp_low->reportHf298(0);
499 double hnew = h + delH;
500 msp_low->modifyOneHf298(k, hnew);
doublereal m_midT
Midrange temperature (kelvin)
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.
vector_fp m_coeff
Array of coeffcients.
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
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 SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
duplicator
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
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.
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, HTML_logs (see Input File Handling, Diagnostic Output, Writing messages to the screen and Writing HTML Logfiles).
ShomatePoly(const ShomatePoly &b)
copy constructor
ShomatePoly * msp_high
Pointer to the 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...
const doublereal OneThird
1/3
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.
ShomatePoly * msp_low
Pointer to the Shomate polynomial for the low temperature region.
doublereal m_highT
Highest valid temperature.
virtual ~ShomatePoly2()
Destructor.
virtual void modifyParameters(doublereal *coeffs)
Modify parameters for the standard state.
Base class for exceptions thrown by Cantera classes.
#define SHOMATE2
Two regions of Shomate Polynomials.
doublereal m_lowT
lowest valid temperature
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
virtual SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
duplicator
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 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 void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
ShomatePoly2 & operator=(const ShomatePoly2 &b)
Assignment operator.