Cantera  2.3.0
WaterProps.h
Go to the documentation of this file.
1 /**
2  * @file WaterProps.h
3  * Header for a class used to house several approximation
4  * routines for properties of water.
5  * (see \ref thermoprops
6  * and class \link Cantera::WaterProps WaterProps\endlink).
7  */
8 
9 // This file is part of Cantera. See License.txt in the top-level directory or
10 // at http://www.cantera.org/license.txt for license and copyright information.
11 
12 #ifndef CT_WATERPROPS_H
13 #define CT_WATERPROPS_H
14 
15 
16 #include "cantera/base/ct_defs.h"
17 namespace Cantera
18 {
19 class WaterPropsIAPWS;
20 class PDSS_Water;
21 
22 /**
23  * @defgroup relatedProps Electric Properties of Phases
24  *
25  * ### Treatment of the %Phase Potential and the electrochemical potential of
26  * a species
27  *
28  * The electrochemical potential of species *k* in a phase *p*, \f$ \zeta_k \f$,
29  * is related to the chemical potential via the following equation,
30  *
31  * \f[
32  * \zeta_{k}(T,P) = \mu_{k}(T,P) + z_k \phi_p
33  * \f]
34  *
35  * where \f$ \nu_k \f$ is the charge of species *k*, and \f$ \phi_p \f$ is
36  * the electric potential of phase *p*.
37  *
38  * The potential \f$ \phi_p \f$ is tracked and internally stored within the
39  * base ThermoPhase object. It constitutes a specification of the internal state
40  * of the phase; it's the third state variable, the first two being temperature
41  * and density (or, pressure, for incompressible equations of state). It may be
42  * set with the function, ThermoPhase::setElectricPotential(), and may be
43  * queried with the function ThermoPhase::electricPotential().
44  *
45  * Note, the overall electrochemical potential of a phase may not be changed
46  * by the potential because many phases enforce charge neutrality:
47  *
48  * \f[
49  * 0 = \sum_k z_k X_k
50  * \f]
51  *
52  * Whether charge neutrality is necessary for a phase is also specified within
53  * the ThermoPhase object, by the function call
54  * ThermoPhase::chargeNeutralityNecessary(). Note, that it is not necessary for
55  * the IdealGas phase, currently. However, it is necessary for liquid phases
56  * such as DebyeHuckel and HMWSoln for the proper specification of the chemical
57  * potentials.
58  *
59  * This equation, when applied to the \f$ \zeta_k \f$ equation described
60  * above, results in a zero net change in the effective Gibbs free energy of
61  * the phase. However, specific charged species in the phase may increase or
62  * decrease their electrochemical potentials, which will have an effect on
63  * interfacial reactions involving charged species, when there is a potential
64  * drop between phases. This effect is used within the InterfaceKinetics and
65  * EdgeKinetics kinetics objects classes.
66  *
67  * ### Electrothermochemical Properties of Phases of Matter
68  *
69  * The following classes are used to compute the electrical and
70  * electrothermochemical properties of phases of matter. The main property
71  * currently is the dielectric constant, which is an important parameter for
72  * electrolyte solutions. The class WaterProps calculate the dielectric
73  * constant of water as a function of temperature and pressure.
74  *
75  * WaterProps also calculate the constant A_debye used in the Debye Huckel and
76  * Pitzer activity coefficient calculations.
77  *
78  * @ingroup phases
79  */
80 //@{
81 
82 //! The WaterProps class is used to house several approximation routines for
83 //! properties of water.
84 /*!
85  * The class is also a wrapper around the WaterPropsIAPWS class which provides
86  * the calculations for the equation of state properties for water.
87  *
88  * In particular, this class house routine for the calculation of the dielectric
89  * constant of water
90  *
91  * Most if not all of the member functions are static.
92  */
94 {
95 public:
96  //! Default constructor
97  WaterProps();
98 
99  //! Constructor
100  /*!
101  * @param wptr Pointer to WaterPropsIAPWS object
102  */
104 
105  //! Constructor with pointer to Water PDSS object
106  /*!
107  * @param wptr Pointer to water standard state object
108  */
109  WaterProps(PDSS_Water* wptr);
110 
111  WaterProps(const WaterProps& b);
112  virtual ~WaterProps();
113  WaterProps& operator=(const WaterProps& b);
114 
115  //! Simple calculation of water density at atmospheric pressure.
116  //! Valid up to boiling point.
117  /*!
118  * This formulation has no dependence on the pressure and shouldn't be used
119  * where accuracy is needed.
120  *
121  * @param T temperature in kelvin
122  * @param P Pressure in pascal
123  * @param ifunc changes what's returned
124  *
125  * @return value returned depends on ifunc value:
126  * - ifunc = 0 Returns the density in kg/m^3
127  * - ifunc = 1 returns the derivative of the density wrt T.
128  * - ifunc = 2 returns the 2nd derivative of the density wrt T
129  * - ifunc = 3 returns the derivative of the density wrt P.
130  *
131  * Verification:
132  * Agrees with the CRC values (6-10) for up to 4 sig digits.
133  *
134  * units = returns density in kg m-3.
135  */
136  static doublereal density_T(doublereal T, doublereal P, int ifunc);
137 
138  //! Bradley-Pitzer equation for the dielectric constant
139  //! of water as a function of temperature and pressure.
140  /*!
141  * Returns the dimensionless relative dielectric constant and its
142  * derivatives.
143  *
144  * Range of validity: 0 to 350C, 0 to 1 kbar pressure
145  *
146  * @param T temperature (kelvin)
147  * @param P_pascal pressure in pascal
148  * @param ifunc changes what's returned from the function
149  * @return Depends on the value of ifunc:
150  * - ifunc = 0 return value
151  * - ifunc = 1 return temperature derivative
152  * - ifunc = 2 return temperature second derivative
153  * - ifunc = 3 return pressure first derivative
154  *
155  * Validation: Numerical experiments indicate that this function agrees with
156  * the Archer and Wang data in the CRC p. 6-10 to all 4 significant digits
157  * shown (0 to 100C).
158  *
159  * value at 25C and 1 atm, relEps = 78.38
160  */
161  doublereal relEpsilon(doublereal T, doublereal P_pascal, int ifunc = 0);
162 
163  //! ADebye calculates the value of A_Debye as a function of temperature and
164  //! pressure according to relations that take into account the temperature
165  //! and pressure dependence of the water density and dielectric constant.
166  /*!
167  * The A_Debye expression appears on the top of the ln actCoeff term in the
168  * general Debye-Huckel expression It depends on temperature and pressure.
169  * And, therefore, most be recalculated whenever T or P changes. The units
170  * returned by this expression are sqrt(kg/gmol).
171  *
172  * \f[
173  * A_{Debye} = \frac{1}{8 \pi} \sqrt{\frac{2 N_{Avog} \rho_w}{1000}}
174  * {\left(\frac{e^2}{\epsilon k_{boltz} T}\right)}^{\frac{3}{2}}
175  * \f]
176  *
177  * Nominal value at 25C and 1atm = 1.172576 sqrt(kg/gmol).
178  *
179  * Based on:
180  * - epsilon/epsilon_0 = 78.54 (water at 25C)
181  * - T = 298.15 K
182  * - B_Debye = 3.28640E9 sqrt(kg/gmol)/m
183  *
184  * @param T Temperature (kelvin)
185  * @param P pressure (pascal)
186  * @param ifunc Changes what's returned from the routine
187  * @returns a double whose meaning depends on ifunc:
188  * - ifunc = 0 return value
189  * - ifunc = 1 return temperature derivative
190  * - ifunc = 2 return temperature second derivative
191  * - ifunc = 3 return pressure first derivative
192  *
193  * Verification: With the epsRelWater value from the Bradley-Pitzer
194  * relation, and the water density from the density_IAPWS() function, The
195  * A_Debye computed with this function agrees with the Pitzer table p. 99 to
196  * 4 significant digits at 25C. and 20C. (Aphi = ADebye/3)
197  */
198  doublereal ADebye(doublereal T, doublereal P, int ifunc);
199 
200  //! Returns the saturation pressure given the temperature
201  /*!
202  * @param T temperature (kelvin)
203  * @returns the saturation pressure (pascal)
204  */
205  doublereal satPressure(doublereal T);
206 
207  //! Returns the density of water
208  /*!
209  * This function sets the internal temperature and pressure
210  * of the underlying object at the same time.
211  *
212  * @param T Temperature (kelvin)
213  * @param P pressure (pascal)
214  */
215  doublereal density_IAPWS(doublereal T, doublereal P);
216 
217  //! Returns the density of water
218  /*!
219  * This function uses the internal state of the underlying water object
220  */
221  doublereal density_IAPWS() const;
222 
223  //! returns the coefficient of thermal expansion
224  /*!
225  * @param T Temperature (kelvin)
226  * @param P pressure (pascal)
227  */
228  doublereal coeffThermalExp_IAPWS(doublereal T, doublereal P);
229 
230  //! Returns the isothermal compressibility of water
231  /*!
232  * @param T temperature in kelvin
233  * @param P pressure in pascal
234  */
235  doublereal isothermalCompressibility_IAPWS(doublereal T, doublereal P);
236 
237  //! Returns the viscosity of water at the current conditions
238  //! (kg/m/s)
239  /*!
240  * This function calculates the value of the viscosity of pure water at the
241  * current T and P.
242  *
243  * The formulas used are from the paper: J. V. Sengers, J. T. R. Watson,
244  * "Improved International Formulations for the Viscosity and Thermal
245  * Conductivity of Water Substance", J. Phys. Chem. Ref. Data, 15, 1291
246  * (1986).
247  *
248  * The formulation is accurate for all temperatures and pressures, for steam
249  * and for water, even near the critical point. Pressures above 500 MPa and
250  * temperature above 900 C are suspect.
251  */
252  doublereal viscosityWater() const;
253 
254  //! Returns the thermal conductivity of water at the current conditions
255  //! (W/m/K)
256  /*!
257  * This function calculates the value of the thermal conductivity of
258  * water at the current T and P.
259  *
260  * The formulas used are from the paper: J. V. Sengers, J. T. R. Watson,
261  * "Improved International Formulations for the Viscosity and Thermal
262  * Conductivity of Water Substance", J. Phys. Chem. Ref. Data, 15, 1291
263  * (1986).
264  *
265  * The formulation is accurate for all temperatures and pressures, for steam
266  * and for water, even near the critical point. Pressures above 500 MPa and
267  * temperature above 900 C are suspect.
268  */
269  doublereal thermalConductivityWater() const;
270 
271 protected:
272  //! Pointer to the WaterPropsIAPWS object
274 
275  //! true if we own the WaterPropsIAPWS object
276  bool m_own_sub;
277 };
278 
279 //@}
280 }
281 
282 #endif
Class for calculating the equation of state of water.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
doublereal satPressure(doublereal T)
Returns the saturation pressure given the temperature.
Definition: WaterProps.cpp:258
doublereal isothermalCompressibility_IAPWS(doublereal T, doublereal P)
Returns the isothermal compressibility of water.
Definition: WaterProps.cpp:283
The WaterProps class is used to house several approximation routines for properties of water...
Definition: WaterProps.h:93
Class for the liquid water pressure dependent standard state.
Definition: PDSS_Water.h:49
WaterPropsIAPWS * m_waterIAPWS
Pointer to the WaterPropsIAPWS object.
Definition: WaterProps.h:273
doublereal density_IAPWS() const
Returns the density of water.
Definition: WaterProps.cpp:268
doublereal viscosityWater() const
Returns the viscosity of water at the current conditions (kg/m/s)
Definition: WaterProps.cpp:307
WaterProps()
Default constructor.
Definition: WaterProps.cpp:15
doublereal thermalConductivityWater() const
Returns the thermal conductivity of water at the current conditions (W/m/K)
Definition: WaterProps.cpp:357
doublereal ADebye(doublereal T, doublereal P, int ifunc)
ADebye calculates the value of A_Debye as a function of temperature and pressure according to relatio...
Definition: WaterProps.cpp:185
doublereal coeffThermalExp_IAPWS(doublereal T, doublereal P)
returns the coefficient of thermal expansion
Definition: WaterProps.cpp:273
doublereal relEpsilon(doublereal T, doublereal P_pascal, int ifunc=0)
Bradley-Pitzer equation for the dielectric constant of water as a function of temperature and pressur...
Definition: WaterProps.cpp:133
Namespace for the Cantera kernel.
Definition: application.cpp:29
static doublereal density_T(doublereal T, doublereal P, int ifunc)
Simple calculation of water density at atmospheric pressure.
Definition: WaterProps.cpp:85
bool m_own_sub
true if we own the WaterPropsIAPWS object
Definition: WaterProps.h:276