Cantera  2.1.2
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 // Copyright 2001 California Institute of Technology
8 
9 
10 #ifndef CT_CONSTCPPOLY_H
11 #define CT_CONSTCPPOLY_H
12 
14 
15 namespace Cantera
16 {
17 
18 /**
19  * A constant-heat capacity species thermodynamic property manager class.
20  * This makes the
21  * assumption that the heat capacity is a constant. Then, the following
22  * relations are used to complete the specification of the thermodynamic
23  * 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  * The multispecies SimpleThermo class makes the same assumptions as
42  * this class does.
43  *
44  * @see SimpleThermo
45  * @ingroup spthermo
46  */
48 {
49 public:
50  //! empty constructor
51  ConstCpPoly();
52 
53  //! Constructor used in templated instantiations
54  /*!
55  * @param n Species index
56  * @param tlow Minimum temperature
57  * @param thigh Maximum temperature
58  * @param pref reference pressure (Pa).
59  * @param coeffs Vector of coefficients used to set the
60  * parameters for the standard state for species n.
61  * There are 4 coefficients for the %ConstCpPoly parameterization.
62  * - c[0] = \f$ T_0 \f$(Kelvin)
63  * - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol)
64  * - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
65  * - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
66  */
67  ConstCpPoly(size_t n, doublereal tlow, doublereal thigh,
68  doublereal pref,
69  const doublereal* coeffs);
70 
71  //! copy constructor
72  ConstCpPoly(const ConstCpPoly&);
73 
74  //! Assignment operator
76 
79 
80  virtual int reportType() const {
81  return CONSTANT_CP;
82  }
83 
84  //! Update the properties for this species, given a temperature polynomial
85  /*!
86  * This method is called with a pointer to an array containing the functions of
87  * temperature needed by this parameterization, and three pointers to arrays where the
88  * computed property values should be written. This method updates only one value in
89  * each array.
90  *
91  * Form and Length of the temperature polynomial:
92  * - m_t[0] = tt;
93  *
94  * @param tt Vector of temperature polynomials
95  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
96  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
97  * @param s_R Vector of Dimensionless entropies. (length m_kk).
98  */
99  void updateProperties(const doublereal* tt,
100  doublereal* cp_R, doublereal* h_RT,
101  doublereal* s_R) const;
102 
103  void updatePropertiesTemp(const doublereal temp,
104  doublereal* cp_R, doublereal* h_RT,
105  doublereal* s_R) const;
106  void reportParameters(size_t& n, int& type,
107  doublereal& tlow, doublereal& thigh,
108  doublereal& pref,
109  doublereal* const coeffs) const;
110  //! Modify parameters for the standard state
111  /*!
112  * @param coeffs Vector of coefficients used to set the
113  * parameters for the standard state.
114  */
115  virtual void modifyParameters(doublereal* coeffs);
116 
117 #ifdef H298MODIFY_CAPABILITY
118  virtual doublereal reportHf298(doublereal* const h298 = 0) const;
119  virtual void modifyOneHf298(const size_t& k, const doublereal Hf298New);
120 #endif
121 
122 protected:
123  //! Base temperature
124  doublereal m_t0;
125  //! Dimensionless value of the heat capacity
126  doublereal m_cp0_R;
127  //! dimensionless value of the enthaply at t0
128  doublereal m_h0_R;
129  //! Dimensionless value of the entropy at t0
130  doublereal m_s0_R;
131  //! log of the t0 value
132  doublereal m_logt0;
133 };
134 
135 }
136 
137 #endif
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
#define CONSTANT_CP
Constant Cp.
virtual SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
duplicator
Definition: ConstCpPoly.cpp:58
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:88
virtual void modifyParameters(doublereal *coeffs)
Modify parameters for the standard state.
ConstCpPoly & operator=(const ConstCpPoly &)
Assignment operator.
Definition: ConstCpPoly.cpp:44
doublereal m_s0_R
Dimensionless value of the entropy at t0.
Definition: ConstCpPoly.h:130
A constant-heat capacity species thermodynamic property manager class.
Definition: ConstCpPoly.h:47
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
virtual int reportType() const
Returns an integer representing the type of parameterization.
Definition: ConstCpPoly.h:80
doublereal m_h0_R
dimensionless value of the enthaply at t0
Definition: ConstCpPoly.h:128
doublereal m_t0
Base temperature.
Definition: ConstCpPoly.h:124
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:76
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:63
ConstCpPoly()
empty constructor
Definition: ConstCpPoly.cpp:13
doublereal m_logt0
log of the t0 value
Definition: ConstCpPoly.h:132
doublereal m_cp0_R
Dimensionless value of the heat capacity.
Definition: ConstCpPoly.h:126