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