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