Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
12 #include "SpeciesThermoMgr.h"
14 
15 namespace Cantera
16 {
17 
18 //! A species thermodynamic property manager for a phase.
19 /*!
20  * This is a general manager that can handle a wide variety
21  * of species thermodynamic polynomials for individual species.
22  * It is slow, however, because it recomputes the functions of
23  * temperature needed for each species. What it does is to create
24  * a vector of SpeciesThermoInterpType objects.
25  *
26  * @ingroup mgrsrefcalc
27  */
29 {
30 public:
31  //! Constructor
33 
34  //! Copy constructor
35  /*!
36  * @param b Object to be copied
37  */
39 
40  //! Assignment operator
41  /*!
42  * @param b Object to be copied
43  */
45 
46  virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const ;
47 
48  //! Install a new species thermodynamic property
49  //! parameterization for one species.
50  /*!
51  * Install a SpeciesThermoInterpType object for the species, index.
52  * This routine contains an internal list of SpeciesThermoInterpType
53  * objects that it knows about. A factory-type lookup is done
54  * to create the object.
55  *
56  * @param name Name of the species
57  * @param index The 'update' method will update the property
58  * values for this species
59  * at position i index in the property arrays.
60  * @param type int flag specifying the type of parameterization to be
61  * installed.
62  * @param c vector of coefficients for the parameterization.
63  * This vector is simply passed through to the
64  * parameterization constructor. Its length depends upon
65  * the parameterization.
66  * @param minTemp minimum temperature for which this parameterization
67  * is valid.
68  * @param maxTemp maximum temperature for which this parameterization
69  * is valid.
70  * @param refPressure standard-state pressure for this parameterization.
71  * @see speciesThermoTypes.h
72  *
73  * @deprecated Use newSpeciesThermoInterpType and
74  * GeneralSpeciesThermo::install_STIT. To be removed after Cantera 2.2.
75  */
76  virtual void install(const std::string& name, size_t index, int type,
77  const doublereal* c,
78  doublereal minTemp, doublereal maxTemp,
79  doublereal refPressure);
80 
81  virtual void install_STIT(size_t index,
82  shared_ptr<SpeciesThermoInterpType> stit_ptr);
83 
84  //! Install a PDSS object to handle the reference state thermodynamics
85  //! calculation
86  /*!
87  * @param k species index
88  * @param PDSS_ptr Pressure dependent standard state (PDSS) object
89  * that will handle the reference state calc
90  * @param vpssmgr_ptr Pointer to the variable pressure standard state
91  * manager that handles the PDSS object.
92  */
93  void installPDSShandler(size_t k, PDSS* PDSS_ptr, VPSSMgr* vpssmgr_ptr);
94 
95  //! Like update(), but only updates the single species k.
96  /*!
97  * @param k species index
98  * @param T Temperature (Kelvin)
99  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
100  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
101  * @param s_R Vector of Dimensionless entropies. (length m_kk).
102  */
103  virtual void update_one(size_t k, doublereal T, doublereal* cp_R,
104  doublereal* h_RT,
105  doublereal* s_R) const;
106 
107  virtual void update(doublereal T, doublereal* cp_R,
108  doublereal* h_RT, doublereal* s_R) const;
109 
110  virtual doublereal minTemp(size_t k=npos) const;
111  virtual doublereal maxTemp(size_t k=npos) const;
112  virtual doublereal refPressure(size_t k=npos) const;
113  virtual int reportType(size_t index) const;
114 
115  virtual void reportParams(size_t index, int& type,
116  doublereal* const c,
117  doublereal& minTemp,
118  doublereal& maxTemp,
119  doublereal& refPressure) const;
120 
121  virtual doublereal reportOneHf298(const size_t k) const;
122 
123  virtual void modifyOneHf298(const size_t k, const doublereal Hf298New);
124 
125 private:
126  //! Provide the SpeciesthermoInterpType object
127  /*!
128  * @param k species index
129  *
130  * @return pointer to the SpeciesThermoInterpType object.
131  */
133  const SpeciesThermoInterpType* provideSTIT(size_t k) const;
134 
135 protected:
136  typedef std::pair<size_t, shared_ptr<SpeciesThermoInterpType> > index_STIT;
137  typedef std::map<int, std::vector<index_STIT> > STIT_map;
138  typedef std::map<int, std::vector<double> > tpoly_map;
139  /**
140  * This is the main data structure, which contains the
141  * SpeciesThermoInterpType objects, sorted by the parameterization type.
142  * `m_sp[i]` is the vector of [species index, STIT] pairs which use
143  * parameterization `i`.
144  */
145  STIT_map m_sp;
146 
147  //! Temperature polynomials for each thermo parameterization
148  mutable tpoly_map m_tpoly;
149 
150  std::map<size_t, std::pair<int, size_t> > m_speciesLoc;
151 
152  //! Maximum value of the lowest temperature
153  doublereal m_tlow_max;
154 
155  //! Minimum value of the highest temperature
156  doublereal m_thigh_min;
157 
158  //! reference pressure (Pa)
159  doublereal m_p0;
160 
161  //! Make the class VPSSMgr a friend because we need to access
162  //! the function provideSTIT()
163  friend class VPSSMgr;
164 };
165 
166 }
167 
168 #endif
SpeciesThermoInterpType * provideSTIT(size_t k)
Provide the SpeciesthermoInterpType object.
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
virtual doublereal reportOneHf298(const size_t k) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) ...
STIT_map m_sp
This is the main data structure, which contains the SpeciesThermoInterpType objects, sorted by the parameterization type.
Virtual base class for the classes that manage the calculation of standard state properties for all t...
Definition: VPSSMgr.h:235
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:165
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.
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
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.
virtual void install_STIT(size_t index, shared_ptr< SpeciesThermoInterpType > stit_ptr)
Install a new species thermodynamic property parameterization for one species.
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:193
virtual doublereal refPressure(size_t k=npos) const
The reference-state pressure for species k.
tpoly_map m_tpoly
Temperature polynomials for each thermo parameterization.
doublereal m_thigh_min
Minimum value of the highest temperature.
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
This utility function reports back the type of parameterization and all of the parameters for the spe...
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of the standard state of one species in the phase (J ...
void installPDSShandler(size_t k, PDSS *PDSS_ptr, VPSSMgr *vpssmgr_ptr)
Install a PDSS object to handle the reference state thermodynamics calculation.