version 3.11-dev
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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-FileCopyrightText: 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::Components {
24
31template <class Scalar>
32class H2
33: public Components::Base<Scalar, H2<Scalar> >
34, public Components::Gas<Scalar, H2<Scalar> >
35{
37 using ShomateMethod = Dumux::ShomateMethod<Scalar, 3>; // three regions
38
39public:
41
45 static std::string name()
46 { return "H2"; }
47
51 static constexpr Scalar molarMass()
52 { return 2.01588e-3; }
53
58 { return 33.2; /* [K] */ }
59
64 { return 13.0e5; /* [N/m^2] */ }
65
70 { return 14.0; /* [K] */ }
71
85 {
87 return criticalPressure();
89 return 0; // H2 is solid: We don't take sublimation into
90 // account
91
92 // antoine equatuion
93 const Scalar A = -7.76451;
94 const Scalar B = 1.45838;
95 const Scalar C = -2.77580;
96
97 using std::exp;
98 return 1e5 * exp(A - B/(temperature + C));
99 }
100
108 {
109 // Assume an ideal gas
111 }
112
121
125 static constexpr bool gasIsCompressible()
126 { return true; }
127
131 static constexpr bool gasIsIdeal()
132 { return true; }
133
141 {
142 // Assume an ideal gas
144 }
145
155 {
156 const auto h = shomateMethod.enthalpy(temperature); // KJ/mol
157 return h * 1e3 / molarMass(); // J/kg
158 }
159
172 {
173 const auto cp = shomateMethod.heatCapacity(T); // J/(mol K)
174 return cp / molarMass(); // J/(kg K)
175 }
176
190 {
191 const Scalar Tc = criticalTemperature();
192 const Scalar Vc = 65.0; // critical specific volume [cm^3/mol]
193 const Scalar omega = -0.216; // accentric factor
194 const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
195 const Scalar dipole = 0.0; // dipole moment [debye]
196
197 using std::sqrt;
198 Scalar mu_r4 = 131.3 * dipole / sqrt(Vc * Tc);
199 mu_r4 *= mu_r4;
200 mu_r4 *= mu_r4;
201
202 using std::pow;
203 using std::exp;
204 Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
205 Scalar Tstar = 1.2593 * temperature/Tc;
206 Scalar Omega_v =
207 1.16145*pow(Tstar, -0.14874) +
208 0.52487*exp(- 0.77320*Tstar) +
209 2.16178*exp(- 2.43787*Tstar);
210 Scalar mu = 40.785*Fc*sqrt(M*temperature)/(pow(Vc, 2./3)*Omega_v);
211
212 // conversion from micro poise to Pa s
213 return mu/1e6 / 10;
214 }
215};
216
222template <class Scalar>
223const typename H2<Scalar>::ShomateMethod H2<Scalar>::shomateMethod{
224 /*temperature*/{298.0, 1000.0, 2500.0, 6000.0},
226 {33.066178, -11.363417, 11.432816, -2.772874, -0.158558, -9.980797, 172.707974, 0.0},
227 {18.563083, 12.257357, -2.859786, 0.268238, 1.97799, -1.147438, 156.288133, 0.0},
228 {43.41356, -4.293079, 1.272428, -0.096876, -20.533862, -38.515158, 162.081354, 0.0}
229 }}
230};
231
232} // end namespace Dumux::Components
233
234#endif
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition: components/base.hh:46
Scalar Scalar
export the scalar type used by the component
Definition: components/base.hh:50
Interface for components that have a gas state.
Definition: gas.hh:28
Properties of pure molecular hydrogen .
Definition: h2.hh:35
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:153
static Scalar criticalTemperature()
Returns the critical temperature of molecular hydrogen.
Definition: h2.hh:57
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of in , depending on pressure and temperature.
Definition: h2.hh:119
static std::string name()
A human readable name for the .
Definition: h2.hh:45
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition: h2.hh:125
static const ShomateMethod shomateMethod
Shomate parameters for hydrogen published by NIST https://webbook.nist.gov/cgi/cbook....
Definition: h2.hh:40
static constexpr Scalar molarMass()
The molar mass in of molecular hydrogen.
Definition: h2.hh:51
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of at a given pressure and temperature.
Definition: h2.hh:107
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: h2.hh:131
static Scalar vaporPressure(Scalar temperature)
The vapor pressure in of pure molecular hydrogen at a given temperature.
Definition: h2.hh:84
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of at a given pressure and temperature.
Definition: h2.hh:189
static Scalar criticalPressure()
Returns the critical pressure of molecular hydrogen.
Definition: h2.hh:63
static Scalar tripleTemperature()
Returns the temperature at molecular hydrogen's triple point.
Definition: h2.hh:69
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of gaseous in at a given density and temperature.
Definition: h2.hh:140
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:170
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.
Definition: air.hh:22
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
Shomate equations for enthalpy and heat capacity.