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