Line | Branch | Exec | Source |
---|---|---|---|
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 | // | ||
7 | /*! | ||
8 | * \file | ||
9 | * \ingroup Components | ||
10 | * \brief Properties of pure molecular hydrogen \f$H_2\f$. | ||
11 | */ | ||
12 | #ifndef DUMUX_H2_HH | ||
13 | #define DUMUX_H2_HH | ||
14 | |||
15 | #include <dumux/material/idealgas.hh> | ||
16 | |||
17 | #include <cmath> | ||
18 | |||
19 | #include <dumux/material/components/base.hh> | ||
20 | #include <dumux/material/components/gas.hh> | ||
21 | #include <dumux/material/components/shomate.hh> | ||
22 | |||
23 | namespace Dumux::Components { | ||
24 | |||
25 | /*! | ||
26 | * \ingroup Components | ||
27 | * \brief Properties of pure molecular hydrogen \f$H_2\f$. | ||
28 | * | ||
29 | * \tparam Scalar The type used for scalar values | ||
30 | */ | ||
31 | template <class Scalar> | ||
32 | class H2 | ||
33 | : public Components::Base<Scalar, H2<Scalar> > | ||
34 | , public Components::Gas<Scalar, H2<Scalar> > | ||
35 | { | ||
36 | using IdealGas = Dumux::IdealGas<Scalar>; | ||
37 | using ShomateMethod = Dumux::ShomateMethod<Scalar, 3>; // three regions | ||
38 | |||
39 | public: | ||
40 | static const ShomateMethod shomateMethod; | ||
41 | |||
42 | /*! | ||
43 | * \brief A human readable name for the \f$H_2\f$. | ||
44 | */ | ||
45 |
4/8✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
|
4 | static std::string name() |
46 |
8/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
|
4 | { return "H2"; } |
47 | |||
48 | /*! | ||
49 | * \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of molecular hydrogen. | ||
50 | */ | ||
51 | static constexpr Scalar molarMass() | ||
52 | { return 2.01588e-3; } | ||
53 | |||
54 | /*! | ||
55 | * \brief Returns the critical temperature \f$\mathrm{[K]}\f$ of molecular hydrogen. | ||
56 | */ | ||
57 | static Scalar criticalTemperature() | ||
58 | { return 33.2; /* [K] */ } | ||
59 | |||
60 | /*! | ||
61 | * \brief Returns the critical pressure \f$\mathrm{[Pa]}\f$ of molecular hydrogen. | ||
62 | */ | ||
63 | static Scalar criticalPressure() | ||
64 | { return 13.0e5; /* [N/m^2] */ } | ||
65 | |||
66 | /*! | ||
67 | * \brief Returns the temperature \f$\mathrm{[K]}\f$ at molecular hydrogen's triple point. | ||
68 | */ | ||
69 | static Scalar tripleTemperature() | ||
70 | { return 14.0; /* [K] */ } | ||
71 | |||
72 | /*! | ||
73 | * \brief The vapor pressure in \f$\mathrm{[Pa]}\f$ of pure molecular hydrogen | ||
74 | * at a given temperature. | ||
75 | * | ||
76 | *\param temperature temperature of component in \f$\mathrm{[K]}\f$ | ||
77 | * | ||
78 | * Taken from: | ||
79 | * | ||
80 | * See: R. Reid, et al. (1987, pp 208-209, 669) \cite reid1987 | ||
81 | * | ||
82 | * \todo implement the Gomez-Thodos approach... | ||
83 | */ | ||
84 | static Scalar vaporPressure(Scalar temperature) | ||
85 | { | ||
86 | if (temperature > criticalTemperature()) | ||
87 | return criticalPressure(); | ||
88 | if (temperature < tripleTemperature()) | ||
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 | |||
101 | /*! | ||
102 | * \brief The density \f$\mathrm{[kg/m^3]}\f$ of \f$H_2\f$ at a given pressure and temperature. | ||
103 | * | ||
104 | * \param temperature temperature of component in \f$\mathrm{[K]}\f$ | ||
105 | * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ | ||
106 | */ | ||
107 | 101 | static Scalar gasDensity(Scalar temperature, Scalar pressure) | |
108 | { | ||
109 | // Assume an ideal gas | ||
110 | 101 | return IdealGas::density(molarMass(), temperature, pressure); | |
111 | } | ||
112 | |||
113 | /*! | ||
114 | * \brief The molar density of \f$H_2\f$ in \f$\mathrm{[mol/m^3]}\f$, | ||
115 | * depending on pressure and temperature. | ||
116 | * \param temperature The temperature of the gas | ||
117 | * \param pressure The pressure of the gas | ||
118 | */ | ||
119 | static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) | ||
120 | { return IdealGas::molarDensity(temperature, pressure); } | ||
121 | |||
122 | /*! | ||
123 | * \brief Returns true if the gas phase is assumed to be compressible | ||
124 | */ | ||
125 | static constexpr bool gasIsCompressible() | ||
126 | { return true; } | ||
127 | |||
128 | /*! | ||
129 | * \brief Returns true if the gas phase is assumed to be ideal | ||
130 | */ | ||
131 | static constexpr bool gasIsIdeal() | ||
132 | { return true; } | ||
133 | |||
134 | /*! | ||
135 | * \brief The pressure of gaseous \f$H_2\f$ in \f$\mathrm{[Pa]}\f$ at a given density and temperature. | ||
136 | * | ||
137 | * \param temperature temperature of component in \f$\mathrm{[K]}\f$ | ||
138 | * \param density density of component in \f$\mathrm{[kg/m^3]}\f$ | ||
139 | */ | ||
140 | static Scalar gasPressure(Scalar temperature, Scalar density) | ||
141 | { | ||
142 | // Assume an ideal gas | ||
143 | return IdealGas::pressure(temperature, density/molarMass()); | ||
144 | } | ||
145 | |||
146 | /*! | ||
147 | * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure hydrogen gas. | ||
148 | * Shomate Equation is used for a temperature range of 298K to 6000K. | ||
149 | * | ||
150 | * \param temperature temperature of component in \f$\mathrm{[K]}\f$ | ||
151 | * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ | ||
152 | */ | ||
153 | 101 | static const Scalar gasEnthalpy(Scalar temperature, | |
154 | Scalar pressure) | ||
155 | { | ||
156 |
1/2✓ Branch 1 taken 101 times.
✗ Branch 2 not taken.
|
101 | const auto h = shomateMethod.enthalpy(temperature); // KJ/mol |
157 | 101 | return h * 1e3 / molarMass(); // J/kg | |
158 | } | ||
159 | |||
160 | /*! | ||
161 | * \brief Specific isobaric heat capacity \f$\mathrm{[J/(kg*K)]}\f$ of pure | ||
162 | * hydrogen gas. | ||
163 | * Shomate Equation is used for a temperature range of 298K to 6000K. | ||
164 | * | ||
165 | * \param T temperature of component in \f$\mathrm{[K]}\f$ | ||
166 | * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ | ||
167 | * | ||
168 | * See: R. Reid, et al. (1987, pp 154, 657, 665) \cite reid1987 | ||
169 | */ | ||
170 | 101 | static const Scalar gasHeatCapacity(Scalar T, | |
171 | Scalar pressure) | ||
172 | { | ||
173 |
1/2✓ Branch 1 taken 101 times.
✗ Branch 2 not taken.
|
101 | const auto cp = shomateMethod.heatCapacity(T); // J/(mol K) |
174 | 101 | return cp / molarMass(); // J/(kg K) | |
175 | } | ||
176 | |||
177 | /*! | ||
178 | * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of \f$H_2\f$ at a given pressure and temperature. | ||
179 | * | ||
180 | * \param temperature temperature of component in \f$\mathrm{[K]}\f$ | ||
181 | * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ | ||
182 | * | ||
183 | * See: | ||
184 | * | ||
185 | * See: R. Reid, et al.: The Properties of Gases and Liquids, | ||
186 | * 4th edition (1987, pp 396-397, 667) \cite reid1987 <BR> | ||
187 | * 5th edition (2001, pp 9.7-9.8 (omega and V_c taken from p. A.19)) \cite poling2001 | ||
188 | */ | ||
189 | 101 | static Scalar gasViscosity(Scalar temperature, Scalar pressure) | |
190 | { | ||
191 | 101 | const Scalar Tc = criticalTemperature(); | |
192 | 101 | const Scalar Vc = 65.0; // critical specific volume [cm^3/mol] | |
193 | 101 | const Scalar omega = -0.216; // accentric factor | |
194 | 101 | const Scalar M = molarMass() * 1e3; // molar mas [g/mol] | |
195 | 101 | 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 | 101 | mu_r4 *= mu_r4; | |
201 | |||
202 | using std::pow; | ||
203 | using std::exp; | ||
204 | 101 | Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4; | |
205 | 101 | Scalar Tstar = 1.2593 * temperature/Tc; | |
206 | 101 | Scalar Omega_v = | |
207 | 101 | 1.16145*pow(Tstar, -0.14874) + | |
208 | 101 | 0.52487*exp(- 0.77320*Tstar) + | |
209 | 101 | 2.16178*exp(- 2.43787*Tstar); | |
210 | 101 | Scalar mu = 40.785*Fc*sqrt(M*temperature)/(pow(Vc, 2./3)*Omega_v); | |
211 | |||
212 | // conversion from micro poise to Pa s | ||
213 | 101 | return mu/1e6 / 10; | |
214 | } | ||
215 | }; | ||
216 | |||
217 | /*! | ||
218 | * \brief Shomate parameters for hydrogen published by NIST \cite NIST | ||
219 | * https://webbook.nist.gov/cgi/cbook.cgi?ID=C1333740&Units=SI&Mask=1&Type=JANAFG&Table=on#JANAFG | ||
220 | * First row defines the temperature ranges, further rows give the parameters (A,B,C,D,E,F,G,H) for the respective temperature ranges. | ||
221 | */ | ||
222 | template <class Scalar> | ||
223 | const typename H2<Scalar>::ShomateMethod H2<Scalar>::shomateMethod{ | ||
224 | /*temperature*/{298.0, 1000.0, 2500.0, 6000.0}, | ||
225 | typename H2<Scalar>::ShomateMethod::Coefficients{{ | ||
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 | ||
235 |