Cantera  2.4.0
Nasa9Poly1.h
Go to the documentation of this file.
1 /**
2  * @file Nasa9Poly1.h Header for a single-species standard state object derived
3  * from \link Cantera::SpeciesThermoInterpType
4  * SpeciesThermoInterpType\endlink based on the NASA 9 coefficient
5  * temperature polynomial form applied to one temperature region (see \ref
6  * spthermo and class \link Cantera::Nasa9Poly1 Nasa9Poly1\endlink).
7  *
8  * This parameterization has one NASA temperature region.
9  */
10 
11 // This file is part of Cantera. See License.txt in the top-level directory or
12 // at http://www.cantera.org/license.txt for license and copyright information.
13 
14 #ifndef CT_NASA9POLY1_H
15 #define CT_NASA9POLY1_H
16 
18 
19 namespace Cantera
20 {
21 //! The NASA 9 polynomial parameterization for one temperature range.
22 /*!
23  * This parameterization expresses the heat capacity via a 7 coefficient
24  * polynomial. Note that this is the form used in the 2002 NASA equilibrium
25  * program. A reference to the form is provided below:
26  *
27  * "NASA Glenn Coefficients for Calculating Thermodynamic Properties of
28  * Individual Species," B. J. McBride, M. J. Zehe, S. Gordon
29  * NASA/TP-2002-211556, Sept. 2002
30  *
31  * Nine coefficients \f$(a_0,\dots,a_8)\f$ are used to represent
32  * \f$ C_p^0(T)\f$, \f$ H^0(T)\f$, and \f$ S^0(T) \f$ as
33  * polynomials in \f$ T \f$ :
34  * \f[
35  * \frac{C_p^0(T)}{R} = a_0 T^{-2} + a_1 T^{-1} + a_2 + a_3 T
36  * + a_4 T^2 + a_5 T^3 + a_6 T^4
37  * \f]
38  *
39  * \f[
40  * \frac{H^0(T)}{RT} = - a_0 T^{-2} + a_1 \frac{\ln T}{T} + a_2
41  * + \frac{a_3}{2} T + \frac{a_4}{3} T^2 + \frac{a_5}{4} T^3 +
42  * \frac{a_6}{5} T^4 + \frac{a_7}{T}
43  * \f]
44  *
45  * \f[
46  * \frac{s^0(T)}{R} = - \frac{a_0}{2} T^{-2} - a_1 T^{-1} + a_2 \ln T
47  * + a_3 T + \frac{a_4}{2} T^2 + \frac{a_5}{3} T^3 + \frac{a_6}{4} T^4 + a_8
48  * \f]
49  *
50  * The standard state is assumed to be an ideal gas at the standard pressure of
51  * 1 bar, for gases. For condensed species, the standard state is the pure
52  * crystalline or liquid substance at the standard pressure of 1 atm.
53  *
54  * These NASA representations may have multiple temperature regions through the
55  * use of the Nasa9PolyMultiTempRegion object, which uses multiple copies of
56  * this Nasa9Poly1 object to handle multiple temperature regions.
57  *
58  * @ingroup spthermo
59  * @see Nasa9PolyMultiTempRegion
60  */
62 {
63 public:
64  //! Normal constructor
65  /*!
66  * @param tlow Minimum temperature
67  * @param thigh Maximum temperature
68  * @param pref reference pressure (Pa).
69  * @param coeffs Vector of coefficients used to set the
70  * parameters for the standard state.
71  */
72  Nasa9Poly1(double tlow, double thigh, double pref, const double* coeffs);
73 
74  virtual int reportType() const;
75 
76  virtual size_t temperaturePolySize() const { return 7; }
77  virtual void updateTemperaturePoly(double T, double* T_poly) const;
78 
79  /*!
80  * @copydoc SpeciesThermoInterpType::updateProperties
81  *
82  * Temperature Polynomial:
83  * - tt[0] = t;
84  * - tt[1] = t*t;
85  * - tt[2] = t*t*t;
86  * - tt[3] = t*t*t*t;
87  * - tt[4] = 1.0/t;
88  * - tt[5] = 1.0/(t*t);
89  * - tt[6] = std::log(t);
90  */
91  virtual void updateProperties(const doublereal* tt,
92  doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const;
93 
94  virtual void updatePropertiesTemp(const doublereal temp,
95  doublereal* cp_R, doublereal* h_RT,
96  doublereal* s_R) const;
97 
98  //! This utility function reports back the type of parameterization and all
99  //! of the parameters for the species
100  /*!
101  * All parameters are output variables
102  *
103  * @param n Species index
104  * @param type Integer type of the standard type
105  * @param tlow output - Minimum temperature
106  * @param thigh output - Maximum temperature
107  * @param pref output - reference pressure (Pa).
108  * @param coeffs Vector of coefficients used to set the parameters for
109  * the standard state. There are 12 of them, designed to be compatible
110  * with the multiple temperature formulation.
111  * - coeffs[0] is equal to one.
112  * - coeffs[1] is min temperature
113  * - coeffs[2] is max temperature
114  * - coeffs[3+i] from i =0,9 are the coefficients themselves
115  */
116  virtual void reportParameters(size_t& n, int& type,
117  doublereal& tlow, doublereal& thigh,
118  doublereal& pref,
119  doublereal* const coeffs) const;
120 
121 protected:
122  //! array of polynomial coefficients
124 };
125 
126 }
127 #endif
Abstract Base class for the thermodynamic manager for an individual species' reference state...
virtual size_t temperaturePolySize() const
Number of terms in the temperature polynomial for this parameterization.
Definition: Nasa9Poly1.h:76
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.
Definition: Nasa9Poly1.cpp:43
virtual void updateTemperaturePoly(double T, double *T_poly) const
Given the temperature T, compute the terms of the temperature polynomial T_poly.
Definition: Nasa9Poly1.cpp:32
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
Nasa9Poly1(double tlow, double thigh, double pref, const double *coeffs)
Normal constructor.
Definition: Nasa9Poly1.cpp:20
virtual 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 spe...
Definition: Nasa9Poly1.cpp:77
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
Definition: Nasa9Poly1.cpp:68
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157
virtual int reportType() const
Returns an integer representing the type of parameterization.
Definition: Nasa9Poly1.cpp:27
The NASA 9 polynomial parameterization for one temperature range.
Definition: Nasa9Poly1.h:61
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
vector_fp m_coeff
array of polynomial coefficients
Definition: Nasa9Poly1.h:123