Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 for pressure dependent standard states that use a constant volume model
20 /*!
21  * @ingroup pdssthermo
22  */
24 {
25 public:
26  //! @name Constructors
27  //! @{
28 
29  //! Constructor
30  /*!
31  * @param tp Pointer to the ThermoPhase object pertaining to the phase
32  * @param spindex Species index of the species in the phase
33  */
34  PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex);
35 
36  //! Constructor that initializes the object by examining the input file
37  //! of the ThermoPhase object
38  /*!
39  * This function calls the constructPDSSFile member function.
40  *
41  * @param tp Pointer to the ThermoPhase object pertaining to the phase
42  * @param spindex Species index of the species in the phase
43  * @param inputFile String name of the input file
44  * @param id String name of the phase in the input file. The default
45  * is the empty string, in which case the first phase in the
46  * file is used.
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 yet
61  * 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  //! Copy Constructor
67  /*!
68  * @param b Object to be copied
69  */
70  PDSS_ConstVol(const PDSS_ConstVol& b);
71 
72  //! Assignment operator
73  /*!
74  * @param b Object to be copied
75  */
77 
78  virtual PDSS* duplMyselfAsPDSS() const;
79 
80  //! @}
81  //! @name Molar Thermodynamic Properties of the Species Standard State in the Solution
82  //! @{
83 
84  // See PDSS.h for documentation of functions overridden from Class PDSS
85  virtual doublereal enthalpy_RT() const;
86  virtual doublereal intEnergy_mole() const;
87  virtual doublereal entropy_R() const;
88  virtual doublereal gibbs_RT() const;
89  virtual doublereal cp_R() const;
90  virtual doublereal cv_mole() const;
91  virtual doublereal molarVolume() const;
92  virtual doublereal density() const;
93 
94  //! @}
95  //! @name Properties of the Reference State of the Species in the Solution
96  //! @{
97 
98  virtual doublereal gibbs_RT_ref() const;
99  virtual doublereal enthalpy_RT_ref() const;
100  virtual doublereal entropy_R_ref() const;
101  virtual doublereal cp_R_ref() const;
102  virtual doublereal molarVolume_ref() const;
103 
104  //! @}
105  //! @name Mechanical Equation of State Properties
106  //! @{
107 
108  virtual void setPressure(doublereal pres);
109  virtual void setTemperature(doublereal temp);
110  virtual void setState_TP(doublereal temp, doublereal pres);
111  virtual void setState_TR(doublereal temp, doublereal rho);
112 
113  //! @}
114  //! @name Miscellaneous properties of the standard state
115  //! @{
116 
117  virtual doublereal satPressure(doublereal t);
118 
119  //! @}
120  //! @name Initialization of the Object
121  //! @{
122 
123  virtual void initThermo();
124 
125  //! Initialization of a PDSS object using an
126  //! input XML file.
127  /*!
128  * This routine is a precursor to constructPDSSXML(XML_Node*)
129  * routine, which does most of the work.
130  *
131  * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object
132  * This object must have already been malloced.
133  * @param spindex Species index within the phase
134  * @param inputFile XML file containing the description of the phase
135  * @param id Optional parameter identifying the name of the
136  * phase. If none is given, the first XML
137  * phase element will be used.
138  */
139  void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,
140  const std::string& inputFile, const std::string& id);
141 
142  //! Initialization of a PDSS object using an XML tree
143  /*!
144  * This routine is a driver for the initialization of the object.
145  *
146  * basic logic:
147  * - initThermo() (cascade)
148  * - getStuff from species Part of XML file
149  * - initThermoXML(phaseNode) (cascade)
150  *
151  * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object
152  * This object must have already been malloced.
153  * @param spindex Species index within the phase
154  * @param speciesNode XML Node containing the species information
155  * @param phaseNode Reference to the phase Information for the phase
156  * that owns this species.
157  * @param spInstalled Boolean indicating whether the species is
158  * already installed.
159  */
160  void constructPDSSXML(VPStandardStateTP* vptp_ptr, size_t spindex,
161  const XML_Node& speciesNode,
162  const XML_Node& phaseNode, bool spInstalled);
163 
164  virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id);
165 
166  //@}
167 
168 private:
169  //! Value of the constant molar volume for the species
170  /*!
171  * m3 / kmol
172  */
173  doublereal m_constMolarVolume;
174 };
175 
176 }
177 
178 #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...
Base class for PDSS classes which compute nondimensional properties directly.
Definition: PDSS.h:687
Class for pressure dependent standard states that use a constant volume model.
Definition: PDSS_ConstVol.h:23
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 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 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:193
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 intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.