14 #ifndef CT_NASAPOLY1_H
15 #define CT_NASAPOLY1_H
58 NasaPoly1(
double tlow,
double thigh,
double pref,
const double* coeffs)
67 if (coeffs.size() != 7) {
68 throw CanteraError(
"NasaPoly1::setParameters",
"Array must contain "
69 "7 coefficients, but {} were given.", coeffs.size());
84 T_poly[2] = T_poly[1] * T;
85 T_poly[3] = T_poly[2] * T;
87 T_poly[5] = std::log(T);
102 doublereal* cp_R, doublereal* h_RT, doublereal* s_R)
const {
104 doublereal ct1 =
m_coeff[1]*tt[0];
105 doublereal ct2 =
m_coeff[2]*tt[1];
106 doublereal ct3 =
m_coeff[3]*tt[2];
107 doublereal ct4 =
m_coeff[4]*tt[3];
110 cp = ct0 + ct1 + ct2 + ct3 + ct4;
111 h = ct0 + 0.5*ct1 + 1.0/3.0*ct2 + 0.25*ct3 + 0.2*ct4
113 s = ct0*tt[5] + ct1 + 0.5*ct2 + 1.0/3.0*ct3
123 doublereal* cp_R, doublereal* h_RT,
124 doublereal* s_R)
const {
131 doublereal& tlow, doublereal& thigh,
133 doublereal*
const coeffs)
const {
142 virtual doublereal
reportHf298(doublereal*
const h298 = 0)
const {
144 double temp = 298.15;
147 doublereal ct1 =
m_coeff[1]*tt[0];
148 doublereal ct2 =
m_coeff[2]*tt[1];
149 doublereal ct3 =
m_coeff[3]*tt[2];
150 doublereal ct4 =
m_coeff[4]*tt[3];
152 double h_RT = ct0 + 0.5*ct1 + 1.0/3.0*ct2 + 0.25*ct3 + 0.2*ct4
164 double delH = Hf298New - hcurr;
176 double m_coeff5_orig;
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
Base class for exceptions thrown by Cantera classes.
The NASA polynomial parameterization for one temperature range.
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 polynomial coefficients, stored in the order [a0, ..., a6]
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.
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.
NasaPoly1(double tlow, double thigh, double pref, const double *coeffs)
Constructor with all input data.
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.
doublereal m_lowT
lowest valid temperature
doublereal m_highT
Highest valid temperature.
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 NASA1
7 coefficient NASA Polynomials This is implemented in the class NasaPoly1 in NasaPoly1....