Cantera  2.1.2
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  * Copyright (2006) Sandia Corporation. Under the terms of
9  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
10  * U.S. Government retains certain rights in this software.
11  */
12 #ifndef CT_PDSS_CONSTVOL_H
13 #define CT_PDSS_CONSTVOL_H
14 
15 #include "PDSS.h"
16 
17 namespace Cantera
18 {
19 class XML_Node;
20 class VPStandardStateTP;
21 
22 //! Class for pressure dependent standard states that use a constant volume model
23 /*!
24  * @ingroup pdssthermo
25  */
26 class PDSS_ConstVol : public PDSS
27 {
28 public:
29  //! @name Constructors
30  //! @{
31 
32  //! Constructor
33  /*!
34  * @param tp Pointer to the ThermoPhase object pertaining to the phase
35  * @param spindex Species index of the species in the phase
36  */
37  PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex);
38 
39  //! Constructor that initializes the object by examining the input file
40  //! of the ThermoPhase object
41  /*!
42  * This function calls the constructPDSSFile member function.
43  *
44  * @param tp Pointer to the ThermoPhase object pertaining to the phase
45  * @param spindex Species index of the species in the phase
46  * @param inputFile String name of the input file
47  * @param id String name of the phase in the input file. The default
48  * is the empty string, in which case the first phase in the
49  * file is used.
50  */
51  PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex,
52  const std::string& inputFile, const std::string& id = "");
53 
54  //! Constructor that initializes the object by examining the input file
55  //! of the ThermoPhase object
56  /*!
57  * This function calls the constructPDSSXML member function.
58  *
59  * @param vptp_ptr Pointer to the ThermoPhase object pertaining to the phase
60  * @param spindex Species index of the species in the phase
61  * @param speciesNode Reference to the species XML tree.
62  * @param phaseRef Reference to the XML tree containing the phase information.
63  * @param spInstalled Boolean indicating whether the species is installed yet
64  * or not.
65  */
66  PDSS_ConstVol(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode,
67  const XML_Node& phaseRef, bool spInstalled);
68 
69  //! Copy Constructur
70  /*!
71  * @param b Object to be copied
72  */
73  PDSS_ConstVol(const PDSS_ConstVol& b);
74 
75  //! Assignment operator
76  /*!
77  * @param b Object to be copeid
78  */
80 
81  virtual PDSS* duplMyselfAsPDSS() const;
82 
83  //! @}
84  //! @name Molar Thermodynamic Properties of the Species Standard State in the Solution
85  //! @{
86 
87  // See PDSS.h for documentation of functions overridden from Class PDSS
88  virtual doublereal enthalpy_mole() const;
89  virtual doublereal enthalpy_RT() const;
90  virtual doublereal intEnergy_mole() const;
91  virtual doublereal entropy_mole() const;
92  virtual doublereal entropy_R() const;
93  virtual doublereal gibbs_mole() const;
94  virtual doublereal gibbs_RT() const;
95  virtual doublereal cp_mole() const;
96  virtual doublereal cp_R() const;
97  virtual doublereal cv_mole() const;
98  virtual doublereal molarVolume() const;
99  virtual doublereal density() const;
100 
101  //! @}
102  //! @name Properties of the Reference State of the Species in the Solution
103  //! @{
104 
105  virtual doublereal gibbs_RT_ref() const;
106  virtual doublereal enthalpy_RT_ref() const;
107  virtual doublereal entropy_R_ref() const;
108  virtual doublereal cp_R_ref() const;
109  virtual doublereal molarVolume_ref() const;
110 
111  //! @}
112  //! @name Mechanical Equation of State Properties
113  //! @{
114 
115  virtual void setPressure(doublereal pres);
116  virtual void setTemperature(doublereal temp);
117  virtual void setState_TP(doublereal temp, doublereal pres);
118  virtual void setState_TR(doublereal temp, doublereal rho);
119 
120  //! @}
121  //! @name Miscellaneous properties of the standard state
122  //! @{
123 
124  virtual doublereal critTemperature() const;
125  virtual doublereal critPressure() const;
126  virtual doublereal critDensity() const;
127  virtual doublereal satPressure(doublereal t);
128 
129  //! @}
130  //! @name Initialization of the Object
131  //! @{
132 
133  virtual void initThermo();
134 
135  //! Initialization of a PDSS object using an
136  //! input XML file.
137  /*!
138  * This routine is a precursor to constructPDSSXML(XML_Node*)
139  * routine, which does most of the work.
140  *
141  * @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
142  * This object must have already been malloced.
143  * @param spindex Species index within the phase
144  * @param inputFile XML file containing the description of the phase
145  * @param id Optional parameter identifying the name of the
146  * phase. If none is given, the first XML
147  * phase element will be used.
148  */
149  void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,
150  const std::string& inputFile, const std::string& id);
151 
152  //! Initialization of a PDSS object using an xml tree
153  /*!
154  * This routine is a driver for the initialization of the object.
155  *
156  * basic logic:
157  * - initThermo() (cascade)
158  * - getStuff from species Part of XML file
159  * - initThermoXML(phaseNode) (cascade)
160  *
161  * @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
162  * This object must have already been malloced.
163  * @param spindex Species index within the phase
164  * @param speciesNode XML Node containing the species information
165  * @param phaseNode Reference to the phase Information for the phase
166  * that owns this species.
167  * @param spInstalled Boolean indicating whether the species is
168  * already installed.
169  */
170  void constructPDSSXML(VPStandardStateTP* vptp_ptr, size_t spindex,
171  const XML_Node& speciesNode,
172  const XML_Node& phaseNode, bool spInstalled);
173 
174  virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id);
175 
176  //@}
177 
178 private:
179  //! Value of the constant molar volume for the species
180  /*!
181  * m3 / kmol
182  */
183  doublereal m_constMolarVolume;
184 };
185 
186 }
187 
188 #endif
virtual void setTemperature(doublereal temp)
Set the internal temperature.
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
virtual doublereal gibbs_RT_ref() const
Return the molar gibbs free energy divided by RT at reference pressure.
doublereal m_constMolarVolume
Value of the constant molar volume for the species.
virtual void setPressure(doublereal pres)
Sets the pressure in the object.
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:100
virtual doublereal molarVolume() const
Return the molar volume at standard state.
virtual doublereal density() const
Return the standard state density at standard state.
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 entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
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...
virtual doublereal cp_mole() const
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
virtual doublereal gibbs_mole() const
Return the molar Gibbs free energy in units of J kmol-1.
Class for pressure dependent standard states that use a constant volume model.
Definition: PDSS_ConstVol.h:26
virtual doublereal enthalpy_mole() const
Return the molar enthalpy in units of J kmol-1.
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
PDSS_ConstVol & operator=(const PDSS_ConstVol &b)
Assignment operator.
virtual doublereal cp_R() const
Return the molar const pressure heat capacity divided by RT.
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
virtual doublereal critDensity() const
critical density
virtual PDSS * duplMyselfAsPDSS() const
Duplication routine for objects which inherit from PDSS.
virtual doublereal entropy_R() const
Return the standard state entropy divided by RT.
virtual doublereal critTemperature() const
critical temperature
virtual doublereal entropy_mole() const
Return the molar entropy in units of J kmol-1 K-1.
virtual void initThermoXML(const XML_Node &phaseNode, const std::string &id)
Initialization routine for the PDSS object based on the phaseNode.
Virtual base class for a species with a pressure dependent standard state.
Definition: PDSS.h:195
virtual doublereal gibbs_RT() const
Return the molar Gibbs free energy divided by RT.
virtual doublereal cv_mole() const
Return the molar const volume heat capacity in units of J kmol-1 K-1.
virtual doublereal enthalpy_RT() const
Return the standard state molar enthalpy 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.
virtual doublereal critPressure() const
critical pressure
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.