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