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