Cantera  2.3.0
PDSS_ConstVol.h
Go to the documentation of this file.
1 /**
2  * @file PDSS_ConstVol.h
3  * Declarations for the class PDSS_ConstVol (pressure dependent standard state)
4  * which handles calculations for a single species with a constant molar volume in a phase
5  * (see class \ref pdssthermo and \link Cantera::PDSS_ConstVol PDSS_ConstVol\endlink).
6  */
7 
8 // This file is part of Cantera. See License.txt in the top-level directory or
9 // at http://www.cantera.org/license.txt for license and copyright information.
10 
11 #ifndef CT_PDSS_CONSTVOL_H
12 #define CT_PDSS_CONSTVOL_H
13 
14 #include "PDSS.h"
15 
16 namespace Cantera
17 {
18 //! Class for pressure dependent standard states that use a constant volume model
19 /*!
20  * @ingroup pdssthermo
21  */
23 {
24 public:
25  //! @name Constructors
26  //! @{
27 
28  //! Constructor
29  /*!
30  * @param tp Pointer to the ThermoPhase object pertaining to the phase
31  * @param spindex Species index of the species in the phase
32  */
33  PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex);
34 
35  //! Constructor that initializes the object by examining the input file
36  //! of the ThermoPhase object
37  /*!
38  * This function calls the constructPDSSFile member function.
39  *
40  * @param tp Pointer to the ThermoPhase object pertaining to the phase
41  * @param spindex Species index of the species in the phase
42  * @param inputFile String name of the input file
43  * @param id String name of the phase in the input file. The default
44  * is the empty string, in which case the first phase in
45  * the file is used.
46  * @deprecated To be removed after Cantera 2.3.
47  */
48  PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex,
49  const std::string& inputFile, const std::string& id = "");
50 
51  //! Constructor that initializes the object by examining the input file
52  //! of the ThermoPhase object
53  /*!
54  * This function calls the constructPDSSXML member function.
55  *
56  * @param vptp_ptr Pointer to the ThermoPhase object pertaining to the phase
57  * @param spindex Species index of the species in the phase
58  * @param speciesNode Reference to the species XML tree.
59  * @param phaseRef Reference to the XML tree containing the phase information.
60  * @param spInstalled Boolean indicating whether the species is installed
61  * yet or not.
62  */
63  PDSS_ConstVol(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode,
64  const XML_Node& phaseRef, bool spInstalled);
65 
66  PDSS_ConstVol(const PDSS_ConstVol& b);
67  PDSS_ConstVol& operator=(const PDSS_ConstVol& b);
68  virtual PDSS* duplMyselfAsPDSS() const;
69 
70  //! @}
71  //! @name Molar Thermodynamic Properties of the Species Standard State in
72  //! the Solution
73  //! @{
74 
75  // See PDSS.h for documentation of functions overridden from Class PDSS
76  virtual doublereal enthalpy_RT() const;
77  virtual doublereal intEnergy_mole() const;
78  virtual doublereal entropy_R() const;
79  virtual doublereal gibbs_RT() const;
80  virtual doublereal cp_R() const;
81  virtual doublereal cv_mole() const;
82  virtual doublereal molarVolume() const;
83  virtual doublereal density() const;
84 
85  //! @}
86  //! @name Properties of the Reference State of the Species in the Solution
87  //! @{
88 
89  virtual doublereal gibbs_RT_ref() const;
90  virtual doublereal enthalpy_RT_ref() const;
91  virtual doublereal entropy_R_ref() const;
92  virtual doublereal cp_R_ref() const;
93  virtual doublereal molarVolume_ref() const;
94 
95  //! @}
96  //! @name Mechanical Equation of State Properties
97  //! @{
98 
99  virtual void setPressure(doublereal pres);
100  virtual void setTemperature(doublereal temp);
101  virtual void setState_TP(doublereal temp, doublereal pres);
102  virtual void setState_TR(doublereal temp, doublereal rho);
103 
104  //! @}
105  //! @name Miscellaneous properties of the standard state
106  //! @{
107 
108  virtual doublereal satPressure(doublereal t);
109 
110  //! @}
111  //! @name Initialization of the Object
112  //! @{
113 
114  virtual void initThermo();
115 
116  //! Initialization of a PDSS object using an input XML file.
117  /*!
118  * This routine is a precursor to constructPDSSXML(XML_Node*) routine, which
119  * does most of the work.
120  *
121  * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object
122  * @param spindex Species index within the phase
123  * @param inputFile XML file containing the description of the phase
124  * @param id Optional parameter identifying the name of the phase.
125  * If none is given, the first XML phase element will be
126  * used.
127  * @deprecated To be removed after Cantera 2.3.
128  */
129  void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,
130  const std::string& inputFile, const std::string& id);
131 
132  //! Initialization of a PDSS object using an XML tree
133  /*!
134  * This routine is a driver for the initialization of the object.
135  *
136  * basic logic:
137  * - initThermo() (cascade)
138  * - getStuff from species Part of XML file
139  * - initThermoXML(phaseNode) (cascade)
140  *
141  * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object
142  * @param spindex Species index within the phase
143  * @param speciesNode XML Node containing the species information
144  * @param phaseNode Reference to the phase Information for the phase
145  * that owns this species.
146  * @param spInstalled Boolean indicating whether the species is
147  * already installed.
148  */
149  void constructPDSSXML(VPStandardStateTP* vptp_ptr, size_t spindex,
150  const XML_Node& speciesNode,
151  const XML_Node& phaseNode, bool spInstalled);
152 
153  virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id);
154 
155  //@}
156 
157 private:
158  //! Value of the constant molar volume for the species
159  /*!
160  * m3 / kmol
161  */
162  doublereal m_constMolarVolume;
163 };
164 
165 }
166 
167 #endif
virtual void setTemperature(doublereal temp)
Set the internal temperature.
virtual doublereal enthalpy_RT() const
Return the standard state molar enthalpy divided by RT.
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
virtual doublereal gibbs_RT_ref() const
Return the molar Gibbs free energy divided by RT at reference pressure.
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
virtual doublereal cp_R() const
Return the molar const pressure heat capacity divided by RT.
doublereal m_constMolarVolume
Value of the constant molar volume for the species.
virtual void setPressure(doublereal pres)
Sets the pressure in the object.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
void constructPDSSFile(VPStandardStateTP *vptp_ptr, size_t spindex, const std::string &inputFile, const std::string &id)
Initialization of a PDSS object using an input XML file.
virtual void setState_TR(doublereal temp, doublereal rho)
Set the internal temperature and density.
virtual doublereal molarVolume() const
Return the molar volume at standard state.
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
virtual doublereal satPressure(doublereal t)
saturation pressure
PDSS_ConstVol(VPStandardStateTP *tp, size_t spindex)
Constructor.
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
Base class for PDSS classes which compute nondimensional properties directly.
Definition: PDSS.h:662
Class for pressure dependent standard states that use a constant volume model.
Definition: PDSS_ConstVol.h:22
virtual PDSS * duplMyselfAsPDSS() const
Duplication routine for objects which inherit from PDSS.
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
virtual doublereal gibbs_RT() const
Return the molar Gibbs free energy divided by RT.
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
virtual void initThermoXML(const XML_Node &phaseNode, const std::string &id)
Initialization routine for the PDSS object based on the phaseNode.
virtual doublereal density() const
Return the standard state density at standard state.
Virtual base class for a species with a pressure dependent standard state.
Definition: PDSS.h:176
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
virtual doublereal entropy_R() const
Return the standard state entropy divided by RT.
void constructPDSSXML(VPStandardStateTP *vptp_ptr, size_t spindex, const XML_Node &speciesNode, const XML_Node &phaseNode, bool spInstalled)
Initialization of a PDSS object using an XML tree.
virtual void initThermo()
Initialization routine for all of the shallow pointers.
Namespace for the Cantera kernel.
Definition: application.cpp:29
virtual doublereal cv_mole() const
Return the molar const volume heat capacity in units of J kmol-1 K-1.