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 /** 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 * This is a helper class for WaterSSTP and PDSS_Water and does not constitute 87 * a complete implementation of a thermo phase by itself (see \ref thermoprops 88 * and classes \link Cantera::WaterSSTP WaterSSTP\endlink and 89 * \link Cantera::PDSS_Water PDSS_Water\endlink). 90 * 91 * The class is also a wrapper around the WaterPropsIAPWS class which provides 92 * the calculations for the equation of state properties for water. 93 * 94 * In particular, this class house routine for the calculation of the dielectric 95 * constant of water 96 * 97 * Most if not all of the member functions are static. 98 */ 99 class WaterProps 100 { 101 public: 102 //! Default constructor 103 WaterProps(); 104 105 //! Constructor 106 /*! 107 * @param wptr Pointer to WaterPropsIAPWS object 108 */ 109 WaterProps(WaterPropsIAPWS* wptr); 110 111 //! Constructor with pointer to Water PDSS object 112 /*! 113 * @param wptr Pointer to water standard state object 114 */ 115 WaterProps(PDSS_Water* wptr); 116 117 // WaterProps objects are not copyable or assignable 118 WaterProps(const WaterProps& b) = delete; 119 WaterProps& operator=(const WaterProps& b) = delete; 120 virtual ~WaterProps(); 121 122 //! Simple calculation of water density at atmospheric pressure. 123 //! Valid up to boiling point. 124 /*! 125 * This formulation has no dependence on the pressure and shouldn't be used 126 * where accuracy is needed. 127 * 128 * @param T temperature in kelvin 129 * @param P Pressure in pascal 130 * @param ifunc changes what's returned 131 * 132 * @return value returned depends on ifunc value: 133 * - ifunc = 0 Returns the density in kg/m^3 134 * - ifunc = 1 returns the derivative of the density wrt T. 135 * - ifunc = 2 returns the 2nd derivative of the density wrt T 136 * - ifunc = 3 returns the derivative of the density wrt P. 137 * 138 * Verification: 139 * Agrees with the CRC values (6-10) for up to 4 sig digits. 140 * 141 * units = returns density in kg m-3. 142 */ 143 static doublereal density_T(doublereal T, doublereal P, int ifunc); 144 145 //! Bradley-Pitzer equation for the dielectric constant 146 //! of water as a function of temperature and pressure. 147 /*! 148 * Returns the dimensionless relative dielectric constant and its 149 * derivatives. 150 * 151 * Range of validity: 0 to 350C, 0 to 1 kbar pressure 152 * 153 * @param T temperature (kelvin) 154 * @param P_pascal pressure in pascal 155 * @param ifunc changes what's returned from the function 156 * @return Depends on the value of ifunc: 157 * - ifunc = 0 return value 158 * - ifunc = 1 return temperature derivative 159 * - ifunc = 2 return temperature second derivative 160 * - ifunc = 3 return pressure first derivative 161 * 162 * Validation: Numerical experiments indicate that this function agrees with 163 * the Archer and Wang data in the CRC p. 6-10 to all 4 significant digits 164 * shown (0 to 100C). 165 * 166 * value at 25C and 1 atm, relEps = 78.38 167 */ 168 doublereal relEpsilon(doublereal T, doublereal P_pascal, int ifunc = 0); 169 170 //! ADebye calculates the value of A_Debye as a function of temperature and 171 //! pressure according to relations that take into account the temperature 172 //! and pressure dependence of the water density and dielectric constant. 173 /*! 174 * The A_Debye expression appears on the top of the ln actCoeff term in the 175 * general Debye-Huckel expression It depends on temperature and pressure. 176 * And, therefore, most be recalculated whenever T or P changes. The units 177 * returned by this expression are sqrt(kg/gmol). 178 * 179 * \f[ 180 * A_{Debye} = \frac{1}{8 \pi} \sqrt{\frac{2 N_{Avog} \rho_w}{1000}} 181 * {\left(\frac{e^2}{\epsilon k_{boltz} T}\right)}^{\frac{3}{2}} 182 * \f] 183 * 184 * Nominal value at 25C and 1atm = 1.172576 sqrt(kg/gmol). 185 * 186 * Based on: 187 * - epsilon/epsilon_0 = 78.54 (water at 25C) 188 * - T = 298.15 K 189 * - B_Debye = 3.28640E9 sqrt(kg/gmol)/m 190 * 191 * @param T Temperature (kelvin) 192 * @param P pressure (pascal) 193 * @param ifunc Changes what's returned from the routine 194 * @returns a double whose meaning depends on ifunc: 195 * - ifunc = 0 return value 196 * - ifunc = 1 return temperature derivative 197 * - ifunc = 2 return temperature second derivative 198 * - ifunc = 3 return pressure first derivative 199 * 200 * Verification: With the epsRelWater value from the Bradley-Pitzer 201 * relation, and the water density from the density_IAPWS() function, The 202 * A_Debye computed with this function agrees with the Pitzer table p. 99 to 203 * 4 significant digits at 25C. and 20C. (Aphi = ADebye/3) 204 */ 205 doublereal ADebye(doublereal T, doublereal P, int ifunc); 206 207 //! Returns the saturation pressure given the temperature 208 /*! 209 * @param T temperature (kelvin) 210 * @returns the saturation pressure (pascal) 211 */ 212 doublereal satPressure(doublereal T); 213 214 //! Returns the density of water 215 /*! 216 * This function sets the internal temperature and pressure 217 * of the underlying object at the same time. 218 * 219 * @param T Temperature (kelvin) 220 * @param P pressure (pascal) 221 */ 222 doublereal density_IAPWS(doublereal T, doublereal P); 223 224 //! Returns the density of water 225 /*! 226 * This function uses the internal state of the underlying water object 227 */ 228 doublereal density_IAPWS() const; 229 230 //! returns the coefficient of thermal expansion 231 /*! 232 * @param T Temperature (kelvin) 233 * @param P pressure (pascal) 234 */ 235 doublereal coeffThermalExp_IAPWS(doublereal T, doublereal P); 236 237 //! Returns the isothermal compressibility of water 238 /*! 239 * @param T temperature in kelvin 240 * @param P pressure in pascal 241 */ 242 doublereal isothermalCompressibility_IAPWS(doublereal T, doublereal P); 243 244 protected: 245 //! Pointer to the WaterPropsIAPWS object 246 WaterPropsIAPWS* m_waterIAPWS; 247 248 //! true if we own the WaterPropsIAPWS object 249 bool m_own_sub; 250 }; 251 252 //@} 253 } 254 255 #endif 256