Cantera  2.0
VPSSMgr_Water_ConstVol.h
Go to the documentation of this file.
1 /**
2  * @file VPSSMgr_Water_ConstVol.h
3  * Declaration file for a derived class that handles the calculation
4  * of standard state thermo properties for real water and
5  * a set of species which have a constant molar volume pressure
6  * dependence
7  * (see \ref mgrpdssthermocalc and
8  * class \link Cantera::VPSSMgr_ConstVol VPSSMgr_ConstVol\endlink).
9  */
10 /*
11  * Copyright (2005) Sandia Corporation. Under the terms of
12  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
13  * U.S. Government retains certain rights in this software.
14  */
15 
16 #ifndef CT_VPSSMGR_WATER_CONSTVOL_H
17 #define CT_VPSSMGR_WATER_CONSTVOL_H
18 
19 #include "VPSSMgr.h"
20 
21 namespace Cantera
22 {
23 
24 class SpeciesThermoInterpType;
25 class VPStandardStateTP;
26 class SpeciesThermo;
27 class PDSS;
28 class PDSS_Water;
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  */
43 {
44 
45 public:
46 
47  //! Base Constructor
48  /*!
49  * Initialize the object.
50  *
51  * @param vp_ptr Pointer to the VPStandardStateTP standard state
52  * @param sp_ptr Pointer to the SpeciesThermo standard state
53  */
55 
56  //! Destructor
57  virtual ~VPSSMgr_Water_ConstVol();
58 
59  //! Copy Constructor for the %SpeciesThermo object.
60  /*!
61  * @param right Reference to %SpeciesThermo object to be copied into the
62  * current one.
63  */
65 
66  //! Assignment operator for the %SpeciesThermo object
67  /*!
68  * This is NOT a virtual function.
69  *
70  * @param right Reference to %SpeciesThermo object to be copied into the
71  * current one.
72  */
74 
75  //! Duplication routine for objects which inherit from
76  //! %VPSSSpeciesThermo
77  /*!
78  * This virtual routine can be used to duplicate %VPSSSpeciesThermo objects
79  * inherited from %VPSSSpeciesThermo even if the application only has
80  * a pointer to %VPSSSpeciesThermo to work with.
81  */
82  virtual VPSSMgr* duplMyselfAsVPSSMgr() const;
83 
84  /*!
85  * @name Properties of the Standard State of the Species in the Solution
86  *
87  * Within VPStandardStateTP, these properties are calculated via a common routine,
88  * _updateStandardStateThermo(),
89  * which must be overloaded in inherited objects.
90  * The values are cached within this object, and are not recalculated unless
91  * the temperature or pressure changes.
92  */
93 
94  //@{
95 
96 private:
97 
98  //! Updates the standard state thermodynamic functions at the current T and P of the solution.
99  /*!
100  * @internal
101  *
102  * If m_useTmpStandardStateStorage is true,
103  * this function must be called for every call to functions in this
104  * class. It checks to see whether the temperature or pressure has changed and
105  * thus the ss thermodynamics functions for all of the species
106  * must be recalculated.
107  *
108  * This function is responsible for updating the following internal members,
109  *
110  * - m_hss_RT;
111  * - m_cpss_R;
112  * - m_gss_RT;
113  * - m_sss_R;
114  * - m_Vss
115  *
116  * If m_useTmpStandardStateStorage is not true, this function may be
117  * required to be called by child classes to update internal member data.
118  *
119  * Note, this will throw an error. It must be reimplemented in derived classes.
120  *
121  */
122  virtual void _updateStandardStateThermo();
123 
124  //! Updates the reference state thermodynamic functions at the
125  //! current T of the solution and the reference pressure
126  /*!
127  * Underscore updates never check for the state of the system.
128  * They just do the calculation.
129  *
130  * This function is responsible for updating the following internal members
131  *
132  * - m_h0_RT;
133  * - m_cp0_R;
134  * - m_g0_RT;
135  * - m_s0_R;
136  * - m_V0
137  *
138  * This routine also updates all of the thermo to the current temperature
139  */
140  virtual void _updateRefStateThermo() const;
141 
142  //@}
143 
144 public:
145  /// @name Thermodynamic Values for the Species Reference States (VPStandardStateTP)
146  /*!
147  * There are also temporary
148  * variables for holding the species reference-state values of Cp, H, S, and V at the
149  * last temperature and reference pressure called. These functions are not recalculated
150  * if a new call is made using the previous temperature.
151  * All calculations are done within the routine _updateRefStateThermo().
152  */
153 
154  //@{
155 
156  /*!
157  * Returns the vector of nondimensional
158  * enthalpies of the reference state at the current temperature
159  * of the solution and the reference pressure for the species.
160  *
161  * @param hrt Output vector contains the nondimensional enthalpies
162  * of the reference state of the species
163  * length = m_kk, units = dimensionless.
164  */
165  virtual void getEnthalpy_RT_ref(doublereal* hrt) const;
166 
167  /*!
168  * Returns the vector of nondimensional
169  * Gibbs free energies of the reference state at the current temperature
170  * of the solution and the reference pressure for the species.
171  *
172  * @param grt Output vector contains the nondimensional Gibbs free energies
173  * of the reference state of the species
174  * length = m_kk, units = dimensionless.
175  */
176  virtual void getGibbs_RT_ref(doublereal* grt) const ;
177 
178  /*!
179  * Returns the vector of the
180  * gibbs function of the reference state at the current temperature
181  * of the solution and the reference pressure for the species.
182  * units = J/kmol
183  *
184  * @param g Output vector contain the Gibbs free energies
185  * of the reference state of the species
186  * length = m_kk, units = J/kmol.
187  */
188  virtual void getGibbs_ref(doublereal* g) const ;
189 
190 
191  /*!
192  * Returns the vector of nondimensional
193  * entropies of the reference state at the current temperature
194  * of the solution and the reference pressure for the species.
195  *
196  * @param er Output vector contain the nondimensional entropies
197  * of the species in their reference states
198  * length: m_kk, units: dimensionless.
199  */
200  virtual void getEntropy_R_ref(doublereal* er) const ;
201 
202  /*!
203  * Returns the vector of nondimensional
204  * constant pressure heat capacities of the reference state
205  * at the current temperature of the solution
206  * and reference pressure for the species.
207  *
208  * @param cpr Output vector contains the nondimensional heat capacities
209  * of the species in their reference states
210  * length: m_kk, units: dimensionless.
211  */
212  virtual void getCp_R_ref(doublereal* cpr) const ;
213 
214  //! Get the molar volumes of the species reference states at the current
215  //! <I>T</I> and <I>P_ref</I> of the solution.
216  /*!
217  * units = m^3 / kmol
218  *
219  * @param vol Output vector containing the standard state volumes.
220  * Length: m_kk.
221  */
222  virtual void getStandardVolumes_ref(doublereal* vol) const ;
223 
224 
225  //! @name Initialization Methods - For Internal use (VPStandardState)
226  /*!
227  * The following methods are used in the process of constructing
228  * the phase and setting its parameters from a specification in an
229  * input file. They are not normally used in application programs.
230  * To see how they are used, see files importCTML.cpp and
231  * ThermoFactory.cpp.
232  */
233 
234  //@{
235 
236  //! @internal Initialize the object
237  /*!
238  * This method is provided to allow
239  * subclasses to perform any initialization required after all
240  * species have been added. For example, it might be used to
241  * resize internal work arrays that must have an entry for
242  * each species. The base class implementation does nothing,
243  * and subclasses that do not require initialization do not
244  * need to overload this method. When importing a CTML phase
245  * description, this method is called just prior to returning
246  * from function importPhase().
247  *
248  * @see importCTML.cpp
249  */
250 
251  //! Initialize the thermo, after all species have been entered.
252  virtual void initThermo();
253 
254  //! Finalize the thermo after all species have been entered
255  /*!
256  * This function is the LAST initialization routine to be
257  * called. It's called after createInstallPDSS() has been
258  * called for each species in the phase, and after initThermo()
259  * has been called.
260  * It's called via an inner-to-outer onion shell like manner.
261  *
262  *
263  * @param phaseNode Reference to the phaseNode XML node.
264  * @param id ID of the phase.
265  */
266  virtual void initThermoXML(XML_Node& phaseNode, std::string id);
267 
268  //! Install specific content for species k in the standard-state
269  //! thermodynamic calculator and also create/return a PDSS object
270  //! for that species.
271  /*!
272  * This occurs before matrices are sized appropriately.
273  *
274  * @param k Species index in the phase
275  * @param speciesNode XML Node corresponding to the species
276  * @param phaseNode_ptr Pointer to the XML Node corresponding
277  * to the phase which owns the species
278  */
279  virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode,
280  const XML_Node* const phaseNode_ptr);
281 
282  //! This utility function reports the type of parameterization
283  //! used for the species with index number index.
284  /*!
285  *
286  * @param index Species index
287  */
288  virtual PDSS_enumType reportPDSSType(int index = -1) const ;
289 
290 
291  //! This utility function reports the type of manager
292  //! for the calculation of ss properties
293  /*!
294  * @return Returns an enumerated type that is unique.
295  */
296  virtual VPSSMgr_enumType reportVPSSMgrType() const ;
297 
298  //! Initialize all internal pointers
299  /*!
300  * This is a virtual function that fills or updates the values of the
301  * shallow pointers.
302  *
303  * @param vp_ptr Pointer to the Variable Pressure standard state object
304  * @param sp_ptr Pointer to the reference state thermo calculator object
305  */
306  virtual void initAllPtrs(VPStandardStateTP* vp_ptr, SpeciesThermo* sp_ptr);
307 
308 private:
309 
310  //! Pointer to the Water PDSS object.
311  /*!
312  * This is a shallow copy. The water PDSS object is owned by the VPStandardStateTP
313  * object.
314  */
316 
317 };
318 //@}
319 }
320 
321 #endif
322