Cantera  2.0
VPSSMgr_IdealGas.h
Go to the documentation of this file.
1 /**
2  * @file VPSSMgr_IdealGas.h
3  * Declaration file for a derived class that handles the calculation
4  * of standard state thermo properties for
5  * a set of species which have an Ideal Gas dependence
6  * (see \ref mgrpdssthermocalc and
7  * class \link Cantera::VPSSMgr_IdealGas VPSSMgr_IdealGas\endlink).
8  */
9 /*
10  * Copyright (2005) Sandia Corporation. Under the terms of
11  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
12  * U.S. Government retains certain rights in this software.
13  */
14 
15 #ifndef CT_VPSSMGR_IDEALGAS_H
16 #define CT_VPSSMGR_IDEALGAS_H
17 
18 #include "cantera/base/ct_defs.h"
19 #include "PDSS.h"
20 #include "VPSSMgr.h"
21 
22 namespace Cantera
23 {
24 
25 class SpeciesThermoInterpType;
26 class VPStandardStateTP;
27 class SpeciesThermo;
28 
29 
30 //! Virtual base class for the species thermo manager classes.
31 /*!
32  * This class defines the interface which all subclasses must implement.
33  *
34  * Class %VPSSSpeciesThermo is the base class
35  * for a family of classes that compute properties of a set of
36  * species in their reference state at a range of temperatures.
37  * Note, the pressure dependence of the reference state is not
38  * handled by this particular species standard state model.
39  *
40  * @ingroup mgrpdssthermocalc
41  */
42 class VPSSMgr_IdealGas : public VPSSMgr
43 {
44 
45 public:
46 
47 
48  //! Basic constructor that initializes the object
49  /*!
50  * @param vp_ptr Pointer to the owning ThermoPhase
51  * @param spth Species thermo pointer.
52  */
54 
55  //! Destructor
56  virtual ~VPSSMgr_IdealGas();
57 
58  //! Copy Constructor for the %SpeciesThermo object.
59  /*!
60  * @param right Reference to %SpeciesThermo object to be copied into the
61  * current one.
62  */
63  VPSSMgr_IdealGas(const VPSSMgr_IdealGas& right);
64 
65  //! Assignment operator for the %SpeciesThermo object
66  /*!
67  * This is NOT a virtual function.
68  *
69  * @param right Reference to %SpeciesThermo object to be copied into the
70  * current one.
71  */
73 
74  //! Duplication routine for objects which inherit from
75  //! %VPSSSpeciesThermo
76  /*!
77  * This virtual routine can be used to duplicate %VPSSSpeciesThermo objects
78  * inherited from %VPSSSpeciesThermo even if the application only has
79  * a pointer to %VPSSSpeciesThermo to work with.
80  */
81  virtual VPSSMgr* duplMyselfAsVPSSMgr() const;
82 
83  /*!
84  * @name Properties of the Standard State of the Species in the Solution
85  *
86  * Within VPStandardStateTP, these properties are calculated via a common routine,
87  * _updateStandardStateThermo(),
88  * which must be overloaded in inherited objects.
89  * The values are cached within this object, and are not recalculated unless
90  * the temperature or pressure changes.
91  */
92  //@{
93 
94  /**
95  * Returns the vector of nondimensional
96  * internal Energies of the standard state at the current temperature
97  * and pressure of the solution for each species.
98  * \f[
99  * u^{ss}_k(T,P) = h^{ss}_k(T) - P * V^{ss}_k
100  * \f]
101  *
102  * @param urt Output vector of nondimensional standard state
103  * internal energies. length = m_kk.
104  */
105  virtual void getIntEnergy_RT(doublereal* urt) const;
106 
107  /**
108  * Get the molar volumes of each species in their standard
109  * states at the current
110  * <I>T</I> and <I>P</I> of the solution.
111  * units = m^3 / kmol
112  *
113  * This is redefined here to call the internal function, _updateStandardStateThermo(),
114  * which calculates all standard state properties at the same time.
115  *
116  * @param vol Output vector of species volumes. length = m_kk.
117  * units = m^3 / kmol
118  */
119  virtual void getStandardVolumes(doublereal* vol) const;
120 
121 protected:
122 
123  //! Updates the standard state thermodynamic functions at the current
124  //! T and P of the solution.
125  /*!
126  * @internal
127  *
128  * If m_useTmpStandardStateStorage is true,
129  * this function must be called every time the temperature or pressure
130  * has changed.
131  *
132  * This function is responsible for updating the following internal members,
133  * when m_useTmpStandardStateStorage is true.
134  *
135  * - m_hss_RT;
136  * - m_cpss_R;
137  * - m_gss_RT;
138  * - m_sss_R;
139  * - m_Vss
140  *
141  * If m_useTmpStandardStateStorage is not true, this function may be
142  * required to be called everytime this class is invoked.
143  *
144  */
145  virtual void _updateStandardStateThermo();
146 
147 public:
148 
149  //@}
150  /// @name Thermodynamic Values for the Species Reference States (VPStandardStateTP)
151  /*!
152  * There are also temporary
153  * variables for holding the species reference-state values of Cp, H, S, and V at the
154  * last temperature and reference pressure called. These functions are not recalculated
155  * if a new call is made using the previous temperature.
156  * All calculations are done within the routine _updateRefStateThermo().
157  */
158  //@{
159 
160 
161 
162  //! @name Initialization Methods - For Internal use (VPStandardState)
163  /*!
164  * The following methods are used in the process of constructing
165  * the phase and setting its parameters from a specification in an
166  * input file. They are not normally used in application programs.
167  * To see how they are used, see files importCTML.cpp and
168  * ThermoFactory.cpp.
169  *
170  */
171  //@{
172 
173  //! Initialize the thermo for this standard state thermo calculator
174  /*!
175  * This task is done last, after createInstallPDSS() and after
176  * initThermo().
177  *
178  * @param phaseNode Reference to the phase node in the XML tree
179  * @param id string name of the phase
180  */
181  virtual void initThermoXML(XML_Node& phaseNode, std::string id);
182 
183  //! Create and install an ideal gas standard state manager
184  //! for one species within this object
185  /*!
186  * This function sets up the internal data within this object for
187  * handling the calculation of the standard state for the species.
188  *
189  * - It registers the species with the SpeciesThermo object for the
190  * containing VPStandardStateTP phase.
191  * - It also creates a PDSS object, which basically contains a
192  * duplication of some of this information and returns a pointer to
193  * the new object.
194  * .
195  * @param k Species index within the phase
196  * @param speciesNode Reference to the species node in the XML tree
197  * @param phaseNode_ptr Pointer to the phase node in the XML tree
198  *
199  * @return Returns a pointer to the a newly malloced PDSS object
200  * containing the parameterization
201  */
202  virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode,
203  const XML_Node* const phaseNode_ptr);
204 
205 
206  //! This utility function reports the type of parameterization
207  //! used for the species with index number index.
208  /*!
209  *
210  * @param index Species index
211  */
212  virtual PDSS_enumType reportPDSSType(int index = -1) const ;
213 
214 
215  //! This utility function reports the type of manager
216  //! for the calculation of standard state properties
217  /*!
218  *
219  */
220  virtual VPSSMgr_enumType reportVPSSMgrType() const ;
221 
222 };
223 //@}
224 }
225 
226 #endif
227