Cantera  2.3.0
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 // This file is part of Cantera. See License.txt in the top-level directory or
11 // at http://www.cantera.org/license.txt for license and copyright information.
12 
13 #ifndef CT_VPSSMGR_GENERAL_H
14 #define CT_VPSSMGR_GENERAL_H
15 
16 #include "VPSSMgr.h"
17 
18 namespace Cantera
19 {
20 //! Class that handles the calculation of standard state thermo properties for
21 //! a set of species belonging to a single phase in a completely general
22 //! but slow way.
23 /*!
24  * This class manages the calculation of standard state thermo properties
25  * for a set of species belonging to a single phase in a completely general
26  * but slow way. The way this does this is to call the underlying PDSS
27  * routines one at a time for every species.
28  *
29  * @ingroup mgrpdssthermocalc
30  */
31 class VPSSMgr_General : public VPSSMgr
32 {
33 public:
34  //! Constructor
35  /*!
36  * @param vp_ptr Pointer to the owning VPStandardStateTP object for the
37  * phase.
38  * @param spth Pointer to the MultiSpeciesThermo object for the phase.
39  */
41  MultiSpeciesThermo* spth);
42 
43  VPSSMgr_General(const VPSSMgr_General& right);
44  VPSSMgr_General& operator=(const VPSSMgr_General& right);
45  virtual VPSSMgr* duplMyselfAsVPSSMgr() const;
46 
47 protected:
48  /*!
49  * @name Properties of the Standard State of the Species in the Solution
50  *
51  * Within VPStandardStateTP, these properties are calculated via a common
52  * routine, _updateStandardStateThermo(), which must be overloaded in
53  * inherited objects. The values are cached within this object, and are
54  * not recalculated unless the temperature or pressure changes.
55  */
56  //@{
57  virtual void _updateStandardStateThermo();
58  virtual void _updateRefStateThermo() const;
59  //@}
60 
61  /*! @name Thermodynamic Values for the Species Reference States
62  * There are also temporary variables for holding the species reference-
63  * state values of Cp, H, S, and V at the last temperature and reference
64  * pressure called. These functions are not recalculated if a new call is
65  * made using the previous temperature. All calculations are done within
66  * the routine _updateRefStateThermo().
67  */
68  //@{
69  virtual void getGibbs_ref(doublereal* g) const;
70  //@}
71 
72  /*! @name Initialization Methods - For Internal use
73  * The following methods are used in the process of constructing the phase
74  * and setting its parameters from a specification in an input file. They
75  * are not normally used in application programs. To see how they are
76  * used, see importPhase().
77  */
78  //@{
79  virtual void initThermo();
80  //@}
81 
82 private:
83  //! Local factory routine for the creation of PDSS objects
84  /*!
85  * This routine is specific to the VPSSMgr_General object. It will create
86  * a PDSS object for species k, by searching and querying for the
87  * "standardState" XML node in the standard state description of the
88  * species. If this XML node doesn't exist, it will assume that the
89  * standard state is an ideal gas. It decides on the attribute, "model",
90  * what PDSS object to create.
91  *
92  * @param speciesNode XML node for the standard state of the species
93  * @param k Species number
94  * @param phaseNode_ptr pointer to the phase XML node
95  * @param doST output variable indicating whether the
96  * instantiation has resulted in a MultiSpeciesThermo object
97  * being created and registered with the MultiSpeciesThermo
98  * manager class.
99  * @returns the pointer to a newly created PDSS object
100  */
101  PDSS* returnPDSS_ptr(size_t k, const XML_Node& speciesNode,
102  const XML_Node* const phaseNode_ptr, bool& doST);
103 
104 public:
105  //! Factory routine for the creation of PDSS objects that are
106  //! then internally registered with this VPSSMgr object
107  /*!
108  * This function sets up the internal data within this object for handling
109  * the calculation of the standard state for the species.
110  *
111  * This routine will create a PDSS object for species k, by searching and
112  * querying for the "standardState" XML node in the standard state
113  * description of the species. It will then store the object's pointer in
114  * a vector of pointers, and it will own the object.
115  *
116  * @param k Species number
117  * @param speciesNode XML node for the standard state of the species
118  * @param phaseNode_ptr pointer to the phase XML node
119  * @return the pointer to the newly created PDSS object
120  */
121  virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode,
122  const XML_Node* const phaseNode_ptr);
123 
124  virtual PDSS_enumType reportPDSSType(int index = -1) const;
125  virtual VPSSMgr_enumType reportVPSSMgrType() const;
126  virtual void initAllPtrs(VPStandardStateTP* vp_ptr, MultiSpeciesThermo* sp_ptr);
127 
128 private:
129  //! Shallow pointers containing the PDSS objects for the species
130  //! in this phase. This object doesn't own these pointers.
131  std::vector<PDSS*> m_PDSS_ptrs;
132 };
133 
134 }
135 
136 #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 base class for the classes that manage the calculation of standard state properties for all t...
Definition: VPSSMgr.h:228
Declaration file for a virtual base class that manages the calculation of standard state properties f...
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:97
VPSSMgr_enumType
enum for VPSSMgr types that are responsible for calculating the species standard state and reference-...
Definition: mix_defs.h:119
VPSSMgr_General(VPStandardStateTP *vp_ptr, MultiSpeciesThermo *spth)
Constructor.
virtual VPSSMgr_enumType reportVPSSMgrType() const
This utility function reports the type of manager for the calculation of ss properties.
virtual VPSSMgr * duplMyselfAsVPSSMgr() const
Duplication routine for objects which derive from VPSSMgr.
virtual void getGibbs_ref(doublereal *g) const
PDSS_enumType
Types of PDSS&#39;s.
Definition: mix_defs.h:105
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
virtual void _updateRefStateThermo() const
Updates the reference state thermodynamic functions at the current T of the solution and the referenc...
virtual void initAllPtrs(VPStandardStateTP *vp_ptr, MultiSpeciesThermo *sp_ptr)
Initialize the internal shallow pointers in this object.
Virtual base class for a species with a pressure dependent standard state.
Definition: PDSS.h:176
virtual PDSS_enumType reportPDSSType(int index=-1) const
This utility function reports the type of parameterization used for the species with index number ind...
A species thermodynamic property manager for a phase.
Class that handles the calculation of standard state thermo properties for a set of species belonging...
Namespace for the Cantera kernel.
Definition: application.cpp:29
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...