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