Cantera  2.4.0
ConstCpPoly.h
Go to the documentation of this file.
1 /**
2  * @file ConstCpPoly.h
3  * Headers for the \link Cantera::SpeciesThermoInterpType SpeciesThermoInterpType\endlink
4  * object that employs a constant heat capacity assumption (see \ref spthermo and
5  * \link Cantera::ConstCpPoly ConstCpPoly\endlink).
6  */
7 
8 // This file is part of Cantera. See License.txt in the top-level directory or
9 // at http://www.cantera.org/license.txt for license and copyright information.
10 
11 #ifndef CT_CONSTCPPOLY_H
12 #define CT_CONSTCPPOLY_H
13 
15 
16 namespace Cantera
17 {
18 
19 /**
20  * A constant-heat capacity species thermodynamic property manager class. This
21  * makes the assumption that the heat capacity is a constant. Then, the
22  * following relations are used to complete the specification of the
23  * thermodynamic functions for the species.
24  *
25  * \f[
26  * \frac{c_p(T)}{R} = Cp0\_R
27  * \f]
28  * \f[
29  * \frac{h^0(T)}{RT} = \frac{1}{T} * (h0\_R + (T - T_0) * Cp0\_R)
30  * \f]
31  * \f[
32  * \frac{s^0(T)}{R} = (s0\_R + (log(T) - log(T_0)) * Cp0\_R)
33  * \f]
34  *
35  * This parameterization takes 4 input values. These are:
36  * - c[0] = \f$ T_0 \f$(Kelvin)
37  * - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol)
38  * - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
39  * - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
40  *
41  * @ingroup spthermo
42  */
44 {
45 public:
46  //! Normal constructor
47  /*!
48  * @param tlow Minimum temperature
49  * @param thigh Maximum temperature
50  * @param pref reference pressure (Pa).
51  * @param coeffs Vector of coefficients used to set the parameters for
52  * the standard state for species n. There are 4
53  * coefficients for the ConstCpPoly parameterization.
54  * - c[0] = \f$ T_0 \f$(Kelvin)
55  * - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol)
56  * - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
57  * - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
58  */
59  ConstCpPoly(double tlow, double thigh, double pref, const double* coeffs);
60 
61  virtual int reportType() const {
62  return CONSTANT_CP;
63  }
64 
65  /*!
66  * @copydoc SpeciesThermoInterpType::updateProperties
67  *
68  * Form and Length of the temperature polynomial:
69  * - m_t[0] = tt;
70  *
71  */
72  void updateProperties(const doublereal* tt,
73  doublereal* cp_R, doublereal* h_RT,
74  doublereal* s_R) const;
75 
76  void updatePropertiesTemp(const doublereal temp,
77  doublereal* cp_R, doublereal* h_RT,
78  doublereal* s_R) const;
79  void reportParameters(size_t& n, int& type,
80  doublereal& tlow, doublereal& thigh,
81  doublereal& pref,
82  doublereal* const coeffs) const;
83 
84  virtual doublereal reportHf298(doublereal* const h298 = 0) const;
85  virtual void modifyOneHf298(const size_t k, const doublereal Hf298New);
86  virtual void resetHf298();
87 
88 protected:
89  //! Base temperature
90  doublereal m_t0;
91  //! Dimensionless value of the heat capacity
92  doublereal m_cp0_R;
93  //! dimensionless value of the enthaply at t0
94  doublereal m_h0_R;
95  //! Dimensionless value of the entropy at t0
96  doublereal m_s0_R;
97  //! log of the t0 value
98  doublereal m_logt0;
99  //! Original value of h0_R, restored by calling resetHf298()
100  double m_h0_R_orig;
101 };
102 
103 }
104 
105 #endif
void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
Definition: ConstCpPoly.cpp:41
ConstCpPoly(double tlow, double thigh, double pref, const double *coeffs)
Normal constructor.
Definition: ConstCpPoly.cpp:16
Abstract Base class for the thermodynamic manager for an individual species' reference state...
#define CONSTANT_CP
Constant Cp.
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) ...
Definition: ConstCpPoly.cpp:79
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: ConstCpPoly.cpp:53
doublereal m_s0_R
Dimensionless value of the entropy at t0.
Definition: ConstCpPoly.h:96
A constant-heat capacity species thermodynamic property manager class.
Definition: ConstCpPoly.h:43
virtual int reportType() const
Returns an integer representing the type of parameterization.
Definition: ConstCpPoly.h:61
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
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: ConstCpPoly.cpp:28
double m_h0_R_orig
Original value of h0_R, restored by calling resetHf298()
Definition: ConstCpPoly.h:100
doublereal m_h0_R
dimensionless value of the enthaply at t0
Definition: ConstCpPoly.h:94
doublereal m_t0
Base temperature.
Definition: ConstCpPoly.h:90
virtual doublereal reportHf298(doublereal *const h298=0) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) ...
Definition: ConstCpPoly.cpp:69
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
virtual void resetHf298()
Restore the original heat of formation for this species.
Definition: ConstCpPoly.cpp:86
doublereal m_logt0
log of the t0 value
Definition: ConstCpPoly.h:98
doublereal m_cp0_R
Dimensionless value of the heat capacity.
Definition: ConstCpPoly.h:92