version 3.10-dev
h2.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_H2_HH
13#define DUMUX_H2_HH
14
16
17#include <cmath>
18
22
23namespace Dumux {
24namespace Components {
25
32template <class Scalar>
33class H2
34: public Components::Base<Scalar, H2<Scalar> >
35, public Components::Gas<Scalar, H2<Scalar> >
36{
38 using ShomateMethod = Dumux::ShomateMethod<Scalar, 3>; // three regions
39
40public:
42
46 static std::string name()
47 { return "H2"; }
48
52 static constexpr Scalar molarMass()
53 { return 2.01588e-3; }
54
59 { return 33.2; /* [K] */ }
60
65 { return 13.0e5; /* [N/m^2] */ }
66
71 { return 14.0; /* [K] */ }
72
86 {
88 return criticalPressure();
90 return 0; // H2 is solid: We don't take sublimation into
91 // account
92
93 // antoine equatuion
94 const Scalar A = -7.76451;
95 const Scalar B = 1.45838;
96 const Scalar C = -2.77580;
97
98 using std::exp;
99 return 1e5 * exp(A - B/(temperature + C));
100 }
101
109 {
110 // Assume an ideal gas
112 }
113
122
126 static constexpr bool gasIsCompressible()
127 { return true; }
128
132 static constexpr bool gasIsIdeal()
133 { return true; }
134
142 {
143 // Assume an ideal gas
145 }
146
156 {
157 const auto h = shomateMethod.enthalpy(temperature); // KJ/mol
158 return h * 1e3 / molarMass(); // J/kg
159 }
160
173 {
174 const auto cp = shomateMethod.heatCapacity(T); // J/(mol K)
175 return cp / molarMass(); // J/(kg K)
176 }
177
191 {
192 const Scalar Tc = criticalTemperature();
193 const Scalar Vc = 65.0; // critical specific volume [cm^3/mol]
194 const Scalar omega = -0.216; // accentric factor
195 const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
196 const Scalar dipole = 0.0; // dipole moment [debye]
197
198 using std::sqrt;
199 Scalar mu_r4 = 131.3 * dipole / sqrt(Vc * Tc);
200 mu_r4 *= mu_r4;
201 mu_r4 *= mu_r4;
202
203 using std::pow;
204 using std::exp;
205 Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
206 Scalar Tstar = 1.2593 * temperature/Tc;
207 Scalar Omega_v =
208 1.16145*pow(Tstar, -0.14874) +
209 0.52487*exp(- 0.77320*Tstar) +
210 2.16178*exp(- 2.43787*Tstar);
211 Scalar mu = 40.785*Fc*sqrt(M*temperature)/(pow(Vc, 2./3)*Omega_v);
212
213 // conversion from micro poise to Pa s
214 return mu/1e6 / 10;
215 }
216};
217
223template <class Scalar>
224const typename H2<Scalar>::ShomateMethod H2<Scalar>::shomateMethod{
225 /*temperature*/{298.0, 1000.0, 2500.0, 6000.0},
227 {33.066178, -11.363417, 11.432816, -2.772874, -0.158558, -9.980797, 172.707974, 0.0},
228 {18.563083, 12.257357, -2.859786, 0.268238, 1.97799, -1.147438, 156.288133, 0.0},
229 {43.41356, -4.293079, 1.272428, -0.096876, -20.533862, -38.515158, 162.081354, 0.0}
230 }}
231};
232
233} // end namespace Components
234} // end namespace Dumux
235
236#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
Interface for components that have a gas state.
Definition: gas.hh:29
Properties of pure molecular hydrogen .
Definition: h2.hh:36
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure hydrogen gas. Shomate Equation is used for a temperature range of 298K to ...
Definition: h2.hh:154
static Scalar criticalTemperature()
Returns the critical temperature of molecular hydrogen.
Definition: h2.hh:58
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of in , depending on pressure and temperature.
Definition: h2.hh:120
static std::string name()
A human readable name for the .
Definition: h2.hh:46
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition: h2.hh:126
static const ShomateMethod shomateMethod
Shomate parameters for hydrogen published by NIST https://webbook.nist.gov/cgi/cbook....
Definition: h2.hh:41
static constexpr Scalar molarMass()
The molar mass in of molecular hydrogen.
Definition: h2.hh:52
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of at a given pressure and temperature.
Definition: h2.hh:108
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: h2.hh:132
static Scalar vaporPressure(Scalar temperature)
The vapor pressure in of pure molecular hydrogen at a given temperature.
Definition: h2.hh:85
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of at a given pressure and temperature.
Definition: h2.hh:190
static Scalar criticalPressure()
Returns the critical pressure of molecular hydrogen.
Definition: h2.hh:64
static Scalar tripleTemperature()
Returns the temperature at molecular hydrogen's triple point.
Definition: h2.hh:70
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of gaseous in at a given density and temperature.
Definition: h2.hh:141
static const Scalar gasHeatCapacity(Scalar T, Scalar pressure)
Specific isobaric heat capacity of pure hydrogen gas. Shomate Equation is used for a temperature ran...
Definition: h2.hh:171
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 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.