version 3.10.0
Loading...
Searching...
No Matches
n2.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_N2_HH
13#define DUMUX_N2_HH
14
16
17#include <cmath>
18
22
23namespace Dumux::Components {
24
31template <class Scalar>
32class N2
33: public Components::Base<Scalar, N2<Scalar> >
34, public Components::Gas<Scalar, N2<Scalar> >
35{
36 using IdealGas = Dumux::IdealGas<Scalar>;
37 using ShomateMethod = Dumux::ShomateMethod<Scalar, 3>; // 3 regions
38
39public:
40 static const ShomateMethod shomateMethod;
44 static std::string name()
45 { return "N2"; }
46
50 static constexpr Scalar molarMass()
51 { return 28.0134e-3;}
52
57 { return 126.192; /* [K] */ }
58
63 { return 3.39858e6; /* [N/m^2] */ }
64
69 { return 63.151; /* [K] */ }
70
75 { return 12.523e3; /* [N/m^2] */ }
76
88 {
89 if (T > criticalTemperature())
90 return criticalPressure();
91 if (T < tripleTemperature())
92 return 0; // N2 is solid: We don't take sublimation into
93 // account
94
95 // note: this is the ancillary equation given on page 1368
96 using std::sqrt;
97 Scalar sigma = Scalar(1.0) - T/criticalTemperature();
98 Scalar sqrtSigma = sqrt(sigma);
99 const Scalar N1 = -6.12445284;
100 const Scalar N2 = 1.26327220;
101 const Scalar N3 = -0.765910082;
102 const Scalar N4 = -1.77570564;
103
104 using std::exp;
105 return
107 exp(criticalTemperature()/T*
108 (sigma*(N1 +
109 sqrtSigma*N2 +
110 sigma*(sqrtSigma*N3 +
111 sigma*sigma*sigma*N4))));
112 }
113
120 static Scalar gasDensity(Scalar temperature, Scalar pressure)
121 {
122 // Assume an ideal gas
123 return IdealGas::density(molarMass(), temperature, pressure);
124 }
125
133 static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
134 { return IdealGas::molarDensity(temperature, pressure); }
135
139 static constexpr bool gasIsCompressible()
140 { return true; }
141
145 static constexpr bool gasIsIdeal()
146 { return true; }
147
154 static Scalar gasPressure(Scalar temperature, Scalar density)
155 {
156 // Assume an ideal gas
157 return IdealGas::pressure(temperature, density/molarMass());
158 }
159
167 static const Scalar gasEnthalpy(Scalar temperature,
168 Scalar pressure)
169 {
170 const auto h = shomateMethod.enthalpy(temperature); // KJ/mol
171 return h * 1e3 / molarMass(); // J/kg
172 }
173
187 static const Scalar gasInternalEnergy(Scalar temperature,
188 Scalar pressure)
189 {
190 return
191 gasEnthalpy(temperature, pressure) -
192 1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
193 IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
194 }
195
201 Scalar pressure)
202 {
203 const auto cp = shomateMethod.heatCapacity(T); // J/(mol K)
204 return cp / molarMass(); // J/(kg K)
205 }
206
220 static Scalar gasViscosity(Scalar temperature, Scalar pressure)
221 {
222 const Scalar Tc = criticalTemperature();
223 const Scalar Vc = 90.1; // critical specific volume [cm^3/mol]
224 const Scalar omega = 0.037; // accentric factor
225 const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
226 const Scalar dipole = 0.0; // dipole moment [debye]
227
228 using std::sqrt;
229 Scalar mu_r4 = 131.3 * dipole / sqrt(Vc * Tc);
230 mu_r4 *= mu_r4;
231 mu_r4 *= mu_r4;
232
233 using std::pow;
234 using std::exp;
235 Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
236 Scalar Tstar = 1.2593 * temperature/Tc;
237 Scalar Omega_v =
238 1.16145*pow(Tstar, -0.14874) +
239 0.52487*exp(- 0.77320*Tstar) +
240 2.16178*exp(- 2.43787*Tstar);
241 Scalar mu = 40.785*Fc*sqrt(M*temperature)/(pow(Vc, 2./3)*Omega_v);
242
243 // conversion from micro poise to Pa s
244 return mu/1e6 / 10;
245 }
246
258 static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
259 {
260 return 6.525e-5 * (temperature - 273.15) + 0.024031;
261 }
262};
263
269template <class Scalar>
270const typename N2<Scalar>::ShomateMethod N2<Scalar>::shomateMethod{
271 /*temperature*/{100.0,500.0,2000.0,6000.0},
273 {28.98641, 1.853978, -9.647459, 16.63537, 0.000117, -8.671914, 226.4168, 0.0},
274 {19.50583, 19.88705, -8.598535, 1.369784, 0.527601, -4.935202, 212.39, 0.0},
275 {35.51872, 1.128728, -0.196103, 0.014662, -4.55376, -18.97091, 224.981, 0.0}
276 }}
277};
278
279} // end namespace Dumux::Components
280
281#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
Interface for components that have a gas state.
Definition gas.hh:28
Properties of pure molecular nitrogen .
Definition n2.hh:35
static Scalar criticalTemperature()
Returns the critical temperature of molecular nitrogen.
Definition n2.hh:56
static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure nitrogen gas.
Definition n2.hh:187
static Scalar criticalPressure()
Returns the critical pressure of molecular nitrogen.
Definition n2.hh:62
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of at a given pressure and temperature.
Definition n2.hh:220
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of gas in at a given pressure and temperature.
Definition n2.hh:133
static std::string name()
A human readable name for nitrogen.
Definition n2.hh:44
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of gas at a given pressure and temperature.
Definition n2.hh:120
static constexpr Scalar molarMass()
The molar mass in of molecular nitrogen.
Definition n2.hh:50
static Scalar vaporPressure(Scalar T)
The vapor pressure in of pure molecular nitrogen at a given temperature.
Definition n2.hh:87
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of nitrogen.
Definition n2.hh:258
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition n2.hh:145
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition n2.hh:139
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure nitrogen gas. Shomate Equation is used for a temperature range of 100K to ...
Definition n2.hh:167
static const Scalar gasHeatCapacity(Scalar T, Scalar pressure)
Specific isobaric heat capacity of pure nitrogen gas. Shomate Equation is used for a temperature ran...
Definition n2.hh:200
static Scalar tripleTemperature()
Returns the temperature at molecular nitrogen's triple point.
Definition n2.hh:68
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of gaseous in at a given density and temperature.
Definition n2.hh:154
static Scalar triplePressure()
Returns the pressure at molecular nitrogen's triple point.
Definition n2.hh:74
static const ShomateMethod shomateMethod
Definition n2.hh:40
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.