Cantera  2.3.0
IdealSolnGasVPSS.h
Go to the documentation of this file.
1 /**
2  * @file IdealSolnGasVPSS.h
3  * Definition file for a derived class of ThermoPhase that assumes either
4  * an ideal gas or ideal solution approximation and handles
5  * variable pressure standard state methods for calculating
6  * thermodynamic properties (see \ref thermoprops and
7  * class \link Cantera::IdealSolnGasVPSS IdealSolnGasVPSS\endlink).
8  */
9 
10 // This file is part of Cantera. See License.txt in the top-level directory or
11 // at http://www.cantera.org/license.txt for license and copyright information.
12 
13 #ifndef CT_IDEALSOLNGASVPSS_H
14 #define CT_IDEALSOLNGASVPSS_H
15 
16 #include "VPStandardStateTP.h"
17 
18 namespace Cantera
19 {
20 /*!
21  * @name CONSTANTS
22  * Models for the Standard State of an IdealSolnPhase
23  * @deprecated To be removed after Cantera 2.3.
24  */
25 //@{
26 const int cIdealSolnGasPhaseG = 6009;
27 const int cIdealSolnGasPhase0 = 6010;
28 const int cIdealSolnGasPhase1 = 6011;
29 const int cIdealSolnGasPhase2 = 6012;
30 
31 /**
32  * @ingroup thermoprops
33  *
34  * An ideal solution or an ideal gas approximation of a phase. Uses variable
35  * pressure standard state methods for calculating thermodynamic properties.
36  */
38 {
39 public:
40  /*!
41  * @name Constructors and Duplicators for IdealSolnGasVPSS
42  */
43  //! @{
44 
46 
47  /// Create an object from an XML input file
48  IdealSolnGasVPSS(const std::string& infile, std::string id="");
49 
51  IdealSolnGasVPSS& operator=(const IdealSolnGasVPSS&);
52  virtual ThermoPhase* duplMyselfAsThermoPhase() const;
53 
54  //@}
55  //! @name Utilities (IdealSolnGasVPSS)
56  //@{
57 
58  virtual int eosType() const;
59  virtual std::string type() const {
60  return "IdealSolnGas";
61  }
62 
63  //! @}
64  //! @name Molar Thermodynamic Properties
65  //! @{
66 
67  virtual doublereal enthalpy_mole() const;
68  virtual doublereal entropy_mole() const;
69  virtual doublereal cp_mole() const;
70  virtual doublereal cv_mole() const;
71 
72  //! @}
73  //! @name Mechanical Properties
74  //! @{
75 
76  void setPressure(doublereal p);
77 
78  virtual doublereal isothermalCompressibility() const;
79 
80 protected:
81  /**
82  * Calculate the density of the mixture using the partial molar volumes and
83  * mole fractions as input. The formula for this is
84  *
85  * \f[
86  * \rho = \frac{\sum_k{X_k W_k}}{\sum_k{X_k V_k}}
87  * \f]
88  *
89  * where \f$X_k\f$ are the mole fractions, \f$W_k\f$ are the molecular
90  * weights, and \f$V_k\f$ are the pure species molar volumes.
91  *
92  * Note, the basis behind this formula is that in an ideal solution the
93  * partial molar volumes are equal to the species standard state molar
94  * volumes. The species molar volumes may be functions of temperature and
95  * pressure.
96  */
97  virtual void calcDensity();
98  //! @}
99 
100 public:
101  virtual void getActivityConcentrations(doublereal* c) const;
102 
103  //! Returns the standard concentration \f$ C^0_k \f$, which is used to
104  //! normalize the generalized concentration.
105  /*!
106  * This is defined as the concentration by which the generalized
107  * concentration is normalized to produce the activity. In many cases, this
108  * quantity will be the same for all species in a phase. Since the activity
109  * for an ideal gas mixture is simply the mole fraction, for an ideal gas
110  * \f$ C^0_k = P/\hat R T \f$.
111  *
112  * @param k Optional parameter indicating the species. The default
113  * is to assume this refers to species 0.
114  * @return
115  * Returns the standard Concentration in units of m3 kmol-1.
116  */
117  virtual doublereal standardConcentration(size_t k=0) const;
118 
119  //! Get the array of non-dimensional activity coefficients at the current
120  //! solution temperature, pressure, and solution concentration.
121  /*!
122  * For ideal gases, the activity coefficients are all equal to one.
123  *
124  * @param ac Output vector of activity coefficients. Length: m_kk.
125  */
126  virtual void getActivityCoefficients(doublereal* ac) const;
127 
128 
129  /// @name Partial Molar Properties of the Solution
130  //@{
131 
132  virtual void getChemPotentials(doublereal* mu) const;
133  virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
134  virtual void getPartialMolarEntropies(doublereal* sbar) const;
135  virtual void getPartialMolarIntEnergies(doublereal* ubar) const;
136  virtual void getPartialMolarCp(doublereal* cpbar) const;
137  virtual void getPartialMolarVolumes(doublereal* vbar) const;
138  //@}
139 
140 public:
141  //! @name Initialization Methods - For Internal use
142  /*!
143  * The following methods are used in the process of constructing the phase
144  * and setting its parameters from a specification in an input file. They
145  * are not normally used in application programs. To see how they are used,
146  * see importPhase().
147  */
148  //@{
149 
150  virtual bool addSpecies(shared_ptr<Species> spec);
151  virtual void setParametersFromXML(const XML_Node& thermoNode);
152  virtual void setToEquilState(const doublereal* lambda_RT);
153  virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
154 
155  //@}
156 
157 protected:
158  //! boolean indicating what ideal solution this is
159  /*!
160  * - 1 = ideal gas
161  * - 0 = ideal soln
162  */
164 
165  //! form of the generalized concentrations
166  /*!
167  * - 0 unity
168  * - 1 1/V_k
169  * - 2 1/V_0
170  */
171  int m_formGC;
172 
173  //! Temporary storage - length = m_kk.
175 };
176 }
177 
178 #endif
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
virtual bool addSpecies(shared_ptr< Species > spec)
vector_fp m_pp
Temporary storage - length = m_kk.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input...
virtual doublereal standardConcentration(size_t k=0) const
Returns the standard concentration , which is used to normalize the generalized concentration.
int m_formGC
form of the generalized concentrations
virtual int eosType() const
Equation of state type flag.
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine for objects which inherit from ThermoPhase.
virtual std::string type() const
String indicating the thermodynamic model implemented.
int m_idealGas
boolean indicating what ideal solution this is
void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
virtual void setParametersFromXML(const XML_Node &thermoNode)
Set equation of state parameter values from XML entries.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature, pressure, and solution concentration.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
Namespace for the Cantera kernel.
Definition: application.cpp:29
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
An ideal solution or an ideal gas approximation of a phase.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.