Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members

The NASA polynomial parameterization for two temperature ranges. More...

#include <NasaPoly2.h>

Inheritance diagram for NasaPoly2:
[legend]
Collaboration diagram for NasaPoly2:
[legend]

Public Member Functions

 NasaPoly2 ()
 Empty constructor. More...
 
 NasaPoly2 (size_t n, doublereal tlow, doublereal thigh, doublereal pref, const doublereal *coeffs)
 Full Constructor. More...
 
 NasaPoly2 (doublereal tlow, doublereal thigh, doublereal pref, const doublereal *coeffs)
 Full Constructor. More...
 
 NasaPoly2 (const NasaPoly2 &b)
 Copy Constructor. More...
 
NasaPoly2operator= (const NasaPoly2 &b)
 Assignment operator. More...
 
virtual SpeciesThermoInterpTypeduplMyselfAsSpeciesThermoInterpType () const
 
virtual int reportType () const
 Returns an integer representing the type of parameterization. More...
 
virtual void setIndex (size_t index)
 
virtual size_t temperaturePolySize () const
 Number of terms in the temperature polynomial for this parameterization. More...
 
virtual void updateTemperaturePoly (double T, double *T_poly) const
 Given the temperature T, compute the terms of the temperature polynomial T_poly. More...
 
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. More...
 
void updatePropertiesTemp (const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
 Compute the reference-state property of one species. More...
 
void reportParameters (size_t &n, int &type, doublereal &tlow, doublereal &thigh, doublereal &pref, doublereal *const coeffs) const
 This utility function reports back the type of parameterization and all of the parameters for the species, index. More...
 
doublereal reportHf298 (doublereal *const h298=0) const
 Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) More...
 
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) More...
 
void validate (const std::string &name)
 Check for problems with the parameterization, and generate warnings or throw and exception if any are found. More...
 
- Public Member Functions inherited from SpeciesThermoInterpType
 SpeciesThermoInterpType (size_t n, doublereal tlow, doublereal thigh, doublereal pref)
 
 SpeciesThermoInterpType (double tlow, double thigh, double pref)
 
 SpeciesThermoInterpType (const SpeciesThermoInterpType &b)
 
virtual doublereal minTemp () const
 Returns the minimum temperature that the thermo parameterization is valid. More...
 
virtual doublereal maxTemp () const
 Returns the maximum temperature that the thermo parameterization is valid. More...
 
virtual doublereal refPressure () const
 Returns the reference pressure (Pa) More...
 
virtual size_t speciesIndex () const
 Returns an integer representing the species index. More...
 
virtual void modifyParameters (doublereal *coeffs)
 Modify parameters for the standard state. More...
 

Protected Attributes

doublereal m_midT
 Midrange temperature. More...
 
NasaPoly1 mnp_low
 NasaPoly1 object for the low temperature region. More...
 
NasaPoly1 mnp_high
 NasaPoly1 object for the high temperature region. More...
 
vector_fp m_coeff
 array of polynomial coefficients More...
 
- Protected Attributes inherited from SpeciesThermoInterpType
doublereal m_lowT
 lowest valid temperature More...
 
doublereal m_highT
 Highest valid temperature. More...
 
doublereal m_Pref
 Reference state pressure. More...
 
size_t m_index
 species index More...
 

Detailed Description

The NASA polynomial parameterization for two temperature ranges.

This parameterization expresses the heat capacity as a fourth-order polynomial. Note that this is the form used in the 1971 NASA equilibrium program and by the Chemkin software package, but differs from the form used in the more recent NASA equilibrium program.

Seven coefficients \((a_0,\dots,a_6)\) are used to represent \( c_p^0(T)\), \( h^0(T)\), and \( s^0(T) \) as polynomials in \( T \) :

\[ \frac{c_p(T)}{R} = a_0 + a_1 T + a_2 T^2 + a_3 T^3 + a_4 T^4 \]

\[ \frac{h^0(T)}{RT} = a_0 + \frac{a_1}{2} T + \frac{a_2}{3} T^2 + \frac{a_3}{4} T^3 + \frac{a_4}{5} T^4 + \frac{a_5}{T}. \]

