Cantera  2.0
VPSSMgr_ConstVol.h
Go to the documentation of this file.
1 /**
2  * @file VPSSMgr_ConstVol.h
3  * Declarations for a derived class for the calculation of multiple-species thermodynamic
4  * property managers for variable temperature and pressure standard
5  * states assuming constant volume (see class
6  * \link Cantera::VPSSMgr_ConstVol VPSSMgr_ConstVol \endlink).
7  */
8 /*
9  * Copyright (2005) Sandia Corporation. Under the terms of
10  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
11  * U.S. Government retains certain rights in this software.
12  */
13 
14 #ifndef CT_VPSSMGR_CONSTVOL_H
15 #define CT_VPSSMGR_CONSTVOL_H
16 
17 #include "cantera/base/ct_defs.h"
18 #include "VPSSMgr.h"
19 
20 namespace Cantera
21 {
22 
23 class SpeciesThermoInterpType;
24 class PDSS;
25 
26 //! Constant Molar Volume e VPSS species thermo manager class
27 /*!
28  * The calculation of multiple-species thermodynamic
29  * property managers for variable temperature and pressure standard
30  * states assuming a constant partial molar volume assumption.
31  *
32  * @ingroup mgrpdssthermocalc
33  */
34 class VPSSMgr_ConstVol : public VPSSMgr
35 {
36 
37 public:
38 
39  //! Constructor
40  /*!
41  * @param vp_ptr Pointer to the owning VPStandardStateTP object
42  * for the phase. It's a requirement that this be
43  * already malloced.
44  * @param spth Pointer to the SpeciesThermo object for the
45  * phase. It's a requirement that this be already
46  * malloced.
47  */
49 
50  //! Destructor
51  virtual ~VPSSMgr_ConstVol();
52 
53  //! Copy Constructor
54  /*!
55  * @param right Reference to %VPSSMgr_ConstVol object to be copied into the
56  * current one.
57  */
58  VPSSMgr_ConstVol(const VPSSMgr_ConstVol& right);
59 
60  //! Assignment operator for the %VPSSMgr_ConstVol object
61  /*!
62  * This is NOT a virtual function.
63  *
64  * @param right Reference to %VPSSMgr_ConstVol object to be copied into the
65  * current one.
66  */
68 
69  //! Duplicator routine for the VPSSMgr base class
70  /*!
71  * This virtual routine can be used to duplicate %VPSSMgr objects
72  * inherited from %VPSSMgr even if the application only has
73  * a pointer to %VPSSMgr to work with.
74  */
75  virtual VPSSMgr* duplMyselfAsVPSSMgr() const;
76 
77  /*!
78  * @name Properties of the Standard State of the Species in the Solution
79  *
80  * Within VPStandardStateTP, these properties are calculated via a common routine,
81  * _updateStandardStateThermo(),
82  * which must be overloaded in inherited objects.
83  * The values are cached within this object, and are not recalculated unless
84  * the temperature or pressure changes.
85  */
86  //@{
87 
88 protected:
89 
90  //! Updates the standard state thermodynamic functions at the current
91  //! T and P of the solution.
92  /*!
93  * @internal
94  *
95  * If m_useTmpStandardStateStorage is true,
96  * this function must be called whenever the temperature or pressure
97  * has changed.
98  *
99  * This function is responsible for updating the following internal members,
100  * when m_useTmpStandardStateStorage is true.
101  *
102  * - m_hss_RT;
103  * - m_cpss_R;
104  * - m_gss_RT;
105  * - m_sss_R;
106  * - m_Vss
107  *
108  * If m_useTmpStandardStateStorage is not true, this function may be
109  * required to be called every time information is requested from
110  * this object.
111  */
112  virtual void _updateStandardStateThermo();
113 
114  //@}
115 
116  /// @name Thermodynamic Values for the Species Reference States
117  /*!
118  * There are also temporary
119  * variables for holding the species reference-state values of Cp, H, S, and V at the
120  * last temperature and reference pressure called. These functions are not recalculated
121  * if a new call is made using the previous temperature.
122  * All calculations are done within the routine _updateRefStateThermo().
123  * _updateRefStateThermo() is defined in the parent object.
124  */
125  //@{
126 
127  /*!
128  * Returns the vector of nondimensional
129  * Gibbs free energies of the reference state at the current temperature
130  * of the solution and the reference pressure for the species.
131  *
132  * @param grt Output vector contains the nondimensional Gibbs free energies
133  * of the reference state of the species
134  * length = m_kk, units = dimensionless.
135  */
136  virtual void getGibbs_RT_ref(doublereal* grt) const ;
137 
138 
139  //! Get the molar volumes of the species reference states at the current
140  //! <I>T</I> and <I>P_ref</I> of the solution.
141  /*!
142  * units = m^3 / kmol
143  *
144  * @param vol Output vector containing the standard state volumes.
145  * Length: m_kk.
146  */
147  virtual void getStandardVolumes_ref(doublereal* vol) const ;
148 
149  //@}
150 
151  //! @name Initialization Methods - For Internal use
152  /*!
153  * The following methods are used in the process of constructing
154  * the phase and setting its parameters from a specification in an
155  * input file. They are not normally seen by application programs
156  */
157  //@{
158 
159 public:
160  //! Initialize the VPSSMgr object
161  /*!
162  * This method is provided to allow
163  * subclasses to perform any initialization required after all
164  * species have been added. For example, it might be used to
165  * resize internal work arrays that must have an entry for
166  * each species. It is called after createInstallPDSS() and
167  * before initThermoXML().
168  *
169  * @internal
170  */
171  virtual void initThermo();
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 a constant volume pressure dependent
184  //! standard state 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 grabs the molar volume property and installs its value within
192  * this object.
193  * - It also creates a PDSS object, which basically contains a
194  * duplication of some of this information and returns a pointer to
195  * the new object.
196  * .
197  *
198  * @param k Species index within the phase
199  * @param speciesNode Reference to the species node in the XML tree
200  * @param phaseNode_ptr Pointer to the phase node in the XML tree
201  *
202  * @return Returns a pointer to the a newly malloced PDSS object
203  * containing the parameterization
204  */
205  virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode,
206  const XML_Node* const phaseNode_ptr);
207  //@}
208 
209  //! This utility function reports the type of parameterization
210  //! used for the species with index number index.
211  /*!
212  *
213  * @param index Species index
214  */
215  virtual PDSS_enumType reportPDSSType(int index = -1) const ;
216 
217 
218  //! This utility function reports the type of manager
219  //! for the calculation of ss properties
220  /*!
221  *
222  */
223  virtual VPSSMgr_enumType reportVPSSMgrType() const ;
224 
225 };
226 //@}
227 }
228 
229 #endif