air.hh 13.4 KB
 Andreas Lauser committed Jan 31, 2012 1 2 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // vi: set et ts=4 sw=4 sts=4:  Klaus Mosthaf committed Jan 19, 2012 3 /*****************************************************************************  Bernd Flemisch committed Aug 27, 2012 4  * See the file COPYING for full copying permissions. *  Klaus Mosthaf committed Jan 19, 2012 5 6 7 8 9 10 11 12  * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of *  Christoph Grueninger committed Sep 18, 2012 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *  Klaus Mosthaf committed Jan 19, 2012 14 15 16 17 18 19 20 21  * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * *****************************************************************************/ /*! * \file * \ingroup Components  Thomas Fetzer committed Sep 22, 2014 22  * \brief A simple class for the air fluid properties  Klaus Mosthaf committed Jan 19, 2012 23 24 25 26  */ #ifndef DUMUX_AIR_HH #define DUMUX_AIR_HH  Timo Koch committed Jun 29, 2016 27 #include  Klaus Mosthaf committed Jan 19, 2012 28 29 #include  Melanie Lipp committed Apr 10, 2018 30 31 #include #include  Timo Koch committed Feb 21, 2018 32 33 34 35  namespace Dumux { namespace Components {  Klaus Mosthaf committed Jan 19, 2012 36 37 /*! * \ingroup Components  Thomas Fetzer committed Sep 22, 2014 38  * \brief A class for the air fluid properties  Klaus Mosthaf committed Jan 19, 2012 39 40 41 42  * * \tparam Scalar The type used for scalar values */ template  Melanie Lipp committed Apr 10, 2018 43 44 45 class Air : public Components::Base > , public Components::Gas >  Klaus Mosthaf committed Jan 19, 2012 46 {  Bernd Flemisch committed Dec 16, 2017 47  using IdealGas = Dumux::IdealGas;  Klaus Mosthaf committed Jan 19, 2012 48 49 50  public: /*!  Christoph Grüninger committed Apr 20, 2016 51  * \brief A human readable name for Air.  Klaus Mosthaf committed Jan 19, 2012 52  */  Timo Koch committed Jan 30, 2017 53  static std::string name()  Klaus Mosthaf committed Jan 19, 2012 54 55 56  { return "Air"; } /*!  Christoph Grüninger committed Apr 20, 2016 57  * \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of Air.  Klaus Mosthaf committed Jan 19, 2012 58 59 60 61  * * Taken from constrelair.hh. */ static Scalar molarMass()  Andreas Lauser committed Jan 27, 2012 62  { return 0.02896; /* [kg/mol] */ }  Klaus Mosthaf committed Jan 19, 2012 63 64  /*!  Christoph Grüninger committed Apr 20, 2016 65  * \brief Returns the critical temperature \f$\mathrm{[K]}\f$ of Air.  Klaus Mosthaf committed Jan 19, 2012 66 67  */ static Scalar criticalTemperature()  Holger Class committed Mar 29, 2017 68  { return 132.6312; /* [K] */ }  Klaus Mosthaf committed Jan 19, 2012 69 70  /*!  Christoph Grüninger committed Apr 20, 2016 71  * \brief Returns the critical pressure \f$\mathrm{[Pa]}\f$ of Air.  Klaus Mosthaf committed Jan 19, 2012 72 73  */ static Scalar criticalPressure()  Andreas Lauser committed Jan 27, 2012 74  { return 37.86e5; /* [Pa] */ }  Andreas Lauser committed Feb 03, 2012 75   Klaus Mosthaf committed Jan 19, 2012 76  /*!  Thomas Fetzer committed Apr 20, 2016 77  * \brief The density \f$\mathrm{[kg/m^3]}\f$ of Air at a given pressure and temperature.  Christoph Grüninger committed Apr 20, 2016 78 79  * * Ideal gas is assumed.  Klaus Mosthaf committed Jan 19, 2012 80 81 82 83 84 85 86 87 88 89  * * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of phase in \f$\mathrm{[Pa]}\f$ */ static Scalar gasDensity(Scalar temperature, Scalar pressure) { // Assume an ideal gas return IdealGas::density(molarMass(), temperature, pressure); }  Katharina Heck committed Jul 04, 2018 90 91 92 93 94 95 96 97 98  /*! * \brief The molar density of air in \f$\mathrm{[mol/m^3]}\f$, * depending on pressure and temperature. * \param temperature The temperature of the gas * \param pressure The pressure of the gas */ static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) { return IdealGas::molarDensity(temperature, pressure); }  Andreas Lauser committed Jan 27, 2012 99  /*!  Christoph Grüninger committed Apr 20, 2016 100  * \brief Returns true, the gas phase is assumed to be compressible  Andreas Lauser committed Jan 27, 2012 101  */  Timo Koch committed Aug 07, 2018 102  static constexpr bool gasIsCompressible()  Andreas Lauser committed Jan 27, 2012 103  { return true; }  Klaus Mosthaf committed Jan 19, 2012 104   Andreas Lauser committed Jan 27, 2012 105  /*!  Christoph Grüninger committed Apr 20, 2016 106  * \brief Returns true, the gas phase is assumed to be ideal  Andreas Lauser committed Jan 27, 2012 107  */  Timo Koch committed Aug 07, 2018 108  static constexpr bool gasIsIdeal()  Andreas Lauser committed Jan 27, 2012 109  { return true; }  Klaus Mosthaf committed Jan 19, 2012 110 111  /*!  Thomas Fetzer committed Apr 20, 2016 112  * \brief The pressure \f$\mathrm{[Pa]}\f$ of gaseous Air at a given density and temperature.  Christoph Grüninger committed Apr 20, 2016 113 114  * * Ideal gas is assumed.  Klaus Mosthaf committed Jan 19, 2012 115 116 117 118 119 120 121 122 123  * * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param density density of component in \f$\mathrm{[kg/m^3]}\f$ */ static Scalar gasPressure(Scalar temperature, Scalar density) { // Assume an ideal gas return IdealGas::pressure(temperature, density/molarMass()); }  Holger Class committed Mar 29, 2017 124   Klaus Mosthaf committed Jan 19, 2012 125  /*!  Christoph Grüninger committed Apr 20, 2016 126  * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of Air at a given pressure and temperature.  Klaus Mosthaf committed Jan 19, 2012 127  *  Christoph Grüninger committed Apr 20, 2016 128  * Criticial specific volume calculated by \f$V_c = (R*T_c)/p_c\f$.  Klaus Mosthaf committed Jan 19, 2012 129  *  Kilian Weishaupt committed Nov 03, 2015 130 131  * Reid et al. (1987, pp 396-397, 667) \cite reid1987
 Klaus Mosthaf committed Jan 19, 2012 132  *  Kilian Weishaupt committed Nov 03, 2015 133  * Accentric factor taken from:
 Christoph Grüninger committed Apr 20, 2016 134  * Adebiyi (2003) \cite adebiyi2003  Klaus Mosthaf committed Jan 19, 2012 135  *  Holger Class committed Sep 27, 2016 136 137 138 139 140  * air is a non-polar substance, * thus dipole moment mu is zero, as well the dimensionless dipole moment mu_r * therefore not considered below * the same holds for the correction value kappa for highly polar substances *  Holger Class committed Mar 29, 2017 141 142 143 144  * This calculation was introduced into Dumux in 2012 although the method here * is designed for general polar substances. Air, however, is (a) non-polar, * and (b) there are more precise methods available *  Christoph Grüninger committed Apr 20, 2016 145 146  * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$  Klaus Mosthaf committed Jan 19, 2012 147  */  Holger Class committed Mar 29, 2017 148  static Scalar oldGasViscosity(Scalar temperature, Scalar pressure)  Klaus Mosthaf committed Jan 19, 2012 149 150 151 152 153 154  { const Scalar Tc = criticalTemperature(); const Scalar Vc = 84.525138; // critical specific volume [cm^3/mol] const Scalar omega = 0.078; // accentric factor const Scalar M = molarMass() * 1e3; // molar mas [g/mol]  Holger Class committed Mar 29, 2017 155 156 157 158 159 160 161 162 163 164 165 166  const Scalar Fc = 1.0 - 0.2756*omega; const Scalar Tstar = 1.2593*temperature/Tc; using std::exp; using std::pow; const Scalar Omega_v = 1.16145*pow(Tstar, -0.14874) + 0.52487*exp(-0.77320*Tstar) + 2.16178*exp(-2.43787*Tstar); using std::cbrt; using std::sqrt; const Scalar mu = 40.785 * Fc * sqrt(M * temperature)/(cbrt(Vc * Vc) * Omega_v);  Klaus Mosthaf committed Jan 19, 2012 167 168  // convertion from micro poise to Pa s  Holger Class committed Mar 29, 2017 169 170 171 172 173 174 175 176 177 178  return mu/1.0e6/10.0; } /*! * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of Air at a given pressure and temperature. * * Simple method, already implemented in MUFTE-UG, but pretty accurate. * * The pressure correction is even simpler and developed and tested by * Holger Class in 2016 against the results of the Lemmon and Jacobsen (2004)  Thomas Fetzer committed May 12, 2017 179  * approach \cite Lemmon2004a  Holger Class committed Mar 29, 2017 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196  * It shows very reasonable results throughout realistic pressure and * temperature ranges up to several hundred Kelvin and up to 500 bar * * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ static Scalar gasViscosity(Scalar temperature, Scalar pressure) { // above 1200 K, the function becomes inaccurate // since this should realistically never happen, we can live with it const Scalar tempCelsius = temperature - 273.15; const Scalar pressureCorrectionFactor = 9.7115e-9*tempCelsius*tempCelsius - 5.5e-6*tempCelsius + 0.0010809; using std::sqrt; const Scalar mu = 1.496e-6 * sqrt(temperature * temperature * temperature) / (temperature + 120.0) * (1.0 + (pressure/1.0e5 - 1.0)*pressureCorrectionFactor); return mu;  Klaus Mosthaf committed Jan 19, 2012 197 198  }  Holger Class committed Mar 29, 2017 199 200 201 202 203 204 205 206 207 208 209  /*! * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of Air at a given pressure and temperature. * * Simple method, already implemented in MUFTE-UG, but pretty accurate * at atmospheric pressures. * Gas viscosity is not very dependent on pressure. Thus, for * low pressures one might switch the pressure correction off * * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */  Klaus Mosthaf committed Jan 19, 2012 210 211  static Scalar simpleGasViscosity(Scalar temperature, Scalar pressure) {  Holger Class committed Mar 29, 2017 212 213 214 215 216 217 218 219 220  // above 1200 K, the function becomes inaccurate // since this should realistically never happen, we can live with it using std::sqrt; return 1.496e-6 * sqrt(temperature * temperature * temperature) / (temperature + 120.0); } /*! * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of Air at a given pressure and temperature. *  Thomas Fetzer committed May 12, 2017 221  * This is a very exact approach by Lemmon and Jacobsen (2004) \cite Lemmon2004a  Holger Class committed Mar 29, 2017 222 223 224 225 226 227 228 229 230 231 232  * All the values and parameters used below are explained in their paper * Since they use ''eta'' for dyn. viscosity, we do it as well for easier * comparison with the paper * * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ static Scalar exactGasViscosity(Scalar temperature, Scalar pressure) { const Scalar epsk = 103.3; // [K]  Dennis Gläser committed Apr 06, 2017 233 234 235  using std::log; using std::exp; using std::sqrt;  Holger Class committed Mar 29, 2017 236 237 238 239 240 241 242 243 244  const Scalar logTstar = log(temperature/epsk); const Scalar Omega = exp(0.431 - 0.4623*logTstar + 0.08406*logTstar*logTstar + 0.005341*logTstar*logTstar*logTstar - 0.00331*logTstar*logTstar*logTstar*logTstar); const Scalar sigma = 0.36; // [nm] const Scalar eta0 = 0.0266958*sqrt(1000.0*molarMass()*temperature)/(sigma*sigma*Omega);  Klaus Mosthaf committed Jan 19, 2012 245   Dennis Gläser committed Apr 06, 2017 246  using std::pow;  Holger Class committed Mar 29, 2017 247 248 249 250 251 252 253 254 255 256  const Scalar tau = criticalTemperature()/temperature; const Scalar rhoc = 10.4477; // [mol/m^3] const Scalar delta = 0.001*pressure/(temperature*8.3144598)/rhoc; const Scalar etaR = 10.72 * pow(tau, 0.2) * delta + 1.122 * pow(tau, 0.05) * pow(delta, 4) + 0.002019 * pow(tau, 2.4) * pow(delta, 9) - 8.876 * pow(tau, 0.6) * delta * exp(-delta) - 0.02916 * pow(tau, 3.6) * pow(delta, 8) * exp(-delta); return (eta0 + etaR)*1e-6;  Christoph Grueninger committed Jul 13, 2015 257  }  Klaus Mosthaf committed Jan 19, 2012 258 259  /*!  Thomas Fetzer committed Apr 20, 2016 260  * \brief Specific enthalpy of Air \f$\mathrm{[J/kg]}\f$  261  * with 273.15 \f$K \f$ as basis.  Klaus Mosthaf committed Jan 19, 2012 262 263 264  * * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$  Kilian Weishaupt committed Nov 03, 2015 265 266  * * Kays et al. (2005, 431ff) \cite kays2005
 Klaus Mosthaf committed Jan 19, 2012 267 268 269  */ static Scalar gasEnthalpy(Scalar temperature, Scalar pressure) {  270  return gasHeatCapacity(temperature, pressure) * (temperature-273.15);  Klaus Mosthaf committed Jan 19, 2012 271 272 273  } /*!  Christoph Grüninger committed Apr 20, 2016 274  * \brief Specific internal energy of Air \f$\mathrm{[J/kg]}\f$.  Klaus Mosthaf committed Jan 19, 2012 275  *  Andreas Lauser committed Jan 27, 2012 276 277  * Definition of enthalpy: \f$h= u + pv = u + p / \rho\f$. * Rearranging for internal energy yields: \f$u = h - pv\f$.  Andreas Lauser committed Jan 30, 2012 278  * Exploiting the Ideal Gas assumption  Kilian Weishaupt committed Nov 03, 2015 279  * (\f$pv = R_{\textnormal{specific}} T\f$) gives: \f$u = h - R / M T \f$.  Klaus Mosthaf committed Jan 19, 2012 280 281 282 283 284 285 286  * * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure) {  Holger Class committed Mar 29, 2017 287 288 289  return gasEnthalpy(temperature, pressure) - IdealGas::R * temperature // = pressure * molar volume for an ideal gas / molarMass(); // conversion from [J/(mol K)] to [J/(kg K)]  Klaus Mosthaf committed Jan 19, 2012 290 291  }  292  /*!  Simon Scholz committed Mar 11, 2015 293  * \brief Specific isobaric heat capacity \f$\mathrm{[J/(kg*K)]}\f$ of pure  294 295 296 297 298 299 300  * air. * * This methods uses the formula for "zero-pressure" heat capacity that * is only dependent on temperature, because the pressure dependence is rather small. * This one should be accurate for a pressure of 1 atm. * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$  Kilian Weishaupt committed Nov 03, 2015 301 302 303  * * Values taken from Hollis (1996) \cite hollis1996
* "Tables of Thermal Properties of Gases"  304 305 306 307  */ static const Scalar gasHeatCapacity(Scalar temperature, Scalar pressure) {  Simon Scholz committed Mar 11, 2015 308  // scale temperature with reference temp of 100K  309 310  Scalar phi = temperature/100;  Holger Class committed Mar 29, 2017 311  using std::pow;  312 313  Scalar c_p = 0.661738E+01 -0.105885E+01 * phi  Holger Class committed Mar 29, 2017 314 315 316 317 318 319 320 321 322 323 324  +0.201650E+00 * pow(phi,2) -0.196930E-01 * pow(phi,3) +0.106460E-02 * pow(phi,4) -0.303284E-04 * pow(phi,5) +0.355861E-06 * pow(phi,6); c_p += -0.549169E+01 * pow(phi,-1) +0.585171E+01 * pow(phi,-2) -0.372865E+01 * pow(phi,-3) +0.133981E+01 * pow(phi,-4) -0.233758E+00 * pow(phi,-5) +0.125718E-01 * pow(phi,-6);  Simon Scholz committed Nov 16, 2017 325  c_p *= IdealGas::R / molarMass(); // in J/(mol*K) / (kg/mol)  326 327 328  return c_p; }  Beatrix Becker committed Jul 02, 2015 329 330  /*!  Christoph Grueninger committed Jul 13, 2015 331  * \brief Thermal conductivity \f$\mathrm{[[W/(m*K)]}\f$ of air.  Thomas Fetzer committed Mar 10, 2016 332  *  Kilian Weishaupt committed Nov 03, 2015 333 334 335 336  * Isobaric Properties for Nitrogen in: NIST Standard \cite NIST
 Christoph Grueninger committed Jul 13, 2015 337  * lambda_air is approximately 0.78*lambda_N2+0.22*lambda_O2  Thomas Fetzer committed Mar 10, 2016 338 339 340  * * \param temperature absolute temperature in \f$\mathrm{[K]}\f$ * \param pressure of the phase in \f$\mathrm{[Pa]}\f$  Beatrix Becker committed Jul 02, 2015 341 342 343  */ static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure) {  Thomas Fetzer committed Mar 10, 2016 344  return 0.0255535;  Beatrix Becker committed Jul 02, 2015 345  }  Klaus Mosthaf committed Jan 19, 2012 346 347 };  Timo Koch committed Feb 21, 2018 348 349 350 } // end namespace Components } // end namespace Dumux  Klaus Mosthaf committed Jan 19, 2012 351 352  #endif