Cantera  3.1.0a1
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 https://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 //! The WaterProps class is used to house several approximation routines for
23 //! properties of water.
24 /*!
25  * This is a helper class for WaterSSTP and PDSS_Water and does not constitute
26  * a complete implementation of a thermo phase by itself (see @ref thermoprops
27  * and classes @link Cantera::WaterSSTP WaterSSTP@endlink and
28  * @link Cantera::PDSS_Water PDSS_Water@endlink).
29  *
30  * The class is also a wrapper around the WaterPropsIAPWS class which provides
31  * the calculations for the equation of state properties for water.
32  *
33  * In particular, this class houses methods for the calculation of the dielectric
34  * constant of water and the constant A_debye used in the Debye-Huckel and
35  * Pitzer activity coefficient calculations.
36  */
38 {
39 public:
40  //! Default constructor
41  WaterProps();
42 
43  //! Constructor
44  /*!
45  * @param wptr Pointer to WaterPropsIAPWS object
46  */
48 
49  //! Constructor with pointer to Water PDSS object
50  /*!
51  * @param wptr Pointer to water standard state object
52  */
53  WaterProps(PDSS_Water* wptr);
54 
55  // WaterProps objects are not copyable or assignable
56  WaterProps(const WaterProps& b) = delete;
57  WaterProps& operator=(const WaterProps& b) = delete;
58  virtual ~WaterProps();
59 
60  //! Simple calculation of water density at atmospheric pressure.
61  //! Valid up to boiling point.
62  /*!
63  * This formulation has no dependence on the pressure and shouldn't be used
64  * where accuracy is needed.
65  *
66  * @param T temperature in kelvin
67  * @param P Pressure in pascal
68  * @param ifunc changes what's returned
69  *
70  * @return value returned depends on ifunc value:
71  * - ifunc = 0 Returns the density in kg/m^3
72  * - ifunc = 1 returns the derivative of the density wrt T.
73  * - ifunc = 2 returns the 2nd derivative of the density wrt T
74  * - ifunc = 3 returns the derivative of the density wrt P.
75  *
76  * Verification:
77  * Agrees with the CRC values (6-10) for up to 4 sig digits.
78  *
79  * units = returns density in kg m-3.
80  */
81  static double density_T(double T, double P, int ifunc);
82 
83  //! Bradley-Pitzer equation for the dielectric constant
84  //! of water as a function of temperature and pressure.
85  /*!
86  * Returns the dimensionless relative dielectric constant and its
87  * derivatives.
88  *
89  * Range of validity: 0 to 350C, 0 to 1 kbar pressure
90  *
91  * @param T temperature (kelvin)
92  * @param P_pascal pressure in pascal
93  * @param ifunc changes what's returned from the function
94  * @return Depends on the value of ifunc:
95  * - ifunc = 0 return value
96  * - ifunc = 1 return temperature derivative
97  * - ifunc = 2 return temperature second derivative
98  * - ifunc = 3 return pressure first derivative
99  *
100  * Validation: Numerical experiments indicate that this function agrees with
101  * the Archer and Wang data in the CRC p. 6-10 to all 4 significant digits
102  * shown (0 to 100C).
103  *
104  * value at 25C and 1 atm, relEps = 78.38
105  */
106  double relEpsilon(double T, double P_pascal, int ifunc = 0);
107 
108  //! ADebye calculates the value of A_Debye as a function of temperature and
109  //! pressure according to relations that take into account the temperature
110  //! and pressure dependence of the water density and dielectric constant.
111  /*!
112  * The A_Debye expression appears on the top of the ln actCoeff term in the
113  * general Debye-Huckel expression It depends on temperature and pressure.
114  * And, therefore, most be recalculated whenever T or P changes. The units
115  * returned by this expression are sqrt(kg/gmol).
116  *
117  * @f[
118  * A_{Debye} = \frac{1}{8 \pi} \sqrt{\frac{2 N_{Avog} \rho_w}{1000}}
119  * {\left(\frac{e^2}{\epsilon k_{boltz} T}\right)}^{\frac{3}{2}}
120  * @f]
121  *
122  * Nominal value at 25C and 1atm = 1.172576 sqrt(kg/gmol).
123  *
124  * Based on:
125  * - epsilon/epsilon_0 = 78.54 (water at 25C)
126  * - T = 298.15 K
127  * - B_Debye = 3.28640E9 sqrt(kg/gmol)/m
128  *
129  * @param T Temperature (kelvin)
130  * @param P pressure (pascal)
131  * @param ifunc Changes what's returned from the routine
132  * @returns a double whose meaning depends on ifunc:
133  * - ifunc = 0 return value
134  * - ifunc = 1 return temperature derivative
135  * - ifunc = 2 return temperature second derivative
136  * - ifunc = 3 return pressure first derivative
137  *
138  * Verification: With the epsRelWater value from the Bradley-Pitzer
139  * relation, and the water density from the density_IAPWS() function, The
140  * A_Debye computed with this function agrees with the Pitzer table p. 99 to
141  * 4 significant digits at 25C. and 20C. (Aphi = ADebye/3)
142  */
143  double ADebye(double T, double P, int ifunc);
144 
145  //! Returns the saturation pressure given the temperature
146  /*!
147  * @param T temperature (kelvin)
148  * @returns the saturation pressure (pascal)
149  */
150  double satPressure(double T);
151 
152  //! Returns the density of water
153  /*!
154  * This function sets the internal temperature and pressure
155  * of the underlying object at the same time.
156  *
157  * @param T Temperature (kelvin)
158  * @param P pressure (pascal)
159  */
160  double density_IAPWS(double T, double P);
161 
162  //! Returns the density of water
163  /*!
164  * This function uses the internal state of the underlying water object
165  */
166  double density_IAPWS() const;
167 
168  //! returns the coefficient of thermal expansion
169  /*!
170  * @param T Temperature (kelvin)
171  * @param P pressure (pascal)
172  */
173  double coeffThermalExp_IAPWS(double T, double P);
174 
175  //! Returns the isothermal compressibility of water
176  /*!
177  * @param T temperature in kelvin
178  * @param P pressure in pascal
179  */
180  double isothermalCompressibility_IAPWS(double T, double P);
181 
182 protected:
183  //! Pointer to the WaterPropsIAPWS object
185 
186  //! true if we own the WaterPropsIAPWS object
187  bool m_own_sub = false;
188 };
189 
190 }
191 
192 #endif
Class for the liquid water pressure dependent standard state.
Definition: PDSS_Water.h:50
Class for calculating the equation of state of water.
The WaterProps class is used to house several approximation routines for properties of water.
Definition: WaterProps.h:38
double satPressure(double T)
Returns the saturation pressure given the temperature.
Definition: WaterProps.cpp:220
double isothermalCompressibility_IAPWS(double T, double P)
Returns the isothermal compressibility of water.
Definition: WaterProps.cpp:245
WaterPropsIAPWS * m_waterIAPWS
Pointer to the WaterPropsIAPWS object.
Definition: WaterProps.h:184
double relEpsilon(double T, double P_pascal, int ifunc=0)
Bradley-Pitzer equation for the dielectric constant of water as a function of temperature and pressur...
Definition: WaterProps.cpp:96
double density_IAPWS() const
Returns the density of water.
Definition: WaterProps.cpp:230
static double density_T(double T, double P, int ifunc)
Simple calculation of water density at atmospheric pressure.
Definition: WaterProps.cpp:48
WaterProps()
Default constructor.
Definition: WaterProps.cpp:14
double coeffThermalExp_IAPWS(double T, double P)
returns the coefficient of thermal expansion
Definition: WaterProps.cpp:235
double ADebye(double T, double P, int ifunc)
ADebye calculates the value of A_Debye as a function of temperature and pressure according to relatio...
Definition: WaterProps.cpp:147
bool m_own_sub
true if we own the WaterPropsIAPWS object
Definition: WaterProps.h:187
This file contains definitions of constants, types and terms that are used in internal routines and a...
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:564