Cantera  2.1.2
VPSSMgr_Water_HKFT.h
Go to the documentation of this file.
1 /**
2  * @file VPSSMgr_Water_HKFT.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 the HKFT equation of state
6  * (see \ref mgrpdssthermocalc and
7  * class \link Cantera::VPSSMgr_Water_HKFT VPSSMgr_Water_HKFT\endlink).
8  */
9 /*
10  * Copyright (2006) 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_WATER_HKFT_H
16 #define CT_VPSSMGR_WATER_HKFT_H
17 
18 #include "VPSSMgr.h"
19 
20 namespace Cantera
21 {
22 
23 class SpeciesThermoInterpType;
24 class VPStandardStateTP;
25 class SpeciesThermo;
26 class PDSS;
27 class PDSS_Water;
28 
29 //! Manages standard state thermo properties for real water and a set of
30 //! species which have the HKFT equation of state.
32 {
33 public:
34  //! Constructor
35  /*!
36  * @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
37  * This object must have already been malloced.
38  *
39  * @param spth Pointer to the optional SpeciesThermo object
40  * that will handle the calculation of the reference
41  * state thermodynamic coefficients.
42  */
44  SpeciesThermo* spth);
45 
46  //! Copy Constructor
48 
49  //! Assignment operator
51 
52  virtual VPSSMgr* duplMyselfAsVPSSMgr() const;
53 
54  /*! @name Thermodynamic Values for the Species Reference States
55  * There are also temporary variables for holding the species reference-
56  * state values of Cp, H, S, and V at the last temperature and reference
57  * pressure called. These functions are not recalculated if a new call is
58  * made using the previous temperature. All calculations are done within
59  * the routine _updateRefStateThermo().
60  */
61  //@{
62 
63  virtual void getEnthalpy_RT_ref(doublereal* hrt) const;
64  virtual void getGibbs_RT_ref(doublereal* grt) const ;
65  virtual void getGibbs_ref(doublereal* g) const ;
66  virtual void getEntropy_R_ref(doublereal* er) const ;
67  virtual void getCp_R_ref(doublereal* cpr) const ;
68  virtual void getStandardVolumes_ref(doublereal* vol) const ;
69  //@}
70 
71  virtual void setState_TP(doublereal T, doublereal P);
72  virtual void setState_T(doublereal T);
73  virtual void setState_P(doublereal P);
74 
75  /*! @name Setting the Internal State of the System
76  * All calls to change the internal state of the system's T and P
77  * are done through these routines
78  * - setState_TP()
79  * - setState_T()
80  * - setState_P()
81  *
82  * These routine in turn call the following underlying virtual functions
83  *
84  * - _updateRefStateThermo()
85  * - _updateStandardStateThermo()
86  *
87  * An important point to note is that between calls the assumption
88  * that the underlying PDSS objects will retain their set Temperatures
89  * and Pressure CAN NOT BE MADE. For efficiency reasons, we may twiddle
90  * these to get derivatives.
91  */
92  //@{
93  virtual void updateRefStateThermo() const;
94 private:
95  virtual void _updateRefStateThermo() const;
96  virtual void _updateStandardStateThermo();
97  //@}
98 
99 public:
100  /*! @name Utility Methods - Reports on various quantities
101  * The following methods are used in the process of reporting
102  * various states and attributes
103  */
104  //@{
105  virtual PDSS_enumType reportPDSSType(int index = -1) const ;
106  virtual VPSSMgr_enumType reportVPSSMgrType() const ;
107  //@}
108 
109  /*! @name Initialization Methods - For Internal use (VPStandardState)
110  * The following methods are used in the process of constructing
111  * the phase and setting its parameters from a specification in an
112  * input file. They are not normally used in application programs.
113  * To see how they are used, see files importCTML.cpp and
114  * ThermoFactory.cpp.
115  */
116  //@{
117  virtual void initThermo();
118  virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
119  virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode,
120  const XML_Node* const phaseNode_ptr);
121  //@}
122 
123  //! Initialize the internal shallow pointers in this object
124  /*!
125  * There are a bunch of internal shallow pointers that point to the owning
126  * VPStandardStateTP and SpeciesThermo objects. This function reinitializes
127  * them. This function is called like an onion.
128  *
129  * @param vp_ptr Pointer to the VPStandardStateTP standard state
130  * @param sp_ptr Pointer to the SpeciesThermo standard state
131  */
132  virtual void initAllPtrs(VPStandardStateTP* vp_ptr, SpeciesThermo* sp_ptr);
133 private:
134  //! Shallow pointer to the water object
136 
137  //! Last reference temperature calculated
138  /*!
139  * Reference state calculations are totally separated from
140  * standard state calculations.
141  */
142  mutable doublereal m_tlastRef;
143 };
144 }
145 
146 #endif
virtual void setState_T(doublereal T)
Set the temperature (K)
doublereal m_tlastRef
Last reference temperature calculated.
virtual PDSS * createInstallPDSS(size_t k, const XML_Node &speciesNode, const XML_Node *const phaseNode_ptr)
Install specific content for species k in the standard-state thermodynamic calculator and also create...
VPSSMgr_Water_HKFT(VPStandardStateTP *vptp_ptr, SpeciesThermo *spth)
Constructor.
Virtual base class for the classes that manage the calculation of standard state properties for all t...
Definition: VPSSMgr.h:238
Declaration file for a virtual base class that manages the calculation of standard state properties f...
virtual void getEntropy_R_ref(doublereal *er) const
virtual void getGibbs_RT_ref(doublereal *grt) const
PDSS_Water * m_waterSS
Shallow pointer to the water object.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:100
virtual VPSSMgr * duplMyselfAsVPSSMgr() const
Duplication routine for objects which derive from VPSSMgr.
virtual void initAllPtrs(VPStandardStateTP *vp_ptr, SpeciesThermo *sp_ptr)
Initialize the internal shallow pointers in this object.
Pure Virtual base class for the species thermo manager classes.
VPSSMgr_enumType
enum for VPSSMgr types that are responsible for calculating the species standard state and reference-...
Definition: mix_defs.h:133
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Finalize the thermo after all species have been entered.
virtual void setState_P(doublereal P)
Set the pressure (Pa)
virtual void getCp_R_ref(doublereal *cpr) const
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Class for the liquid water pressure dependent standard state.
Definition: PDSS_Water.h:54
PDSS_enumType
Types of PDSS's.
Definition: mix_defs.h:119
virtual void getStandardVolumes_ref(doublereal *vol) const
Get the molar volumes of the species reference states at the current T and P_ref of the solution...
Manages standard state thermo properties for real water and a set of species which have the HKFT equa...
virtual void getGibbs_ref(doublereal *g) const
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
virtual PDSS_enumType reportPDSSType(int index=-1) const
This utility function reports the type of parameterization used for the species with index number ind...
virtual VPSSMgr_enumType reportVPSSMgrType() const
This utility function reports the type of manager for the calculation of ss properties.
VPSSMgr_Water_HKFT & operator=(const VPSSMgr_Water_HKFT &right)
Assignment operator.
virtual void _updateRefStateThermo() const
Updates the reference state thermodynamic functions at the current T of the solution and the referenc...
Virtual base class for a species with a pressure dependent standard state.
Definition: PDSS.h:195
virtual void updateRefStateThermo() const
Updates the internal reference state thermodynamic vectors at the current T of the solution and the r...
virtual void setState_TP(doublereal T, doublereal P)
Set the temperature (K) and pressure (Pa)
virtual void _updateStandardStateThermo()
Updates the standard state thermodynamic functions at the current T and P of the solution.