Cantera  2.5.1
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 https://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  Nasa9Poly1();
65 
66  //! Constructor with all input data
67  /*!
68  * @param tlow Minimum temperature
69  * @param thigh Maximum temperature
70  * @param pref reference pressure (Pa).
71  * @param coeffs Vector of coefficients used to set the
72  * parameters for the standard state.
73  */
74  Nasa9Poly1(double tlow, double thigh, double pref, const double* coeffs);
75 
76  //! Set the array of 9 polynomial coefficients
77  void setParameters(const vector_fp& coeffs);
78 
79  virtual int reportType() const;
80 
81  virtual size_t temperaturePolySize() const { return 7; }
82  virtual void updateTemperaturePoly(double T, double* T_poly) const;
83 
84  /*!
85  * @copydoc SpeciesThermoInterpType::updateProperties
86  *
87  * Temperature Polynomial:
88  * - tt[0] = t;
89  * - tt[1] = t*t;
90  * - tt[2] = t*t*t;
91  * - tt[3] = t*t*t*t;
92  * - tt[4] = 1.0/t;
93  * - tt[5] = 1.0/(t*t);
94  * - tt[6] = std::log(t);
95  */
96  virtual void updateProperties(const doublereal* tt,
97  doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const;
98 
99  virtual void updatePropertiesTemp(const doublereal temp,
100  doublereal* cp_R, doublereal* h_RT,
101  doublereal* s_R) const;
102 
103  //! This utility function reports back the type of parameterization and all
104  //! of the parameters for the species
105  /*!
106  * All parameters are output variables
107  *
108  * @param n Species index
109  * @param type Integer type of the standard type
110  * @param tlow output - Minimum temperature
111  * @param thigh output - Maximum temperature
112  * @param pref output - reference pressure (Pa).
113  * @param coeffs Vector of coefficients used to set the parameters for
114  * the standard state. There are 12 of them, designed to be compatible
115  * with the multiple temperature formulation.
116  * - coeffs[0] is equal to one.
117  * - coeffs[1] is min temperature
118  * - coeffs[2] is max temperature
119  * - coeffs[3+i] from i =0,9 are the coefficients themselves
120  */
121  virtual void reportParameters(size_t& n, int& type,
122  doublereal& tlow, doublereal& thigh,
123  doublereal& pref,
124  doublereal* const coeffs) const;
125 
126 protected:
127  //! array of polynomial coefficients
129 };
130 
131 }
132 #endif
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
The NASA 9 polynomial parameterization for one temperature range.
Definition: Nasa9Poly1.h:62
virtual int reportType() const
Returns an integer representing the type of parameterization.
Definition: Nasa9Poly1.cpp:41
vector_fp m_coeff
array of polynomial coefficients
Definition: Nasa9Poly1.h:128
void setParameters(const vector_fp &coeffs)
Set the array of 9 polynomial coefficients.
Definition: Nasa9Poly1.cpp:32
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:82
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:91
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:46
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:57
virtual size_t temperaturePolySize() const
Number of terms in the temperature polynomial for this parameterization.
Definition: Nasa9Poly1.h:81
Abstract Base class for the thermodynamic manager for an individual species' reference state.
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:180
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:264