\[ \frac{s^0(T)}{R} = a_0\ln T + a_1 T + \frac{a_2}{2} T^2 + \frac{a_3}{3} T^3 + \frac{a_4}{4} T^4 + a_6. \]

This class is designed specifically for use by the class GeneralSpeciesThermo.

Definition at line 48 of file NasaPoly2.h.

Constructor & Destructor Documentation

NasaPoly2 ( )
inline

Empty constructor.

Definition at line 52 of file NasaPoly2.h.

NasaPoly2 ( size_t  n,
doublereal  tlow,
doublereal  thigh,
doublereal  pref,
const doublereal *  coeffs 
)
inline

Full Constructor.

Parameters
nSpecies index
tlowoutput - Minimum temperature
thighoutput - Maximum temperature
prefoutput - reference pressure (Pa).
coeffsVector of coefficients used to set the parameters for the standard state [Tmid, 7 low-T coeffs, 7 high-T coeffs]
Deprecated:
Use constructor without species index. To be removed after Cantera 2.2.

Definition at line 68 of file NasaPoly2.h.

NasaPoly2 ( doublereal  tlow,
doublereal  thigh,
doublereal  pref,
const doublereal *  coeffs 
)
inline

Full Constructor.

Parameters
tlowoutput - Minimum temperature
thighoutput - Maximum temperature
prefoutput - reference pressure (Pa).
coeffsVector of coefficients used to set the parameters for the standard state [Tmid, 7 high-T coeffs, 7 low-T coeffs]. This is the coefficient order used in the standard NASA format.

Definition at line 87 of file NasaPoly2.h.

NasaPoly2 ( const NasaPoly2 b)
inline

Copy Constructor.

Parameters
bobject to be copied.

Definition at line 100 of file NasaPoly2.h.

Member Function Documentation

NasaPoly2& operator= ( const NasaPoly2 b)
inline

Assignment operator.

Parameters
bobject to be copied.

Definition at line 112 of file NasaPoly2.h.

References NasaPoly2::m_coeff, NasaPoly2::m_midT, NasaPoly2::mnp_high, and NasaPoly2::mnp_low.

virtual int reportType ( ) const
inlinevirtual

Returns an integer representing the type of parameterization.

Implements SpeciesThermoInterpType.

Definition at line 129 of file NasaPoly2.h.

References NASA2.

virtual void setIndex ( size_t  index)
inlinevirtual
virtual size_t temperaturePolySize ( ) const
inlinevirtual

Number of terms in the temperature polynomial for this parameterization.

Reimplemented from SpeciesThermoInterpType.

Definition at line 139 of file NasaPoly2.h.

virtual void updateTemperaturePoly ( double  T,
double *  T_poly 
) const
inlinevirtual

Given the temperature T, compute the terms of the temperature polynomial T_poly.

Reimplemented from SpeciesThermoInterpType.

Definition at line 141 of file NasaPoly2.h.

References NasaPoly2::mnp_low, and NasaPoly1::updateTemperaturePoly().

void updateProperties ( const doublereal *  tt,
doublereal *  cp_R,
doublereal *  h_RT,
doublereal *  s_R 
) const
inlinevirtual

Update the properties for this species, given a temperature polynomial.

This method is called with a pointer to an array containing the functions of temperature needed by this parameterization, and three pointers to arrays where the computed property values should be written. This method updates only one value in each array.

Temperature Polynomial: tt[0] = t; tt[1] = t*t; tt[2] = m_t[1]*t; tt[3] = m_t[2]*t; tt[4] = 1.0/t; tt[5] = std::log(t);

Parameters
ttvector of temperature polynomials
cp_RVector of Dimensionless heat capacities. (length m_kk).
h_RTVector of Dimensionless enthalpies. (length m_kk).
s_RVector of Dimensionless entropies. (length m_kk).

Reimplemented from SpeciesThermoInterpType.

Definition at line 165 of file NasaPoly2.h.

References NasaPoly2::m_midT, NasaPoly2::mnp_high, NasaPoly2::mnp_low, and NasaPoly1::updateProperties().

void updatePropertiesTemp ( const doublereal  temp,
doublereal *  cp_R,
doublereal *  h_RT,
doublereal *  s_R 
) const
inlinevirtual

