version 3.10-dev
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-FileCopyrightInfo: 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 {
24namespace Components {
25
31template <class Scalar>
32class CH4
33: public Components::Base<Scalar, CH4<Scalar> >
34, public Components::Gas<Scalar, CH4<Scalar> >
35{
37 using ShomateMethod = Dumux::ShomateMethod<Scalar, 3>; // three regions
38
39public:
41
45 static std::string name()
46 { return "CH4"; }
47
51 static constexpr Scalar molarMass()
52 { return 16.043e-3; /* [kg/mol] */}
53
58 { return 190.4; /* [K] */ }
59
64 { return 46e5; /* [Pa] */ }
65
70 { return 90.7; /* [K] */ }
71
76 { return 0; /* [Pa] */ }
77
85 { DUNE_THROW(Dune::NotImplemented, "vaporPressure for CH4"); }
86
90 static constexpr bool gasIsCompressible()
91 { return true; }
92
100 {
101 // Assume an ideal gas
103 }
104
113
117 static constexpr bool gasIsIdeal()
118 { return true; }
119
127 {
128 // Assume an ideal gas
130 }
131
141 {
142 const auto h = shomateMethod.enthalpy(temperature); // KJ/mol
143 return h * 1e3 / molarMass(); // J/kg
144 }
145
152 {
153 const auto cp = shomateMethod.heatCapacity(T); // J/(mol K)
154 return cp / molarMass(); // J/(kg K)
155 }
156
173 {
174
175 return
177 1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
178 IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
179 }
180
195 {
196 const Scalar Tc = criticalTemperature();
197 const Scalar Vc = 98.6; // critical specific volume [cm^3/mol]
198 const Scalar omega = 0.011; // accentric factor
199 const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
200 const Scalar dipole = 0.0; // dipole moment [debye]
201
202 using std::sqrt;
203 Scalar mu_r4 = 131.3 * dipole / sqrt(Vc * Tc);
204 mu_r4 *= mu_r4;
205 mu_r4 *= mu_r4;
206
207 using std::exp;
208 using std::pow;
209 Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
210 Scalar Tstar = 1.2593 * temperature/Tc;
211 Scalar Omega_v =
212 1.16145*pow(Tstar, -0.14874) +
213 0.52487*exp(- 0.77320*Tstar) +
214 2.16178*exp(- 2.43787*Tstar);
215 Scalar mu = 40.785*Fc*sqrt(M*temperature)/(pow(Vc, 2./3)*Omega_v);
216
217 // conversion from micro poise to Pa s
218 return mu/1e6 / 10;
219 }
220};
221
227template <class Scalar>
228const typename CH4<Scalar>::ShomateMethod CH4<Scalar>::shomateMethod{
229 /*temperature*/{298.0, 1300.0, 6000.0},
231 {-0.703029, 108.4773, -42.52157, 5.862788, 0.678565, -76.84376, 158.7163, -74.87310},
232 {85.81217, 11.26467, -2.114146, 0.138190, -26.42221, -153.5327, 224.4143, -74.87310}
233 }}
234};
235
236} // end namespace Components
237} // end namespace Dumux
238
239#endif
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition: components/base.hh:47
Scalar Scalar
export the scalar type used by the component
Definition: components/base.hh:51
Properties of pure molecular methane .
Definition: ch4.hh:35
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of gaseous in at a given density and temperature.
Definition: ch4.hh:126
static Scalar triplePressure()
Returns the pressure at molecular methane's triple point.
Definition: ch4.hh:75
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:150
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of at a given pressure and temperature.
Definition: ch4.hh:194
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of gas at a given pressure and temperature.
Definition: ch4.hh:99
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of gas in , depending on pressure and temperature.
Definition: ch4.hh:111
static Scalar vaporPressure(Scalar T)
The vapor pressure in of pure molecular methane at a given temperature.
Definition: ch4.hh:84
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:139
static Scalar criticalTemperature()
Returns the critical temperature of molecular methane.
Definition: ch4.hh:57
static std::string name()
A human readable name for methane.
Definition: ch4.hh:45
static Scalar criticalPressure()
Returns the critical pressure of molecular methane.
Definition: ch4.hh:63
static constexpr Scalar molarMass()
The molar mass in of molecular methane.
Definition: ch4.hh:51
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: ch4.hh:117
static Scalar tripleTemperature()
Returns the temperature at molecular methane's triple point.
Definition: ch4.hh:69
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition: ch4.hh:90
static const ShomateMethod shomateMethod
Shomate parameters for methane published by NIST https://webbook.nist.gov/cgi/cbook....
Definition: ch4.hh:40
static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure methane gas.
Definition: ch4.hh:171
Interface for components that have a gas state.
Definition: gas.hh:29
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
Scalar heatCapacity(const Scalar temperature) const
Return heat capacity in J/(mol*K)
Definition: shomate.hh:88
std::conditional_t< intervals==-1, std::vector< CoefficientSet >, std::array< CoefficientSet, std::size_t(intervals)> > Coefficients
Definition: shomate.hh:56
Scalar enthalpy(const Scalar temperature) const
Return enthalpy in kJ/mol.
Definition: shomate.hh:75
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.
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:22
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:53
Definition: adapt.hh:17
Shomate equations for enthalpy and heat capacity.