Cantera  2.1.2
GeneralSpeciesThermo.h
Go to the documentation of this file.
1 /**
2  * @file GeneralSpeciesThermo.h
3  * Headers for a completely general species thermodynamic property
4  * manager for a phase (see \ref mgrsrefcalc and
5  * \link Cantera::GeneralSpeciesThermo GeneralSpeciesThermo\endlink).
6  *
7  * Because it is general, it is slow.
8  */
9 #ifndef CT_GENERALSPECIESTHERMO_H
10 #define CT_GENERALSPECIESTHERMO_H
11 #include "cantera/base/ct_defs.h"
12 #include "SpeciesThermoMgr.h"
13 #include "NasaPoly1.h"
14 #include "Nasa9Poly1.h"
15 #include "StatMech.h"
16 #include "speciesThermoTypes.h"
17 
18 namespace Cantera
19 {
20 
21 //! A species thermodynamic property manager for a phase.
22 /*!
23  * This is a general manager that can handle a wide variety
24  * of species thermodynamic polynomials for individual species.
25  * It is slow, however, because it recomputes the functions of
26  * temperature needed for each species. What it does is to create
27  * a vector of SpeciesThermoInterpType objects.
28  *
29  * @ingroup mgrsrefcalc
30  */
32 {
33 public:
34  //! Constructor
36 
37  //! Copy constructor
38  /*!
39  * @param b Object to be copied
40  */
42 
43  //! Assignment operator
44  /*!
45  * @param b Object to be copied
46  */
48 
49  //! Destructor
50  virtual ~GeneralSpeciesThermo();
51 
52  virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const ;
53 
54  //! Install a new species thermodynamic property
55  //! parameterization for one species.
56  /*!
57  * Install a SpeciesThermoInterpType object for the species, index.
58  * This routine contains an internal list of SpeciesThermoInterpType
59  * objects that it knows about. A factory-type lookup is done
60  * to create the object.
61  *
62  * @param name Name of the species
63  * @param index The 'update' method will update the property
64  * values for this species
65  * at position i index in the property arrays.
66  * @param type int flag specifying the type of parameterization to be
67  * installed.
68  * @param c vector of coefficients for the parameterization.
69  * This vector is simply passed through to the
70  * parameterization constructor. Its length depends upon
71  * the parameterization.
72  * @param minTemp minimum temperature for which this parameterization
73  * is valid.
74  * @param maxTemp maximum temperature for which this parameterization
75  * is valid.
76  * @param refPressure standard-state pressure for this parameterization.
77  * @see speciesThermoTypes.h
78  *
79  * @todo Create a factory method for SpeciesThermoInterpType.
80  * That's basically what we are doing here.
81  */
82  virtual void install(const std::string& name, size_t index, int type,
83  const doublereal* c,
84  doublereal minTemp, doublereal maxTemp,
85  doublereal refPressure);
86 
87  virtual void install_STIT(SpeciesThermoInterpType* stit_ptr);
88 
89  //! Install a PDSS object to handle the reference state thermodynamics
90  //! calculation
91  /*!
92  * @param k species index
93  * @param PDSS_ptr Pressure dependent standard state (PDSS) object
94  * that will handle the reference state calc
95  * @param vpssmgr_ptr Pointer to the variable pressure standard state
96  * manager that handles the PDSS object.
97  */
98  void installPDSShandler(size_t k, PDSS* PDSS_ptr, VPSSMgr* vpssmgr_ptr);
99 
100  //! Like update(), but only updates the single species k.
101  /*!
102  * @param k species index
103  * @param T Temperature (Kelvin)
104  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
105  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
106  * @param s_R Vector of Dimensionless entropies. (length m_kk).
107  */
108  virtual void update_one(size_t k, doublereal T, doublereal* cp_R,
109  doublereal* h_RT,
110  doublereal* s_R) const;
111 
112  virtual void update(doublereal T, doublereal* cp_R,
113  doublereal* h_RT, doublereal* s_R) const;
114 
115  virtual doublereal minTemp(size_t k=npos) const;
116  virtual doublereal maxTemp(size_t k=npos) const;
117  virtual doublereal refPressure(size_t k=npos) const;
118  virtual int reportType(size_t index) const;
119 
120  //! @deprecated
121  virtual void reportParams(size_t index, int& type,
122  doublereal* const c,
123  doublereal& minTemp,
124  doublereal& maxTemp,
125  doublereal& refPressure) const;
126 
127 #ifdef H298MODIFY_CAPABILITY
128 
129  virtual doublereal reportOneHf298(int k) const;
130 
131  virtual void modifyOneHf298(const int k, const doublereal Hf298New);
132 
133 #endif
134 
135 private:
136  //! Provide the SpeciesthermoInterpType object
137  /*!
138  * @param k species index
139  *
140  * @return pointer to the SpeciesThermoInterpType object.
141  */
143 
144 protected:
145  /**
146  * This is the main unknown in the object. It is
147  * a list of pointers to type SpeciesThermoInterpType.
148  * Note, this object owns the objects, so they are deleted
149  * in the destructor of this object.
150  * Note, that in some instances, m_sp[k] = 0, e.g., no
151  * SpeciesThermoInterpType is installed for one or more
152  * species. These cases must be handled by the calling
153  * routine.
154  */
155  std::vector<SpeciesThermoInterpType*> m_sp;
156 
157  //! Maximum value of the lowest temperature
158  doublereal m_tlow_max;
159 
160  //! Minimum value of the highest temperature
161  doublereal m_thigh_min;
162 
163  //! reference pressure (Pa)
164  doublereal m_p0;
165 
166  /**
167  * Internal variable indicating the length of the
168  * number of species in the phase.
169  */
170  size_t m_kk;
171 
172  //! Make the class VPSSMgr a friend because we need to access
173  //! the function provideSTIT()
174  friend class VPSSMgr;
175 };
176 
177 }
178 
179 #endif
SpeciesThermoInterpType * provideSTIT(size_t k)
Provide the SpeciesthermoInterpType object.
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...
std::vector< SpeciesThermoInterpType * > m_sp
This is the main unknown in the object.
Virtual base class for the classes that manage the calculation of standard state properties for all t...
Definition: VPSSMgr.h:238
virtual void update_one(size_t k, doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Like update(), but only updates the single species k.
const size_t npos
index returned by functions to indicate "no position"
Definition: ct_defs.h:173
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
virtual SpeciesThermo * duplMyselfAsSpeciesThermo() const
Duplication routine for objects derived from SpeciesThermo.
doublereal m_tlow_max
Maximum value of the lowest temperature.
Pure Virtual base class for the species thermo manager classes.
size_t m_kk
Internal variable indicating the length of the number of species in the phase.
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
A species thermodynamic property manager for a phase.
GeneralSpeciesThermo & operator=(const GeneralSpeciesThermo &b)
Assignment operator.
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature.
Header for a single-species standard state object derived from SpeciesThermoInterpType based on the N...
Header for a single-species standard state object derived from.
virtual ~GeneralSpeciesThermo()
Destructor.
This file contains descriptions of templated subclasses of the virtual base class, SpeciesThermo, which includes SpeciesThermoDuo (see Managers for Calculating Reference-State Thermodynamics and class SpeciesThermoDuo)
doublereal m_p0
reference pressure (Pa)
Virtual base class for a species with a pressure dependent standard state.
Definition: PDSS.h:195
virtual doublereal refPressure(size_t k=npos) const
The reference-state pressure for species k.
doublereal m_thigh_min
Minimum value of the highest temperature.
virtual void install_STIT(SpeciesThermoInterpType *stit_ptr)
Install a new species thermodynamic property parameterization for one species.
virtual int reportType(size_t index) const
This utility function reports the type of parameterization used for the species with index number ind...
virtual void update(doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
virtual void install(const std::string &name, size_t index, int type, const doublereal *c, doublereal minTemp, doublereal maxTemp, doublereal refPressure)
Install a new species thermodynamic property parameterization for one species.
virtual void reportParams(size_t index, int &type, doublereal *const c, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure) const
void installPDSShandler(size_t k, PDSS *PDSS_ptr, VPSSMgr *vpssmgr_ptr)
Install a PDSS object to handle the reference state thermodynamics calculation.