Cantera  2.3.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  //! Empty constructor
65  //! @deprecated Default constructor to be removed after Cantera 2.3.
66  Nasa9Poly1();
67 
68  //! Normal constructor
69  /*!
70  * @param tlow Minimum temperature
71  * @param thigh Maximum temperature
72  * @param pref reference pressure (Pa).
73  * @param coeffs Vector of coefficients used to set the
74  * parameters for the standard state.
75  */
76  Nasa9Poly1(double tlow, double thigh, double pref, const double* coeffs);
77 
80 
81  virtual int reportType() const;
82 
83  virtual size_t temperaturePolySize() const { return 7; }
84  virtual void updateTemperaturePoly(double T, double* T_poly) const;
85 
86  /*!
87  * @copydoc SpeciesThermoInterpType::updateProperties
88  *
89  * Temperature Polynomial:
90  * - tt[0] = t;
91  * - tt[1] = t*t;
92  * - tt[2] = t*t*t;
93  * - tt[3] = t*t*t*t;
94  * - tt[4] = 1.0/t;
95  * - tt[5] = 1.0/(t*t);
96  * - tt[6] = std::log(t);
97  */
98  virtual void updateProperties(const doublereal* tt,
99  doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const;
100 
101  virtual void updatePropertiesTemp(const doublereal temp,
102  doublereal* cp_R, doublereal* h_RT,
103  doublereal* s_R) const;
104 
105  //! This utility function reports back the type of parameterization and all
106  //! of the parameters for the species
107  /*!
108  * All parameters are output variables
109  *
110  * @param n Species index
111  * @param type Integer type of the standard type
112  * @param tlow output - Minimum temperature
113  * @param thigh output - Maximum temperature
114  * @param pref output - reference pressure (Pa).
115  * @param coeffs Vector of coefficients used to set the parameters for
116  * the standard state. There are 12 of them, designed to be compatible
117  * with the multiple temperature formulation.
118  * - coeffs[0] is equal to one.
119  * - coeffs[1] is min temperature
120  * - coeffs[2] is max temperature
121  * - coeffs[3+i] from i =0,9 are the coefficients themselves
122  */
123  virtual void reportParameters(size_t& n, int& type,
124  doublereal& tlow, doublereal& thigh,
125  doublereal& pref,
126  doublereal* const coeffs) const;
127 
128  //! @deprecated To be removed after Cantera 2.3. Use
129  //! MultiSpeciesThermo::modifySpecies instead.
130  virtual void modifyParameters(doublereal* coeffs);
131 
132 protected:
133  //! array of polynomial coefficients
135 };
136 
137 }
138 #endif
Nasa9Poly1()
Empty constructor.
Definition: Nasa9Poly1.cpp:19
virtual void modifyParameters(doublereal *coeffs)
Definition: Nasa9Poly1.cpp:107
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:83
virtual SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
Definition: Nasa9Poly1.cpp:34
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:55
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:44
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
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:89
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:80
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:39
The NASA 9 polynomial parameterization for one temperature range.
Definition: Nasa9Poly1.h:61
Namespace for the Cantera kernel.
Definition: application.cpp:29
vector_fp m_coeff
array of polynomial coefficients
Definition: Nasa9Poly1.h:134