Cantera  2.1.2
Nasa9PolyMultiTempRegion.h
Go to the documentation of this file.
1 /**
2  * @file Nasa9PolyMultiTempRegion.h
3  * Header for a single-species standard state object derived
4  * from \link Cantera::SpeciesThermoInterpType
5  * SpeciesThermoInterpType\endlink based
6  * on the NASA 9 coefficient temperature polynomial form
7  * applied to multiple temperature regions
8  * (see \ref spthermo and class \link Cantera::Nasa9PolyMultiTempRegion Nasa9PolyMultiTempRegion\endlink).
9  *
10  * This parameterization has multiple NASA temperature regions.
11  */
12 
13 #ifndef CT_NASA9POLYMULTITEMPREGION_H
14 #define CT_NASA9POLYMULTITEMPREGION_H
15 // Copyright 2007 Sandia National Laboratories
16 
17 #include "cantera/base/global.h"
19 
20 namespace Cantera
21 {
22 //! The NASA 9 polynomial parameterization for a single species
23 //! encompassing multiple temperature regions.
24 /*!
25  * This parameterization expresses the heat capacity via a
26  * 7 coefficient polynomial.
27  * Note that this is the form used in the
28  * 2002 NASA equilibrium program. A reference to the form is
29  * provided below:
30  *
31  * "NASA Glenn Coefficients for Calculating Thermodynamic
32  * Properties of Individual Species,"
33  * B. J. McBride, M. J. Zehe, S. Gordon
34  * NASA/TP-2002-211556, Sept. 2002
35  *
36  * Nine coefficients \f$(a_0,\dots,a_6)\f$ are used to represent
37  * \f$ C_p^0(T)\f$, \f$ H^0(T)\f$, and \f$ S^0(T) \f$ as
38  * polynomials in \f$ T \f$ :
39  * \f[
40  * \frac{C_p^0(T)}{R} = a_0 T^{-2} + a_1 T^{-1} + a_2 + a_3 T
41  * + a_4 T^2 + a_5 T^3 + a_6 T^4
42  * \f]
43  *
44  * \f[
45  * \frac{H^0(T)}{RT} = - a_0 T^{-2} + a_1 \frac{\ln(T)}{T} + a_2
46  * + a_3 T + a_4 T^2 + a_5 T^3 + a_6 T^4 + \frac{a_7}{T}
47  * \f]
48  *
49  * \f[
50  * \frac{s^0(T)}{R} = - \frac{a_0}{2} T^{-2} - a_1 T^{-1} + a_2 \ln(T)
51  + + a_3 T \frac{a_4}{2} T^2 + \frac{a_5}{3} T^3 + \frac{a_6}{4} T^4 + a_8
52  * \f]
53  *
54  * The standard state is assumed to be an ideal gas at the
55  * standard pressure of 1 bar, for gases.
56  * For condensed species, the standard state is the
57  * pure crystalline or liquid substance at the standard
58  * pressure of 1 atm.
59  *
60  * These NASA representations may have multiple temperature regions
61  * through the use of this %Nasa9PolyMultiTempRegion object, which uses
62  * multiple copies of the Nasa9Poly1 object to handle multiple temperature
63  * regions.
64  *
65  * @ingroup spthermo
66  */
68 {
69 public:
70  //! Empty constructor
72 
73  //! Constructor used in templated instantiations
74  /*!
75  * @param regionPts Vector of pointers to Nasa9Poly1 objects. These
76  * objects all refer to the temperature regions for the
77  * same species. The vector must be in increasing
78  * temperature region format. Together they
79  * represent the reference temperature parameterization
80  * for a single species.
81  *
82  * Note, after the constructor, we will own the underlying
83  * Nasa9Poly1 objects and be responsible for owning them.
84  */
85  Nasa9PolyMultiTempRegion(std::vector<Cantera::Nasa9Poly1*> &regionPts);
86 
87  //! Copy constructor
88  /*!
89  * @param b object to be copied
90  */
92 
93  //! Assignment operator
94  /*!
95  * @param b object to be copied
96  */
98 
99  //! Destructor
100  virtual ~Nasa9PolyMultiTempRegion();
101 
102  virtual SpeciesThermoInterpType*
104 
105  virtual int reportType() const;
106 
107  //! Update the properties for this species, given a temperature polynomial
108  /*!
109  * This method is called with a pointer to an array containing the
110  * functions of temperature needed by this parameterization, and three
111  * pointers to arrays where the computed property values should be
112  * written. This method updates only one value in each array.
113  *
114  * Temperature Polynomial:
115  * tt[0] = t;
116  * tt[1] = t*t;
117  * tt[2] = t*t*t;
118  * tt[3] = t*t*t*t;
119  * tt[4] = 1.0/t;
120  * tt[5] = 1.0/(t*t);
121  * tt[6] = std::log(t);
122  *
123  * @param tt vector of temperature polynomials
124  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
125  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
126  * @param s_R Vector of Dimensionless entropies. (length m_kk).
127  */
128  virtual void updateProperties(const doublereal* tt,
129  doublereal* cp_R, doublereal* h_RT,
130  doublereal* s_R) const;
131 
132  //! Compute the reference-state property of one species
133  /*!
134  * Given temperature T in K, this method updates the values of
135  * the non-dimensional heat capacity at constant pressure,
136  * enthalpy, and entropy, at the reference pressure, Pref
137  * of one of the species. The species index is used
138  * to reference into the cp_R, h_RT, and s_R arrays.
139  *
140  * Temperature Polynomial:
141  * tt[0] = t;
142  * tt[1] = t*t;
143  * tt[2] = t*t*t;
144  * tt[3] = t*t*t*t;
145  * tt[4] = 1.0/t;
146  * tt[5] = 1.0/(t*t);
147  * tt[6] = std::log(t);
148  *
149  * @param temp Temperature (Kelvin)
150  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
151  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
152  * @param s_R Vector of Dimensionless entropies. (length m_kk).
153  */
154  virtual void updatePropertiesTemp(const doublereal temp,
155  doublereal* cp_R, doublereal* h_RT,
156  doublereal* s_R) const;
157 
158  //!This utility function reports back the type of
159  //! parameterization and all of the parameters for the
160  //! species, index.
161  /*!
162  * All parameters are output variables
163  *
164  * @param n Species index
165  * @param type Integer type of the standard type
166  * @param tlow output - Minimum temperature
167  * @param thigh output - Maximum temperature
168  * @param pref output - reference pressure (Pa).
169  * @param coeffs Vector of coefficients used to set the
170  * parameters for the standard state.
171  * There are 1 + 11*nzones coefficients
172  * coeffs[0] is equal to nTempZones.
173  * index = 1
174  * for each zone:
175  * coeffs[index] = minTempZone
176  * coeffs[index+1] = maxTempZone
177  * coeffs[index+2+i] from i =0,9 are the coefficients themselves
178  * @deprecated
179  */
180  virtual void reportParameters(size_t& n, int& type,
181  doublereal& tlow, doublereal& thigh,
182  doublereal& pref,
183  doublereal* const coeffs) const;
184 
185  //! Modify parameters for the standard state
186  /*!
187  * @param coeffs Vector of coefficients used to set the
188  * parameters for the standard state.
189  * @deprecated
190  */
191  virtual void modifyParameters(doublereal* coeffs);
192 
193 protected:
194  //! Number of temperature regions
196 
197  //! Lower boundaries of each temperature regions
199 
200  //! pointers to the objects
201  /*!
202  * This object will now own these pointers and delete
203  * them when the current object is deleted.
204  */
205  std::vector<Nasa9Poly1*>m_regionPts;
206 
207  //! current region
208  mutable int m_currRegion;
209 };
210 
211 }
212 #endif
size_t m_numTempRegions
Number of temperature regions.
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
Header for a single-species standard state object derived from SpeciesThermoInterpType based on the N...
vector_fp m_lowerTempBounds
Lower boundaries of each temperature regions.
virtual int reportType() const
Returns an integer representing the type of parameterization.
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, HTML_logs (see Input File Handling, Diagnostic Output, Writing messages to the screen and Writing HTML Logfiles).
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 SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
duplicator
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:165
Nasa9PolyMultiTempRegion & operator=(const Nasa9PolyMultiTempRegion &b)
Assignment operator.
The NASA 9 polynomial parameterization for a single species encompassing multiple temperature regions...
virtual void modifyParameters(doublereal *coeffs)
Modify parameters for the standard state.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
std::vector< Nasa9Poly1 * > m_regionPts
pointers to the objects
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...