version 3.10.0
Loading...
Searching...
No Matches
ch4.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_CH4_HH
13#define DUMUX_CH4_HH
14
16
17#include <cmath>
18
22
23namespace Dumux::Components {
24
30template <class Scalar>
31class CH4
32: public Components::Base<Scalar, CH4<Scalar> >
33, public Components::Gas<Scalar, CH4<Scalar> >
34{
35 using IdealGas = Dumux::IdealGas<Scalar>;
36 using ShomateMethod = Dumux::ShomateMethod<Scalar, 3>; // three regions
37
38public:
39 static const ShomateMethod shomateMethod;
40
44 static std::string name()
45 { return "CH4"; }
46
50 static constexpr Scalar molarMass()
51 { return 16.043e-3; /* [kg/mol] */}
52
57 { return 190.4; /* [K] */ }
58
63 { return 46e5; /* [Pa] */ }
64
69 { return 90.7; /* [K] */ }
70
75 { return 0; /* [Pa] */ }
76
84 { DUNE_THROW(Dune::NotImplemented, "vaporPressure for CH4"); }
85
89 static constexpr bool gasIsCompressible()
90 { return true; }
91
98 static Scalar gasDensity(Scalar temperature, Scalar pressure)
99 {
100 // Assume an ideal gas
101 return IdealGas::density(molarMass(), temperature, pressure);
102 }
103
110 static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
111 { return IdealGas::molarDensity(temperature, pressure); }
112
116 static constexpr bool gasIsIdeal()
117 { return true; }
118
125 static Scalar gasPressure(Scalar temperature, Scalar density)
126 {
127 // Assume an ideal gas
128 return IdealGas::pressure(temperature, density/molarMass());
129 }
130
138 static const Scalar gasEnthalpy(Scalar temperature,
139 Scalar pressure)
140 {
141 const auto h = shomateMethod.enthalpy(temperature); // KJ/mol
142 return h * 1e3 / molarMass(); // J/kg
143 }
144
150 Scalar pressure)
151 {
152 const auto cp = shomateMethod.heatCapacity(T); // J/(mol K)
153 return cp / molarMass(); // J/(kg K)
154 }
155
170 static const Scalar gasInternalEnergy(Scalar temperature,
171 Scalar pressure)
172 {
173
174 return
175 gasEnthalpy(temperature, pressure) -
176 1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
177 IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
178 }
179
193 static Scalar gasViscosity(Scalar temperature, Scalar pressure)
194 {
195 const Scalar Tc = criticalTemperature();
196 const Scalar Vc = 98.6; // critical specific volume [cm^3/mol]
197 const Scalar omega = 0.011; // accentric factor
198 const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
199 const Scalar dipole = 0.0; // dipole moment [debye]
200
201 using std::sqrt;
202 Scalar mu_r4 = 131.3 * dipole / sqrt(Vc * Tc);
203 mu_r4 *= mu_r4;
204 mu_r4 *= mu_r4;
205
206 using std::exp;
207 using std::pow;
208 Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
209 Scalar Tstar = 1.2593 * temperature/Tc;
210 Scalar Omega_v =
211 1.16145*pow(Tstar, -0.14874) +
212 0.52487*exp(- 0.77320*Tstar) +
213 2.16178*exp(- 2.43787*Tstar);
214 Scalar mu = 40.785*Fc*sqrt(M*temperature)/(pow(Vc, 2./3)*Omega_v);
215
216 // conversion from micro poise to Pa s
217 return mu/1e6 / 10;
218 }
219};
220
226template <class Scalar>
227const typename CH4<Scalar>::ShomateMethod CH4<Scalar>::shomateMethod{
228 /*temperature*/{298.0, 1300.0, 6000.0},
230 {-0.703029, 108.4773, -42.52157, 5.862788, 0.678565, -76.84376, 158.7163, -74.87310},
231 {85.81217, 11.26467, -2.114146, 0.138190, -26.42221, -153.5327, 224.4143, -74.87310}
232 }}
233};
234
235} // end namespace Dumux::Components
236
237#endif
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition components/base.hh:46
Scalar Scalar
Definition components/base.hh:50
Properties of pure molecular methane .
Definition ch4.hh:34
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of gaseous in at a given density and temperature.
Definition ch4.hh:125
static Scalar triplePressure()
Returns the pressure at molecular methane's triple point.
Definition ch4.hh:74
static Scalar gasHeatCapacity(Scalar T, Scalar pressure)
Specific isobaric heat capacity of pure methane gas. Shomate Equation is used for a temperature rang...
Definition ch4.hh:149
static const ShomateMethod shomateMethod
Definition ch4.hh:39
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of at a given pressure and temperature.
Definition ch4.hh:193
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of gas at a given pressure and temperature.
Definition ch4.hh:98
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of gas in , depending on pressure and temperature.
Definition ch4.hh:110
static Scalar vaporPressure(Scalar T)
The vapor pressure in of pure molecular methane at a given temperature.
Definition ch4.hh:83
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure methane gas. Shomate Equation is used for a temperature range of 298K to 6...
Definition ch4.hh:138
static Scalar criticalTemperature()
Returns the critical temperature of molecular methane.
Definition ch4.hh:56
static std::string name()
A human readable name for methane.
Definition ch4.hh:44
static Scalar criticalPressure()
Returns the critical pressure of molecular methane.
Definition ch4.hh:62
static constexpr Scalar molarMass()
The molar mass in of molecular methane.
Definition ch4.hh:50
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition ch4.hh:116
static Scalar tripleTemperature()
Returns the temperature at molecular methane's triple point.
Definition ch4.hh:68
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition ch4.hh:89
static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure methane gas.
Definition ch4.hh:170
Interface for components that have a gas state.
Definition gas.hh:28
Relations valid for an ideal gas.
Definition idealgas.hh:25
static constexpr Scalar pressure(Scalar temperature, Scalar rhoMolar)
The pressure of the gas in , depending on the molar density and temperature.
Definition idealgas.hh:48
static constexpr Scalar R
The ideal gas constant .
Definition idealgas.hh:28
static constexpr Scalar density(Scalar avgMolarMass, Scalar temperature, Scalar pressure)
The density of the gas in , depending on pressure, temperature and average molar mass of the gas.
Definition idealgas.hh:37
static constexpr Scalar molarDensity(Scalar temperature, Scalar pressure)
The molar density of the gas , depending on pressure and temperature.
Definition idealgas.hh:58
The Shomate method to compute enthalpy and heat capacity.
Definition shomate.hh:50
std::conditional_t< intervals==-1, std::vector< CoefficientSet >, std::array< CoefficientSet, std::size_t(intervals)> > Coefficients
Definition shomate.hh:56
Base class for all components Components provide the thermodynamic relations for the liquid,...
Interface for components that have a gas state.
Relations valid for an ideal gas.
Definition air.hh:22
Shomate equations for enthalpy and heat capacity.