air.hh 13.4 KB
Newer Older
Andreas Lauser's avatar
Andreas Lauser committed
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's avatar
Klaus Mosthaf committed
3
/*****************************************************************************
4
 *   See the file COPYING for full copying permissions.                      *
Klaus Mosthaf's avatar
Klaus Mosthaf committed
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          *
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
Klaus Mosthaf's avatar
Klaus Mosthaf committed
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 <http://www.gnu.org/licenses/>.   *
 *****************************************************************************/
/*!
 * \file
 * \ingroup Components
Thomas Fetzer's avatar
Thomas Fetzer committed
22
 * \brief A simple class for the air fluid properties
Klaus Mosthaf's avatar
Klaus Mosthaf committed
23
24
25
26
 */
#ifndef DUMUX_AIR_HH
#define DUMUX_AIR_HH

27
#include <dumux/common/exceptions.hh>
Klaus Mosthaf's avatar
Klaus Mosthaf committed
28
29
#include <dumux/material/idealgas.hh>

30
31
#include <dumux/material/components/base.hh>
#include <dumux/material/components/gas.hh>
32
33
34
35

namespace Dumux {
namespace Components {

Klaus Mosthaf's avatar
Klaus Mosthaf committed
36
37
/*!
 * \ingroup Components
Thomas Fetzer's avatar
Thomas Fetzer committed
38
 * \brief A class for the air fluid properties
Klaus Mosthaf's avatar
Klaus Mosthaf committed
39
40
41
42
 *
 * \tparam Scalar The type used for scalar values
 */
template <class Scalar>
43
44
45
class Air
: public Components::Base<Scalar, Air<Scalar> >
, public Components::Gas<Scalar, Air<Scalar> >
Klaus Mosthaf's avatar
Klaus Mosthaf committed
46
{
47
    using IdealGas = Dumux::IdealGas<Scalar>;
Klaus Mosthaf's avatar
Klaus Mosthaf committed
48
49
50

public:
    /*!
51
     * \brief A human readable name for Air.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
52
     */
53
    static std::string name()
Klaus Mosthaf's avatar
Klaus Mosthaf committed
54
55
56
    { return "Air"; }

    /*!
57
     * \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of Air.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
58
59
60
61
     *
     * Taken from constrelair.hh.
     */
    static Scalar molarMass()
62
    { return 0.02896; /* [kg/mol] */ }
Klaus Mosthaf's avatar
Klaus Mosthaf committed
63
64

    /*!
65
     * \brief Returns the critical temperature \f$\mathrm{[K]}\f$ of Air.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
66
67
     */
    static Scalar criticalTemperature()
68
    { return 132.6312; /* [K] */ }
Klaus Mosthaf's avatar
Klaus Mosthaf committed
69
70

    /*!
71
     * \brief Returns the critical pressure \f$\mathrm{[Pa]}\f$ of Air.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
72
73
     */
    static Scalar criticalPressure()
74
    { return 37.86e5; /* [Pa] */ }
Andreas Lauser's avatar
Andreas Lauser committed
75

Klaus Mosthaf's avatar
Klaus Mosthaf committed
76
    /*!
77
     * \brief The density \f$\mathrm{[kg/m^3]}\f$ of Air at a given pressure and temperature.
78
79
     *
     * Ideal gas is assumed.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
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);
    }

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); }

99
    /*!
100
     * \brief Returns true, the gas phase is assumed to be compressible
101
     */
102
    static constexpr bool gasIsCompressible()
103
    { return true; }
Klaus Mosthaf's avatar
Klaus Mosthaf committed
104

105
    /*!
106
     * \brief Returns true, the gas phase is assumed to be ideal
107
     */
108
    static constexpr bool gasIsIdeal()
109
    { return true; }
Klaus Mosthaf's avatar
Klaus Mosthaf committed
110
111

    /*!
112
     * \brief The pressure \f$\mathrm{[Pa]}\f$ of gaseous Air at a given density and temperature.
113
114
     *
     * Ideal gas is assumed.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
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());
    }
124

Klaus Mosthaf's avatar
Klaus Mosthaf committed
125
    /*!
126
     * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of Air at a given pressure and temperature.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
127
     *
128
     * Criticial specific volume calculated by \f$V_c = (R*T_c)/p_c\f$.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
129
     *
130
131
     * Reid et al. (1987, pp 396-397, 667) \cite reid1987 <BR>
     * Poling et al. (2001, pp 9.7-9.8) \cite poling2001 <BR>
Klaus Mosthaf's avatar
Klaus Mosthaf committed
132
     *
133
     * Accentric factor taken from: <BR>
134
     * Adebiyi (2003) \cite adebiyi2003
Klaus Mosthaf's avatar
Klaus Mosthaf committed
135
     *
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
     *
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
     *
145
146
     * \param temperature temperature of component in \f$\mathrm{[K]}\f$
     * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
Klaus Mosthaf's avatar
Klaus Mosthaf committed
147
     */
148
    static Scalar oldGasViscosity(Scalar temperature, Scalar pressure)
Klaus Mosthaf's avatar
Klaus Mosthaf committed
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]

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's avatar
Klaus Mosthaf committed
167
168

        // convertion from micro poise to Pa s
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)
179
     * approach \cite Lemmon2004a
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's avatar
Klaus Mosthaf committed
197
198
    }

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's avatar
Klaus Mosthaf committed
210
211
    static Scalar simpleGasViscosity(Scalar temperature, Scalar pressure)
    {
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.
     *
221
     * This is a very exact approach by Lemmon and Jacobsen (2004) \cite Lemmon2004a
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]

233
234
235
        using std::log;
        using std::exp;
        using std::sqrt;
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's avatar
Klaus Mosthaf committed
245

246
        using std::pow;
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;
257
    }
Klaus Mosthaf's avatar
Klaus Mosthaf committed
258
259

    /*!
260
     * \brief Specific enthalpy of Air \f$\mathrm{[J/kg]}\f$
261
     *        with 273.15 \f$ K \f$ as basis.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
262
263
264
     *
     * \param temperature temperature of component in \f$\mathrm{[K]}\f$
     * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
265
266
     *
     * Kays et al. (2005, 431ff) \cite kays2005 <BR>
Klaus Mosthaf's avatar
Klaus Mosthaf committed
267
268
269
     */
    static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
    {
270
        return gasHeatCapacity(temperature, pressure) * (temperature-273.15);
Klaus Mosthaf's avatar
Klaus Mosthaf committed
271
272
273
    }

    /*!
274
     * \brief Specific internal energy of Air \f$\mathrm{[J/kg]}\f$.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
275
     *
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's avatar
Andreas Lauser committed
278
     * Exploiting the Ideal Gas assumption
279
     * (\f$pv = R_{\textnormal{specific}} T\f$) gives: \f$u = h - R / M T \f$.
Klaus Mosthaf's avatar
Klaus Mosthaf committed
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)
    {
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's avatar
Klaus Mosthaf committed
290
291
    }

292
    /*!
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$
301
302
303
     *
     *  Values taken from Hollis (1996) \cite hollis1996 <BR>
     *  "Tables of Thermal Properties of Gases"
304
305
306
307
     */
    static const Scalar gasHeatCapacity(Scalar temperature,
                                        Scalar pressure)
    {
308
        // scale temperature with reference temp of 100K
309
310
        Scalar phi = temperature/100;

311
        using std::pow;
312
313
        Scalar c_p = 0.661738E+01
                -0.105885E+01 * phi
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);
325
        c_p *= IdealGas::R / molarMass(); // in J/(mol*K) / (kg/mol)
326
327
328

        return  c_p;
    }
329
330

    /*!
331
     * \brief Thermal conductivity \f$\mathrm{[[W/(m*K)]}\f$ of air.
332
     *
333
334
335
336
     * Isobaric Properties for Nitrogen in: NIST Standard \cite NIST <BR>
     * evaluated at p=.1 MPa, T=20°C <BR>
     * Nitrogen: 0.025398 <BR>
     * Oxygen: 0.026105 <BR>
337
     * lambda_air is approximately 0.78*lambda_N2+0.22*lambda_O2
338
339
340
     *
     * \param temperature absolute temperature in \f$\mathrm{[K]}\f$
     * \param pressure of the phase in \f$\mathrm{[Pa]}\f$
341
342
343
     */
    static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
    {
344
        return 0.0255535;
345
    }
Klaus Mosthaf's avatar
Klaus Mosthaf committed
346
347
};

348
349
350
} // end namespace Components

} // end namespace Dumux
Klaus Mosthaf's avatar
Klaus Mosthaf committed
351
352

#endif