Cantera  2.3.0
MineralEQ3.h
Go to the documentation of this file.
1 /**
2  * @file MineralEQ3.h
3  * Header file for the MineralEQ3 class, which represents a fixed-composition
4  * incompressible substance based on EQ3's parameterization (see \ref thermoprops and
5  * class \link Cantera::MineralEQ3 MineralEQ3\endlink)
6  */
7 
8 // This file is part of Cantera. See License.txt in the top-level directory or
9 // at http://www.cantera.org/license.txt for license and copyright information.
10 
11 #ifndef CT_MINERALEQ3_H
12 #define CT_MINERALEQ3_H
13 
14 #include "StoichSubstance.h"
15 
16 namespace Cantera
17 {
18 
19 //! Class MineralEQ3 represents a stoichiometric (fixed composition)
20 //! incompressible substance based on EQ3's parameterization
21 /*!
22  * @attention This class currently does not have any test cases or examples. Its
23  * implementation may be incomplete, and future changes to Cantera may
24  * unexpectedly cause this class to stop working. If you use this class,
25  * please consider contributing examples or test cases. In the absence of
26  * new tests or examples, this class may be deprecated and removed in a
27  * future version of Cantera. See
28  * https://github.com/Cantera/cantera/issues/267 for additional information.
29  *
30  * This class inherits from SingleSpeciesTP class. EQ's parameterization is
31  * mapped onto the Shomate polynomial class.
32  *
33  * ## Specification of Species Standard State Properties
34  *
35  * This class inherits from SingleSpeciesTP. It is assumed that the reference
36  * state thermodynamics may be obtained by a pointer to a populated species
37  * thermodynamic property manager class (see ThermoPhase::m_spthermo). How to
38  * relate pressure changes to the reference state thermodynamics is resolved at
39  * this level.
40  *
41  * For an incompressible, stoichiometric substance, the molar internal energy is
42  * independent of pressure. Since the thermodynamic properties are specified by
43  * giving the standard-state enthalpy, the term \f$ P_0 \hat v\f$ is subtracted
44  * from the specified molar enthalpy to compute the molar internal energy. The
45  * entropy is assumed to be independent of the pressure.
46  *
47  * The enthalpy function is given by the following relation.
48  *
49  * \f[
50  * h^o_k(T,P) =
51  * h^{ref}_k(T) + \tilde v \left( P - P_{ref} \right)
52  * \f]
53  *
54  * For an incompressible, stoichiometric substance, the molar internal energy is
55  * independent of pressure. Since the thermodynamic properties are specified by
56  * giving the standard-state enthalpy, the term \f$ P_{ref} \tilde v\f$ is
57  * subtracted from the specified reference molar enthalpy to compute the molar
58  * internal energy.
59  *
60  * \f[
61  * u^o_k(T,P) = h^{ref}_k(T) - P_{ref} \tilde v
62  * \f]
63  *
64  * The standard state heat capacity and entropy are independent of pressure. The
65  * standard state Gibbs free energy is obtained from the enthalpy and entropy
66  * functions.
67  *
68  * ## Specification of Solution Thermodynamic Properties
69  *
70  * All solution properties are obtained from the standard state species
71  * functions, since there is only one species in the phase.
72  *
73  * ## %Application within Kinetics Managers
74  *
75  * The standard concentration is equal to 1.0. This means that the kinetics
76  * operator works on an (activities basis). Since this is a stoichiometric
77  * substance, this means that the concentration of this phase drops out of
78  * kinetics expressions.
79  *
80  * An example of a reaction using this is a sticking coefficient reaction of a
81  * substance in an ideal gas phase on a surface with a bulk phase species in
82  * this phase. In this case, the rate of progress for this reaction,
83  * \f$ R_s \f$, may be expressed via the following equation:
84  * \f[
85  * R_s = k_s C_{gas}
86  * \f]
87  * where the units for \f$ R_s \f$ are kmol m-2 s-1. \f$ C_{gas} \f$ has units
88  * of kmol m-3. Therefore, the kinetic rate constant, \f$ k_s \f$, has units of
89  * m s-1. Nowhere does the concentration of the bulk phase appear in the rate
90  * constant expression, since it's a stoichiometric phase and the activity is
91  * always equal to 1.0.
92  *
93  * @ingroup thermoprops
94  */
96 {
97 public:
98  //! Default constructor for the MineralEQ3 class
100 
101  //! Construct and initialize a MineralEQ3 ThermoPhase object
102  //! directly from an ASCII input file
103  /*!
104  * @param infile name of the input file
105  * @param id name of the phase id in the file.
106  * If this is blank, the first phase in the file is used.
107  */
108  MineralEQ3(const std::string& infile, const std::string& id = "");
109 
110  //! Construct and initialize a MineralEQ3 ThermoPhase object
111  //! directly from an XML database
112  /*!
113  * @param phaseRef XML node pointing to a MineralEQ3 description
114  * @param id Id of the phase.
115  */
116  MineralEQ3(XML_Node& phaseRef, const std::string& id = "");
117 
118  MineralEQ3(const MineralEQ3& right);
119  MineralEQ3& operator=(const MineralEQ3& right);
120  virtual ThermoPhase* duplMyselfAsThermoPhase() const;
121 
122  /**
123  * Equation of state flag.
124  *
125  * Returns the value cStoichSubstance, defined in mix_defs.h.
126  * @deprecated To be removed after Cantera 2.3.
127  */
128  virtual int eosType() const;
129  virtual std::string type() const {
130  return "MineralEQ3";
131  }
132 
133  //! @name Mechanical Equation of State
134  //! @{
135 
136  //! Report the Pressure. Units: Pa.
137  /*!
138  * For an incompressible substance, the density is independent of pressure.
139  * This method simply returns the stored pressure value.
140  */
141  virtual doublereal pressure() const;
142 
143  //! Set the pressure at constant temperature. Units: Pa.
144  /*!
145  * For an incompressible substance, the density is independent of pressure.
146  * Therefore, this method only stores the specified pressure value. It does
147  * not modify the density.
148  *
149  * @param p Pressure (units - Pa)
150  */
151  virtual void setPressure(doublereal p);
152 
153  virtual doublereal isothermalCompressibility() const;
154  virtual doublereal thermalExpansionCoeff() const;
155 
156  /**
157  * @}
158  * @name Activities, Standard States, and Activity Concentrations
159  *
160  * This section is largely handled by parent classes, since there is only
161  * one species. Therefore, the activity is equal to one.
162  * @{
163  */
164 
165  //! This method returns an array of generalized concentrations
166  /*!
167  * \f$ C^a_k\f$ are defined such that \f$ a_k = C^a_k / C^0_k, \f$ where
168  * \f$ C^0_k \f$ is a standard concentration defined below and \f$ a_k \f$
169  * are activities used in the thermodynamic functions. These activity (or
170  * generalized) concentrations are used by kinetics manager classes to
171  * compute the forward and reverse rates of elementary reactions.
172  *
173  * For a stoichiometric substance, there is only one species, and the
174  * generalized concentration is 1.0.
175  *
176  * @param c Output array of generalized concentrations. The units depend
177  * upon the implementation of the reaction rate expressions within
178  * the phase.
179  */
180  virtual void getActivityConcentrations(doublereal* c) const;
181 
182  //! Return the standard concentration for the kth species
183  /*!
184  * The standard concentration \f$ C^0_k \f$ used to normalize the activity
185  * (i.e., generalized) concentration. This phase assumes that the kinetics
186  * operator works on an dimensionless basis. Thus, the standard
187  * concentration is equal to 1.0.
188  *
189  * @param k Optional parameter indicating the species. The default
190  * is to assume this refers to species 0.
191  * @return
192  * Returns The standard Concentration as 1.0
193  */
194  virtual doublereal standardConcentration(size_t k=0) const;
195  virtual doublereal logStandardConc(size_t k=0) const;
196 
197  //! Get the array of chemical potentials at unit activity for the species at
198  //! their standard states at the current *T* and *P* of the solution.
199  /*!
200  * For a stoichiometric substance, there is no activity term in the chemical
201  * potential expression, and therefore the standard chemical potential and
202  * the chemical potential are both equal to the molar Gibbs function.
203  *
204  * These are the standard state chemical potentials \f$ \mu^0_k(T,P)
205  * \f$. The values are evaluated at the current
206  * temperature and pressure of the solution
207  *
208  * @param mu0 Output vector of chemical potentials.
209  * Length: m_kk.
210  */
211  virtual void getStandardChemPotentials(doublereal* mu0) const;
212 
213  //@}
214  /// @name Properties of the Standard State of the Species in the Solution
215  //@{
216 
217  virtual void getEnthalpy_RT(doublereal* hrt) const;
218  virtual void getEntropy_R(doublereal* sr) const;
219  virtual void getGibbs_RT(doublereal* grt) const;
220  virtual void getCp_R(doublereal* cpr) const;
221 
222  //! Returns the vector of nondimensional Internal Energies of the standard
223  //! state species at the current *T* and *P* of the solution
224  /*!
225  * For an incompressible, stoichiometric substance, the molar internal
226  * energy is independent of pressure. Since the thermodynamic properties are
227  * specified by giving the standard-state enthalpy, the term
228  * \f$ P_{ref} \hat v\f$ is subtracted from the specified reference molar
229  * enthalpy to compute the standard state molar internal energy.
230  *
231  * @param urt output vector of nondimensional standard state internal
232  * energies of the species. Length: m_kk.
233  */
234  virtual void getIntEnergy_RT(doublereal* urt) const;
235 
236  //@}
237  /// @name Thermodynamic Values for the Species Reference States
238  //@{
239 
240  virtual void getIntEnergy_RT_ref(doublereal* urt) const;
241  //! @}
242 
243  //! @copydoc ThermoPhase::initThermoXML
244  /*!
245  * This is the main routine for reading in activity coefficient parameters.
246  */
247  virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
248 
249  //! Set the equation of state parameters
250  /*!
251  * @internal
252  *
253  * @param n number of parameters
254  * @param c array of \a n coefficients
255  * c[0] = density of phase [ kg/m3 ]
256  */
257  virtual void setParameters(int n, doublereal* const c);
258 
259  //! Get the equation of state parameters in a vector
260  /*!
261  * @internal
262  *
263  * @param n number of parameters
264  * @param c array of \a n coefficients
265  *
266  * For this phase:
267  * - n = 1
268  * - c[0] = density of phase [ kg/m3 ]
269  */
270  virtual void getParameters(int& n, doublereal* const c) const;
271 
272  //! @copydoc ThermoPhase::setParametersFromXML
273  /*!
274  * For this phase, the density of the phase is specified in this block.
275  */
276  virtual void setParametersFromXML(const XML_Node& eosdata);
277  doublereal LookupGe(const std::string& elemName);
278  void convertDGFormation();
279 
280 protected:
281  //! Value of the Absolute Gibbs Free Energy NIST scale at T_r and P_r
282  /*!
283  * This is the NIST scale value of Gibbs free energy at T_r = 298.15
284  * and P_r = 1 atm.
285  *
286  * J kmol-1
287  */
288  doublereal m_Mu0_pr_tr;
289 
290  //! Input value of S_j at Tr and Pr (cal gmol-1 K-1)
291  /*!
292  * Tr = 298.15 Pr = 1 atm
293  */
294  doublereal m_Entrop_pr_tr;
295 
296  //! Input Value of deltaG of Formation at Tr and Pr (cal gmol-1)
297  /*!
298  * Tr = 298.15 Pr = 1 atm
299  *
300  * This is the delta G for the formation reaction of the ion from elements
301  * in their stable state at Tr, Pr.
302  */
304 
305  //! Input Value of deltaH of Formation at Tr and Pr (cal gmol-1)
306  /*!
307  * Tr = 298.15 Pr = 1 atm
308  *
309  * This is the delta H for the formation reaction of the ion from elements
310  * in their stable state at Tr, Pr.
311  */
313 
314  //! Input Value of the molar volume at T_r and P_r
315  /*!
316  * cm^3 / gmol
317  */
318  doublereal m_V0_pr_tr;
319 
320  //! a coefficient (cal gmol-1 K-1)
321  doublereal m_a;
322 
323  //! b coefficient (cal gmol-1 K-2) x 10^3
324  doublereal m_b;
325 
326  //! c coefficient (cal K gmol-1 K) x 10^-5
327  doublereal m_c;
328 };
329 
330 }
331 
332 #endif
doublereal m_Entrop_pr_tr
Input value of S_j at Tr and Pr (cal gmol-1 K-1)
Definition: MineralEQ3.h:294
doublereal m_deltaH_formation_pr_tr
Input Value of deltaH of Formation at Tr and Pr (cal gmol-1)
Definition: MineralEQ3.h:312
virtual doublereal pressure() const
Report the Pressure. Units: Pa.
Definition: MineralEQ3.cpp:74
virtual int eosType() const
Equation of state flag.
Definition: MineralEQ3.cpp:65
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Definition: MineralEQ3.cpp:126
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
Definition: MineralEQ3.cpp:106
virtual void getIntEnergy_RT_ref(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
Definition: MineralEQ3.cpp:151
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
Definition: MineralEQ3.cpp:96
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
virtual void getStandardChemPotentials(doublereal *mu0) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Definition: MineralEQ3.cpp:113
doublereal m_deltaG_formation_pr_tr
Input Value of deltaG of Formation at Tr and Pr (cal gmol-1)
Definition: MineralEQ3.h:303
virtual void setPressure(doublereal p)
Set the pressure at constant temperature. Units: Pa.
Definition: MineralEQ3.cpp:79
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
Definition: MineralEQ3.cpp:89
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
Definition: MineralEQ3.cpp:131
Class StoichSubstance represents a stoichiometric (fixed composition) incompressible substance...
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
Definition: MineralEQ3.cpp:143
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
doublereal m_c
c coefficient (cal K gmol-1 K) x 10^-5
Definition: MineralEQ3.h:327
MineralEQ3()
Default constructor for the MineralEQ3 class.
Definition: MineralEQ3.h:99
virtual void setParameters(int n, doublereal *const c)
Set the equation of state parameters.
Definition: MineralEQ3.cpp:159
doublereal m_a
a coefficient (cal gmol-1 K-1)
Definition: MineralEQ3.h:321
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
Definition: MineralEQ3.cpp:137
virtual std::string type() const
String indicating the thermodynamic model implemented.
Definition: MineralEQ3.h:129
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
Definition: MineralEQ3.cpp:119
virtual void getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
Definition: MineralEQ3.cpp:164
doublereal m_V0_pr_tr
Input Value of the molar volume at T_r and P_r.
Definition: MineralEQ3.h:318
doublereal m_b
b coefficient (cal gmol-1 K-2) x 10^3
Definition: MineralEQ3.h:324
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
Definition: MineralEQ3.cpp:222
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Definition: MineralEQ3.cpp:101
Header file for the StoichSubstance class, which represents a fixed-composition incompressible substa...
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine for objects which inherit from ThermoPhase.
Definition: MineralEQ3.cpp:58
Namespace for the Cantera kernel.
Definition: application.cpp:29
Class MineralEQ3 represents a stoichiometric (fixed composition) incompressible substance based on EQ...
Definition: MineralEQ3.h:95
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
Definition: MineralEQ3.cpp:84
doublereal m_Mu0_pr_tr
Value of the Absolute Gibbs Free Energy NIST scale at T_r and P_r.
Definition: MineralEQ3.h:288
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
Definition: MineralEQ3.cpp:170