00001 /** 00002 * @file WaterProps.h 00003 * Header for a class used to house several approximation 00004 * routines for properties of water. 00005 * (see \ref thermoprops 00006 * and class \link Cantera::WaterProps WaterProps\endlink). 00007 */ 00008 /* 00009 * Copywrite (2006) Sandia Corporation. Under the terms of 00010 * Contract DE-AC04-94AL85000 with Sandia Corporation, the 00011 * U.S. Government retains certain rights in this software. 00012 */ 00013 /* 00014 * $Id: WaterProps.h 387 2010-01-17 18:17:55Z hkmoffa $ 00015 */ 00016 00017 #ifndef CT_WATERPROPS_H 00018 #define CT_WATERPROPS_H 00019 00020 00021 #include "ct_defs.h" 00022 namespace Cantera { 00023 class WaterPropsIAPWS; 00024 class PDSS_Water; 00025 00026 /** 00027 * @defgroup relatedProps Electric Properties of Phases 00028 * 00029 * 00030 * <H3> 00031 * Treatment of the %Phase Potential and the electrochemical potential of a species 00032 * </H3> 00033 * 00034 * 00035 * The electrochemical potential of species <I>k</I> in a phase <I>p</I>, \f$ \zeta_k \f$, 00036 * is related to the chemical potential via 00037 * the following equation, 00038 * 00039 * \f[ 00040 * \zeta_{k}(T,P) = \mu_{k}(T,P) + z_k \phi_p 00041 * \f] 00042 * 00043 * where \f$ \nu_k \f$ is the charge of species <I>k</I>, and \f$ \phi_p \f$ is 00044 * the electric potential of phase <I>p</I>. 00045 * 00046 * The potential \f$ \phi_p \f$ is tracked and internally storred within 00047 * the base %ThermoPhase object. It constitutes a specification of the 00048 * internal state of the phase; it's the third state variable, the first 00049 * two being temperature and density (or, pressure, for incompressible 00050 * equations of state). It may be set with the function, 00051 * ThermoPhase::setElectricPotential(), 00052 * and may be queried with the function ThermoPhase::electricPotential(). 00053 * 00054 * Note, the overall electrochemical potential of a phase may not be 00055 * changed by the potential because many phases enforce charge 00056 * neutrality: 00057 * 00058 * \f[ 00059 * 0 = \sum_k z_k X_k 00060 * \f] 00061 * 00062 * Whether charge neutrality is necessary for a phase is also specified 00063 * within the ThermoPhase object, by the function call 00064 * ThermoPhase::chargeNeutralityNecessary(). Note, that it is not 00065 * necessary for the IdealGas phase, currently. However, it is 00066 * necessary for liquid phases such as Cantera::DebyeHuckel and 00067 * Cantera::HMWSoln for the proper specification of the chemical potentials. 00068 * 00069 * 00070 * This equation, when applied to the \f$ \zeta_k \f$ equation described 00071 * above, results in a zero net change in the effective Gibbs free 00072 * energy of the phase. However, specific charged species in the phase 00073 * may increase or decrease their electochemical potentials, which will 00074 * have an effect on interfacial reactions involving charged species, 00075 * when there is a potential drop between phases. This effect is used 00076 * within the Cantera::InterfaceKinetics and Cantera::EdgeKinetics kinetics 00077 * objects classes. 00078 * 00079 * 00080 * <H3> 00081 * Electrothermochemical Properties of Phases of Matter. 00082 * </H3> 00083 * 00084 * The following classes are used to compute the electrical and electrothermochemical properties of 00085 * phases of matter. The main property currently is the dielectric 00086 * constant, which is an important parameter for electolyte solutions. 00087 * The class WaterProps calculate the dielectric constant of water as a function of 00088 * temperature and pressure. 00089 * 00090 * WaterProps also calculate the constant A_debye used in the Debye Huckel 00091 * and Pitzer activity coefficient calculations. 00092 * 00093 * 00094 * @ingroup phases 00095 */ 00096 //@{ 00097 00098 00099 //! The WaterProps class is used to 00100 //! house several approximation routines for properties of water. 00101 /*! 00102 * The class is also a wrapper around the WaterPropsIAPWS class 00103 * which provides the calculations for the equation of 00104 * state properties for water. 00105 * 00106 * In particular, this class house routine for the calculation 00107 * of the dielectric constant of water 00108 * 00109 * Most if not all of the member functions are static. 00110 */ 00111 class WaterProps { 00112 00113 public: 00114 00115 //! Default constructor 00116 WaterProps(); 00117 00118 //! Constructor with pointer to Water PDSS object 00119 /*! 00120 * @param wptr Pointer to WaterPropsIAPWS object 00121 */ 00122 WaterProps(WaterPropsIAPWS *wptr); 00123 00124 //! Constructor with pointer to Water PDSS object 00125 /*! 00126 * @param wptr Pointer to water standard state object 00127 */ 00128 WaterProps(PDSS_Water *wptr); 00129 00130 //! Copy Constructor 00131 /*! 00132 * @param b Object to be copied 00133 */ 00134 WaterProps(const WaterProps &b); 00135 00136 //! destructor 00137 virtual ~WaterProps(); 00138 00139 //! Assignment operator 00140 /*! 00141 * @param b Object to be copied 00142 */ 00143 WaterProps& operator=(const WaterProps& b); 00144 00145 00146 //! Simple calculation of water density at atmospheric pressure. 00147 //! Valid up to boiling point. 00148 /*! 00149 * static function. 00150 * This formulation has no dependence on the pressure and shouldn't 00151 * be used where accuracy is needed. 00152 * 00153 * @param T temperature in kelvin 00154 * @param P Pressure in pascal 00155 * @param ifunc changes what's returned 00156 * 00157 * @return value returned depends on ifunc value: 00158 * ifunc = 0 Returns the density in kg/m^3 00159 * ifunc = 1 returns the derivative of the density wrt T. 00160 * ifunc = 2 returns the 2nd derivative of the density wrt T 00161 * ifunc = 3 returns the derivative of the density wrt P. 00162 * 00163 * Verification: 00164 * Agrees with the CRC values (6-10) for up to 4 sig digits. 00165 * 00166 * units = returns density in kg m-3. 00167 */ 00168 static doublereal density_T(doublereal T, doublereal P, int ifunc); 00169 00170 00171 //! Bradley-Pitzer equation for the dielectric constant 00172 //! of water as a function of temperature and pressure. 00173 /*! 00174 * Returns the dimensionless relative dielectric constant 00175 * and its derivatives. 00176 * 00177 * 00178 * Range of validity: 0 to 350C, 0 to 1 kbar pressure 00179 * 00180 * @param T temperature (kelvin) 00181 * @param P_pascal pressure in pascal 00182 * @param ifunc changes what's returned from the function 00183 * - ifunc = 0 return value 00184 * - ifunc = 1 return temperature derivative 00185 * - ifunc = 2 return temperature second derivative 00186 * - ifunc = 3 return pressure first derivative 00187 * . 00188 * 00189 * @return Depends on the value of ifunc: 00190 * - ifunc = 0 return value 00191 * - ifunc = 1 return temperature derivative 00192 * - ifunc = 2 return temperature second derivative 00193 * - ifunc = 3 return pressure first derivative 00194 * . 00195 * 00196 * Validation: 00197 * Numerical experiments indicate that this function agrees with 00198 * the Archer and Wang data in the CRC p. 6-10 to all 4 significant 00199 * digits shown (0 to 100C). 00200 * 00201 * value at 25C and 1 atm, relEps = 78.38 00202 * 00203 */ 00204 doublereal relEpsilon(doublereal T, doublereal P_pascal, int ifunc = 0); 00205 00206 00207 //! ADebye calculates the value of A_Debye as a function 00208 //! of temperature and pressure according to relations 00209 //! that take into account the temperature and pressure 00210 //! dependence of the water density and dieletric constant. 00211 /*! 00212 * The A_Debye expression appears on the top of the 00213 * ln actCoeff term in the general Debye-Huckel expression 00214 * It depends on temperature and pressure. And, therefore, 00215 * most be recalculated whenever T or P changes. 00216 * The units returned by this expression are sqrt(kg/gmol). 00217 * 00218 * 00219 * \f[ 00220 * A_{Debye} = \frac{1}{8 \pi} \sqrt{\frac{2 N_{Avog} \rho_w}{1000}} 00221 * {\left(\frac{e^2}{\epsilon k_{boltz} T}\right)}^{\frac{3}{2}} 00222 * \f] 00223 * 00224 * 00225 * Nominal value at 25C and 1atm = 1.172576 sqrt(kg/gmol). 00226 * 00227 * Based on: 00228 * epsilon/epsilon_0 = 78.54 00229 * (water at 25C) 00230 * epsilon_0 = 8.854187817E-12 C2 N-1 m-2 00231 * e = 1.60217653E-19 C 00232 * F = 9.6485309E7 C kmol-1 00233 * R = 8.314472E3 kg m2 s-2 kmol-1 K-1 00234 * T = 298.15 K 00235 * B_Debye = 3.28640E9 sqrt(kg/gmol)/m 00236 * Na = 6.0221415E26 00237 * 00238 * @param T Temperature (kelvin) 00239 * @param P pressure (pascal) 00240 * @param ifunc Changes what's returned from the routine: 00241 * - ifunc = 0 return value 00242 * - ifunc = 1 return temperature derivative 00243 * - ifunc = 2 return temperature second derivative 00244 * - ifunc = 3 return pressure first derivative 00245 * . 00246 * 00247 * @return Returns a single doublereal whose meaning depends on ifunc: 00248 * - ifunc = 0 return value 00249 * - ifunc = 1 return temperature derivative 00250 * - ifunc = 2 return temperature second derivative 00251 * - ifunc = 3 return pressure first derivative 00252 * . 00253 * 00254 * Verification: 00255 * 00256 * With the epsRelWater value from the Bradley-Pitzer relation, 00257 * and the water density from the density_IAPWS() function, 00258 * The A_Debye computed with this function agrees with 00259 * the Pitzer table p. 99 to 4 significant digits at 25C. 00260 * and 20C. (Aphi = ADebye/3) 00261 */ 00262 doublereal ADebye(doublereal T, doublereal P, int ifunc); 00263 00264 00265 //! Returns the saturation pressure given the temperature 00266 /*! 00267 * @param T temperature (kelvin) 00268 * @return returns the saturation pressure (pascal) 00269 */ 00270 doublereal satPressure(doublereal T); 00271 00272 00273 //! Returns the density of water 00274 /*! 00275 * This function sets the internal temperature and pressure 00276 * of the underlying object at the same time. 00277 * 00278 * @param T Temperature (kelvin) 00279 * @param P pressure (pascal) 00280 */ 00281 doublereal density_IAPWS(doublereal T, doublereal P); 00282 00283 //! Returns the density of water 00284 /*! 00285 * This function uses the internal state of the 00286 * underlying water object 00287 */ 00288 doublereal density_IAPWS() const; 00289 00290 00291 //! returns the coefficient of thermal expansion 00292 /*! 00293 * @param T Temperature (kelvin) 00294 * @param P pressure (pascal) 00295 */ 00296 doublereal coeffThermalExp_IAPWS(doublereal T, doublereal P); 00297 00298 //! Returns the isothermal compressibility of water 00299 /*! 00300 * @param T temperature in kelvin 00301 * @param P pressure in pascal 00302 */ 00303 doublereal isothermalCompressibility_IAPWS(doublereal T, doublereal P); 00304 00305 //! Returns the viscosity of water at the current conditions 00306 //! (kg/m/s) 00307 /*! 00308 * This function calculates the value of the viscosity of pure 00309 * water at the current T and P. 00310 * 00311 * The formulas used are from the paper 00312 * J. V. Sengers, J. T. R. Watson, "Improved International 00313 * Formulations for the Viscosity and Thermal Conductivity of 00314 * Water Substance", J. Phys. Chem. Ref. Data, 15, 1291 (1986). 00315 * 00316 * The formulation is accurate for all temperatures and pressures, 00317 * for steam and for water, even near the critical point. 00318 * Pressures above 500 MPa and temperature above 900 C are suspect. 00319 */ 00320 doublereal viscosityWater() const; 00321 00322 //! Returns the thermal conductivity of water at the current conditions 00323 //! (W/m/K) 00324 /*! 00325 * This function calculates the value of the thermal conductivity of 00326 * water at the current T and P. 00327 * 00328 * The formulas used are from the paper 00329 * J. V. Sengers, J. T. R. Watson, "Improved International 00330 * Formulations for the Viscosity and Thermal Conductivity of 00331 * Water Substance", J. Phys. Chem. Ref. Data, 15, 1291 (1986). 00332 * 00333 * The formulation is accurate for all temperatures and pressures, 00334 * for steam and for water, even near the critical point. 00335 * Pressures above 500 MPa and temperature above 900 C are suspect. 00336 */ 00337 doublereal thermalConductivityWater() const; 00338 00339 00340 00341 00342 00343 protected: 00344 00345 //! Pointer to the WaterPropsIAPWS object 00346 /*! 00347 * this pointer points to the water object. 00348 */ 00349 WaterPropsIAPWS *m_waterIAPWS; 00350 00351 //! true if we own the WaterPropsIAPWS object 00352 bool m_own_sub; 00353 }; 00354 00355 //@} 00356 } 00357 00358 00359 #endif