Compute the reference-state property of one species.

Given temperature T in K, this method updates the values of the non-dimensional heat capacity at constant pressure, enthalpy, and entropy, at the reference pressure, Pref of one of the species. The species index is used to reference into the cp_R, h_RT, and s_R arrays.

Parameters
tempTemperature (Kelvin)
cp_RVector of Dimensionless heat capacities. (length m_kk).
h_RTVector of Dimensionless enthalpies. (length m_kk).
s_RVector of Dimensionless entropies. (length m_kk).

Implements SpeciesThermoInterpType.

Definition at line 174 of file NasaPoly2.h.

References NasaPoly2::m_midT, NasaPoly2::mnp_high, NasaPoly2::mnp_low, and NasaPoly1::updatePropertiesTemp().

void reportParameters ( size_t &  index,
int &  type,
doublereal &  minTemp,
doublereal &  maxTemp,
doublereal &  refPressure,
doublereal *const  coeffs 
) const
inlinevirtual

This utility function reports back the type of parameterization and all of the parameters for the species, index.

All parameters are output variables

Parameters
indexSpecies index
typeInteger type of the standard type
minTempoutput - Minimum temperature
maxTempoutput - Maximum temperature
refPressureoutput - reference pressure (Pa).
coeffsVector of coefficients used to set the parameters for the standard state.

Implements SpeciesThermoInterpType.

Definition at line 185 of file NasaPoly2.h.

References NasaPoly2::m_coeff, SpeciesThermoInterpType::m_highT, SpeciesThermoInterpType::m_index, SpeciesThermoInterpType::m_lowT, SpeciesThermoInterpType::m_Pref, and NASA2.

doublereal reportHf298 ( doublereal *const  h298 = 0) const
inlinevirtual

Report the 298 K Heat of Formation of the standard state of one species (J kmol-1)

The 298K Heat of Formation is defined as the enthalpy change to create the standard state of the species from its constituent elements in their standard states at 298 K and 1 bar.

Parameters
h298If this is nonnull, the current value of the Heat of Formation at 298K and 1 bar for species m_speciesIndex is returned in h298[m_speciesIndex].
Returns
Returns the current value of the Heat of Formation at 298K and 1 bar for species m_speciesIndex.

Reimplemented from SpeciesThermoInterpType.

Definition at line 199 of file NasaPoly2.h.

References SpeciesThermoInterpType::m_index, NasaPoly2::m_midT, NasaPoly2::mnp_high, NasaPoly2::mnp_low, and NasaPoly1::reportHf298().

Referenced by NasaPoly2::modifyOneHf298().

void modifyOneHf298 ( const size_t  k,
const doublereal  Hf298New 
)
inlinevirtual

Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1)

The 298K heat of formation is defined as the enthalpy change to create the standard state of the species from its constituent elements in their standard states at 298 K and 1 bar.

Parameters
kSpecies k
Hf298NewSpecify the new value of the Heat of Formation at 298K and 1 bar

Reimplemented from SpeciesThermoInterpType.

Definition at line 212 of file NasaPoly2.h.

References SpeciesThermoInterpType::m_index, NasaPoly2::mnp_high, NasaPoly2::mnp_low, NasaPoly1::modifyOneHf298(), NasaPoly2::reportHf298(), and NasaPoly1::reportHf298().

void validate ( const std::string &  name)
virtual

Check for problems with the parameterization, and generate warnings or throw and exception if any are found.

Reimplemented from SpeciesThermoInterpType.

Definition at line 7 of file NasaPoly2.cpp.

References Cantera::fp2str(), NasaPoly2::m_midT, NasaPoly2::mnp_high, NasaPoly2::mnp_low, SpeciesThermoInterpType::speciesIndex(), NasaPoly1::updatePropertiesTemp(), and Cantera::writelog().

Member Data Documentation

doublereal m_midT
protected
NasaPoly1 mnp_low
protected
NasaPoly1 mnp_high
protected
vector_fp m_coeff
protected

array of polynomial coefficients

Definition at line 237 of file NasaPoly2.h.

Referenced by NasaPoly2::operator=(), and NasaPoly2::reportParameters().


The documentation for this class was generated from the following files: