ch4.hh 8.47 KB
Newer Older
1
2
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
3
/*****************************************************************************
4
 *   See the file COPYING for full copying permissions.                      *
5
 *                                                                           *
6
 *   This program is free software: you can redistribute it and/or modify    *
7
 *   it under the terms of the GNU General Public License as published by    *
8
9
 *   the Free Software Foundation, either version 2 of the License, or       *
 *   (at your option) any later version.                                     *
10
 *                                                                           *
11
12
 *   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            *
14
15
16
17
 *   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/>.   *
18
19
20
 *****************************************************************************/
/*!
 * \file
21
 * \ingroup Components
22
 * \brief Properties of methane \f$CH_4\f$.
23
24
25
26
27
28
29
30
 */
#ifndef DUMUX_CH4_HH
#define DUMUX_CH4_HH

#include <dumux/material/idealgas.hh>

#include <cmath>

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

namespace Dumux {
namespace Components {
36
37

/*!
38
 * \ingroup Components
39
 * \brief Properties of pure molecular methane \f$CH_4\f$.
40
 * \tparam Scalar The type used for scalar values
41
42
 */
template <class Scalar>
43
44
45
class CH4
: public Components::Base<Scalar, CH4<Scalar> >
, public Components::Gas<Scalar, CH4<Scalar> >
46
{
47
    using IdealGas = Dumux::IdealGas<Scalar>;
48
49
50
51
52

public:
    /*!
     * \brief A human readable name for methane.
     */
53
    static std::string name()
54
55
56
    { return "CH4"; }

    /*!
Felix Bode's avatar
Felix Bode committed
57
     * \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of molecular methane.
58
     */
59
    static constexpr Scalar molarMass()
60
    { return 16.043e-3; /* [kg/mol] */}
61
62

    /*!
Felix Bode's avatar
Felix Bode committed
63
     * \brief Returns the critical temperature \f$\mathrm{[K]}\f$ of molecular methane
64
65
66
67
68
     */
    static Scalar criticalTemperature()
    { return 190.4; /* [K] */ }

    /*!
Felix Bode's avatar
Felix Bode committed
69
     * \brief Returns the critical pressure \f$\mathrm{[Pa]}\f$ of molecular methane
70
71
     */
    static Scalar criticalPressure()
72
    { return 46e5; /* [Pa] */ }
73
74

    /*!
Felix Bode's avatar
Felix Bode committed
75
     * \brief Returns the temperature \f$\mathrm{[K]}\f$ at molecular methane's triple point.
76
77
78
79
80
     */
    static Scalar tripleTemperature()
    { return 90.7; /* [K] */ }

    /*!
Felix Bode's avatar
Felix Bode committed
81
     * \brief Returns the pressure \f$\mathrm{[Pa]}\f$ at molecular methane's triple point.
82
83
     */
    static Scalar triplePressure()
84
    { return 0; /* [Pa] */ }
85
86

    /*!
Felix Bode's avatar
Felix Bode committed
87
     * \brief The vapor pressure in \f$\mathrm{[Pa]}\f$ of pure molecular methane
88
     *        at a given temperature.
89
     *
Felix Bode's avatar
Felix Bode committed
90
     *\param T temperature of component in \f$\mathrm{[K]}\f$
91
92
93
94
     */
    static Scalar vaporPressure(Scalar T)
    { DUNE_THROW(Dune::NotImplemented, "vaporPressure for CH4"); }

95
    /*!
96
     * \brief Returns true if the gas phase is assumed to be compressible
97
     */
98
    static constexpr bool gasIsCompressible()
99
    { return true; }
100
101

    /*!
Felix Bode's avatar
Felix Bode committed
102
     * \brief The density \f$\mathrm{[kg/m^3]}\f$ of \f$CH_4\f$ gas at a given pressure and temperature.
103
     *
Felix Bode's avatar
Felix Bode committed
104
105
     * \param temperature temperature of component in \f$\mathrm{[K]}\f$
     * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
106
107
108
109
110
111
112
     */
    static Scalar gasDensity(Scalar temperature, Scalar pressure)
    {
        // Assume an ideal gas
        return IdealGas::density(molarMass(), temperature, pressure);
    }

113
114
115
116
117
118
119
120
121
    /*!
     * \brief The molar density of \f$CH_4\f$ gas 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); }

122
    /*!
123
     * \brief Returns true if the gas phase is assumed to be ideal
124
     */
125
    static constexpr bool gasIsIdeal()
126
127
    { return true; }

128
    /*!
Felix Bode's avatar
Felix Bode committed
129
     * \brief The pressure of gaseous \f$CH_4\f$ in \f$\mathrm{[Pa]}\f$ at a given density and temperature.
130
     *
Felix Bode's avatar
Felix Bode committed
131
132
     * \param temperature temperature of component in \f$\mathrm{[K]}\f$
     * \param density density of component in \f$\mathrm{[kg/m^3]}\f$
133
134
135
136
137
138
139
140
     */
    static Scalar gasPressure(Scalar temperature, Scalar density)
    {
        // Assume an ideal gas
        return IdealGas::pressure(temperature, density/molarMass());
    }

    /*!
Felix Bode's avatar
Felix Bode committed
141
     * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure methane gas.
142
     *
143
     * \param temperature temperature of component in \f$\mathrm{[K]}\f$
Felix Bode's avatar
Felix Bode committed
144
     * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
145
     */
146
    static const Scalar gasEnthalpy(Scalar temperature,
147
                                    Scalar pressure)
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
    {
        return gasHeatCapacity(temperature, pressure) * temperature;
    }

    /*!
     * \brief Specific isobaric heat capacity \f$\mathrm{[J/(kg*K)]}\f$ of pure
     *        methane gas.
     *
     * This is equivalent to the partial derivative of the specific
     * enthalpy to the temperature.
     *
     * See: R. Reid, et al. (1987, pp 154, 657, 665) \cite reid1987
     */
    static Scalar gasHeatCapacity(Scalar T,
                                  Scalar pressure)
163
164
    {
        // method of Joback
165
166
167
        const Scalar cpVapA = 19.25;
        const Scalar cpVapB = 0.05213;
        const Scalar cpVapC = 1.197e-5;
168
169
170
        const Scalar cpVapD = -1.132e-8;

        return
171
172
173
            1/molarMass()* // conversion from [J/(mol*K)] to [J/(kg*K)]
            (cpVapA + T*
              (cpVapB/2 + T*
174
                (cpVapC/3 + T*
175
                  (cpVapD/4))));
176
177
178
    }

    /*!
Felix Bode's avatar
Felix Bode committed
179
     * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure methane gas.
180
     *
181
182
183
184
     *        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
185
     *        Exploiting the Ideal Gas assumption (\f$pv = R_{\textnormal{specific}} T\f$)gives: \f$u = h - R / M T \f$.
186
     *
Andreas Lauser's avatar
Andreas Lauser committed
187
     *        The universal gas constant can only be used in the case of molar formulations.
188
     *
Felix Bode's avatar
Felix Bode committed
189
190
     * \param temperature temperature of component in \f$\mathrm{[K]}\f$
     * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
191
192
193
194
195
196
197
     */
    static const Scalar gasInternalEnergy(Scalar temperature,
                                          Scalar pressure)
    {

        return
            gasEnthalpy(temperature, pressure) -
198
            1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
199
200
201
202
            IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
    }

    /*!
Felix Bode's avatar
Felix Bode committed
203
     * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of \f$CH_4\f$ at a given pressure and temperature.
204
     *
Felix Bode's avatar
Felix Bode committed
205
206
     * \param temperature temperature of component in \f$\mathrm{[K]}\f$
     * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
207
     *
208
209
     * See:
     *
210
     * See: R. Reid, et al.: The Properties of Gases and Liquids,
211
212
     * 4th edition (1987, pp 396-397, 670) \cite reid1987 <BR>
     * 5th edition (2001, pp 9.7-9.8 (omega and V_c taken from p. A.5)) \cite poling2001
213
     *
214
215
216
217
     */
    static Scalar gasViscosity(Scalar temperature, Scalar pressure)
    {
        const Scalar Tc = criticalTemperature();
218
        const Scalar Vc = 98.6; // critical specific volume [cm^3/mol]
219
220
221
222
        const Scalar omega = 0.011; // accentric factor
        const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
        const Scalar dipole = 0.0; // dipole moment [debye]

223
224
        using std::sqrt;
        Scalar mu_r4 = 131.3 * dipole / sqrt(Vc * Tc);
225
226
227
        mu_r4 *= mu_r4;
        mu_r4 *= mu_r4;

228
229
        using std::exp;
        using std::pow;
230
231
232
        Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
        Scalar Tstar = 1.2593 * temperature/Tc;
        Scalar Omega_v =
233
234
235
236
            1.16145*pow(Tstar, -0.14874) +
            0.52487*exp(- 0.77320*Tstar) +
            2.16178*exp(- 2.43787*Tstar);
        Scalar mu = 40.785*Fc*sqrt(M*temperature)/(pow(Vc, 2./3)*Omega_v);
237

238
        // conversion from micro poise to Pa s
239
240
241
242
        return mu/1e6 / 10;
    }
};

243
244
245
} // end namespace Components

} // end namespace Dumux
246
247

#endif