60 NasaPoly1(
double tlow,
double thigh,
double pref,
const double* coeffs)
69 if (coeffs.size() != 7) {
70 throw CanteraError(
"NasaPoly1::setParameters",
"Array must contain "
71 "7 coefficients, but {} were given.", coeffs.size());
86 T_poly[2] = T_poly[1] * T;
87 T_poly[3] = T_poly[2] * T;
89 T_poly[5] = std::log(T);
104 doublereal* cp_R, doublereal* h_RT, doublereal* s_R)
const {
106 doublereal ct1 =
m_coeff[1]*tt[0];
107 doublereal ct2 =
m_coeff[2]*tt[1];
108 doublereal ct3 =
m_coeff[3]*tt[2];
109 doublereal ct4 =
m_coeff[4]*tt[3];
112 cp = ct0 + ct1 + ct2 + ct3 + ct4;
113 h = ct0 + 0.5*ct1 + 1.0/3.0*ct2 + 0.25*ct3 + 0.2*ct4
115 s = ct0*tt[5] + ct1 + 0.5*ct2 + 1.0/3.0*ct3
125 doublereal* cp_R, doublereal* h_RT,
126 doublereal* s_R)
const {
133 doublereal& tlow, doublereal& thigh,
135 doublereal*
const coeffs)
const {
150 virtual doublereal
reportHf298(doublereal*
const h298 = 0)
const {
152 double temp = 298.15;
155 doublereal ct1 =
m_coeff[1]*tt[0];
156 doublereal ct2 =
m_coeff[2]*tt[1];
157 doublereal ct3 =
m_coeff[3]*tt[2];
158 doublereal ct4 =
m_coeff[4]*tt[3];
160 double h_RT = ct0 + 0.5*ct1 + 1.0/3.0*ct2 + 0.25*ct3 + 0.2*ct4
172 double delH = Hf298New - hcurr;
184 double m_coeff5_orig;
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 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.
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.
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.
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].
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
#define NASA1
7 coefficient NASA Polynomials This is implemented in the class NasaPoly1 in NasaPoly1....