Cantera  2.1.2
VPSSMgr_General.h
Go to the documentation of this file.
1 /**
2  * @file VPSSMgr_General.h
3  * Declaration file for a derived class that handles the calculation
4  * of standard state thermo properties for
5  * a set of species belonging to a single phase in a completely general
6  * but slow way (see \ref mgrpdssthermocalc and
7  * class \link Cantera::VPSSMgr_General VPSSMgr_General\endlink).
8  */
9 /*
10  * Copyright (2007) 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_GENERAL_H
16 #define CT_VPSSMGR_GENERAL_H
17 
18 #include "cantera/base/ct_defs.h"
19 #include "VPSSMgr.h"
20 
21 namespace Cantera
22 {
23 
24 class SpeciesThermoInterpType;
25 class VPStandardStateTP;
26 class SpeciesThermo;
27 class PDSS;
28 
29 //! Class that handles the calculation of standard state thermo properties for
30 //! a set of species belonging to a single phase in a completely general
31 //! but slow way.
32 /*!
33  * This class manages the calculation of standard state thermo properties
34  * for a set of species belonging to a single phase in a completely general
35  * but slow way. The way this does this is to call the underlying PDSS
36  * routines one at a time for every species.
37  *
38  * @ingroup mgrpdssthermocalc
39  */
40 class VPSSMgr_General : public VPSSMgr
41 {
42 public:
43  //! Constructor
44  /*!
45  * @param vp_ptr Pointer to the owning VPStandardStateTP object for the
46  * phase. It's a requirement that this be already malloced.
47  * @param spth Pointer to the SpeciesThermo object for the phase. It's
48  * a requirement that this be already malloced.
49  */
51  SpeciesThermo* spth);
52 
53  //! Copy Constructor
54  VPSSMgr_General(const VPSSMgr_General& right);
55 
56  //! Assignment operator
58 
59  virtual VPSSMgr* duplMyselfAsVPSSMgr() const;
60 
61 protected:
62  /*!
63  * @name Properties of the Standard State of the Species in the Solution
64  *
65  * Within VPStandardStateTP, these properties are calculated via a common
66  * routine, _updateStandardStateThermo(), which must be overloaded in
67  * inherited objects. The values are cached within this object, and are
68  * not recalculated unless the temperature or pressure changes.
69  */
70  //@{
71  virtual void _updateStandardStateThermo();
72  virtual void _updateRefStateThermo() const;
73  //@}
74 
75  /*! @name Thermodynamic Values for the Species Reference States
76  * There are also temporary variables for holding the species reference-
77  * state values of Cp, H, S, and V at the last temperature and reference
78  * pressure called. These functions are not recalculated if a new call is
79  * made using the previous temperature. All calculations are done within
80  * the routine _updateRefStateThermo().
81  */
82  //@{
83  virtual void getGibbs_ref(doublereal* g) const ;
84  //@}
85 
86  /*! @name Initialization Methods - For Internal use
87  * The following methods are used in the process of constructing the phase
88  * and setting its parameters from a specification in an input file. They
89  * are not normally used in application programs. To see how they are
90  * used, see files importCTML.cpp and ThermoFactory.cpp.
91  */
92  //@{
93  virtual void initThermo();
94  virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
95  //@}
96 
97 private:
98  //! Local factory routine for the creation of PDSS objects
99  /*!
100  * This routine is specific to the VPSSMgr_General object. It will create
101  * a PDSS object for species k, by searching and querying for the
102  * "standardState" XML node in the standard state description of the
103  * species. If this XML node doesn't exist, it will assume that the
104  * standard state is an ideal gas. It decides on the attribute, "model",
105  * what PDSS object to create.
106  *
107  * @param speciesNode XML node for the standard state of the species
108  * @param k Species number
109  * @param phaseNode_ptr pointer to the phase XML node
110  * @param doST output variable indicating whether the
111  * instantiation has resulted in a SpeciesThermo object
112  * being created and registered with the SpeciesThermo
113  * manager class.
114  * @return Returns the pointer to a malloced PDSS object
115  */
116  PDSS* returnPDSS_ptr(size_t k, const XML_Node& speciesNode,
117  const XML_Node* const phaseNode_ptr, bool& doST);
118 
119 public:
120  //! Factory routine for the creation of PDSS objects that are
121  //! then internally registered with this VPSSMgr object
122  /*!
123  * This function sets up the internal data within this object for handling
124  * the calculation of the standard state for the species.
125  *
126  * This routine will create a PDSS object for species k, by searching and
127  * querying for the "standardState" XML node in the standard state
128  * description of the species. It will then store the object's pointer in
129  * a vector of pointers, and it will own the object.
130  *
131  * @param k Species number
132  * @param speciesNode XML node for the standard state of the species
133  * @param phaseNode_ptr pointer to the phase XML node
134  * @return Returns the pointer to the malloced PDSS object
135  */
136  virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode,
137  const XML_Node* const phaseNode_ptr);
138 
139 
140  virtual PDSS_enumType reportPDSSType(int index = -1) const ;
141  virtual VPSSMgr_enumType reportVPSSMgrType() const ;
142  virtual void initAllPtrs(VPStandardStateTP* vp_ptr, SpeciesThermo* sp_ptr);
143 
144 private:
145  //! Shallow pointers containing the PDSS objects for the species
146  //! in this phase. This object doesn't own these pointers.
147  std::vector<PDSS*> m_PDSS_ptrs;
148 };
149 
150 }
151 
152 #endif
PDSS * returnPDSS_ptr(size_t k, const XML_Node &speciesNode, const XML_Node *const phaseNode_ptr, bool &doST)
Local factory routine for the creation of PDSS objects.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Finalize the thermo after all species have been entered.
virtual VPSSMgr_enumType reportVPSSMgrType() const
This utility function reports the type of manager for the calculation of ss properties.
VPSSMgr_General & operator=(const VPSSMgr_General &right)
Assignment operator.
virtual void initAllPtrs(VPStandardStateTP *vp_ptr, SpeciesThermo *sp_ptr)
Initialize the internal shallow pointers in this object.
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...
VPSSMgr_General(VPStandardStateTP *vp_ptr, SpeciesThermo *spth)
Constructor.
virtual void _updateStandardStateThermo()
Updates the standard state thermodynamic functions at the current T and P of the solution.
std::vector< PDSS * > m_PDSS_ptrs
Shallow pointers containing the PDSS objects for the species in this phase.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:100
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
virtual void _updateRefStateThermo() const
Updates the reference state thermodynamic functions at the current T of the solution and the referenc...
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 getGibbs_ref(doublereal *g) const
PDSS_enumType
Types of PDSS's.
Definition: mix_defs.h:119
virtual VPSSMgr * duplMyselfAsVPSSMgr() const
Duplication routine for objects which derive from VPSSMgr.
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 base class for a species with a pressure dependent standard state.
Definition: PDSS.h:195
Class that handles the calculation of standard state thermo properties for a set of species belonging...
virtual PDSS * createInstallPDSS(size_t k, const XML_Node &speciesNode, const XML_Node *const phaseNode_ptr)
Factory routine for the creation of PDSS objects that are then internally registered with this VPSSMg...