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