56template <
class Scalar>
66 static const Scalar brineSalinity;
78 {
return 2.01588e-3; }
108 {
return 0.00736e6; }
133 template <
class Evaluation>
147 static const Scalar N[4] = {-4.89789, 0.988558, 0.349689, 0.499356};
148 static const Scalar k[4] = {1.0, 1.5, 2.0, 2.85};
152 for (
int i = 0; i < 4; ++i) {
153 s += N[i] * pow(sigma, k[i]);
155 Evaluation lnPsigmaPc = T_recp * s;
166 template <
class Evaluation>
167 static Evaluation
gasDensity(Evaluation temperature, Evaluation pressure,
bool extrapolate =
false)
169 return tabulatedDensity.
eval(temperature, pressure, extrapolate);
178 template <
class Evaluation>
179 static Evaluation
gasMolarDensity(Evaluation temperature, Evaluation pressure,
bool extrapolate =
false)
200 template <
class Evaluation>
201 static Evaluation
gasPressure(Evaluation temperature, Evaluation density)
214 template <
class Evaluation>
216 const Evaluation& pressure,
217 bool extrapolate =
false)
219 const Evaluation h =
gasEnthalpy(temperature, pressure, extrapolate);
220 const Evaluation rho =
gasDensity(temperature, pressure, extrapolate);
222 return h - (pressure / rho);
231 template <
class Evaluation>
234 bool extrapolate =
false)
236 return tabulatedEnthalpy.
eval(temperature, pressure, extrapolate);
248 template <
class Evaluation>
250 const Evaluation& pressure,
251 bool extrapolate =
false)
255 const Scalar epsilon_div_kb = 30.41;
256 const Scalar sigma = 0.297;
257 const Scalar Na = 6.022137e23;
259 Evaluation T_star = temperature / epsilon_div_kb;
260 Evaluation ln_T_star = log(T_star);
262 Evaluation rho =
gasDensity(temperature, pressure, extrapolate);
263 Evaluation rho_r = rho / 90.909090909;
269 static constexpr Scalar a[5] =
270 {2.0963e-1, -4.55274e-1, 1.43602e-1, -3.35325e-2, 2.76981e-3};
273 Evaluation ln_S_star = 0.0;
274 for (
int i = 0; i < 5; ++i) {
275 ln_S_star += a[i] * pow(ln_T_star, i);
279 Evaluation eta_0 = 0.021357 * sqrt(M * temperature) / (sigma * sigma * exp(ln_S_star));
286 static constexpr Scalar b[7] =
287 {-0.187, 2.4871, 3.7151, -11.0972, 9.0965, -3.8292, 0.5166};
290 Evaluation B_star = 0.0;
291 for (
int i = 0; i < 7; ++i) {
292 B_star += b[i] * pow(T_star, -i);
298 const Scalar sigma_m = sigma * 1e-9;
299 Evaluation eta_1 = B_star * Na * sigma_m * sigma_m * sigma_m * eta_0 * rho / M;
305 static constexpr Scalar c[6] =
306 {6.43449673, 4.56334068e-2, 2.32797868e-1, 9.58326120e-1, 1.27941189e-1, 3.63576595e-1};
309 Evaluation delta_eta_h = c[0] * rho_r * rho_r * exp(c[1] * T_r + c[2] / T_r +
310 (c[3] * rho_r * rho_r) / (c[4] + T_r) + c[5] * pow(rho_r, 6));
313 return (eta_0 + eta_1 + delta_eta_h) * 1e-6;
324 template <
class Evaluation>
344 Evaluation cp = cv + R * (numerator / denominator) /
molarMass();
357 template <
class Evaluation>
379 template <
class Evaluation>
381 const Evaluation& pg,
382 bool extrapolate =
false)
393 template <
class Evaluation>
398 Evaluation s1 = log(rho_red) + 1.5*log(T_red) + a_[0] + a_[1] * T_red;
402 for (
int i = 2; i < 7; ++i) {
403 s1 += a_[i] * log(1 - exp(b_[i-2] * T_red));
407 Evaluation s = s1 + s2;
416 template <
class Evaluation>
422 Evaluation s1 = (1.5 / T_red) + a_[1];
426 for (
int i = 2; i < 7; ++i) {
427 s2 += (-a_[i] * b_[i-2] * exp(b_[i-2] * T_red)) / (1 - exp(b_[i-2] * T_red));
431 Evaluation s = s1 + s2;
441 template <
class Evaluation>
448 for (
int i = 2; i < 7; ++i) {
449 s1 += (-a_[i] * pow(b_[i-2], 2) * exp(b_[i-2] * T_red)) / pow(1 - exp(b_[i-2] * T_red), 2);
453 Evaluation s = (-1.5 / pow(T_red, 2)) + s1;
463 template <
class Evaluation>
469 for (
int i = 0; i < 7; ++i) {
470 s1 += N_[i] * pow(rho_red, d_[i]) * pow(T_red, t_[i]);
475 for (
int i = 7; i < 9; ++i) {
476 s2 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]) * exp(-pow(rho_red, p_[i-7]));
481 for (
int i = 9; i < 14; ++i) {
482 s3 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]) *
483 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2));
487 Evaluation s = s1 + s2 + s3;
497 template <
class Evaluation>
503 for (
int i = 0; i < 7; ++i) {
504 s1 += d_[i] * N_[i] * pow(rho_red, d_[i]-1) * pow(T_red, t_[i]);
509 for (
int i = 7; i < 9; ++i) {
510 s2 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]-1) * exp(-pow(rho_red, p_[i-7])) *
511 (d_[i] - p_[i-7]*pow(rho_red, p_[i-7]));
516 for (
int i = 9; i < 14; ++i) {
517 s3 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]-1) *
518 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2)) *
519 (d_[i] + 2 * phi_[i-9] * rho_red * (rho_red - D_[i-9]));
523 Evaluation s = s1 + s2 + s3;
533 template <
class Evaluation>
540 for (
int i = 0; i < 7; ++i) {
541 s1 += d_[i] * (d_[i] - 1) * N_[i] * pow(rho_red, d_[i]-2) * pow(T_red, t_[i]);
546 for (
int i = 7; i < 9; ++i) {
547 s2 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]-2) * exp(-pow(rho_red, p_[i-7])) *
548 ((d_[i] - p_[i-7] * pow(rho_red, p_[i-7])) * (d_[i] - p_[i-7] * pow(rho_red, p_[i-7]) - 1.0)
549 - pow(p_[i-7], 2) * pow(rho_red, p_[i-7]));
554 for (
int i = 9; i < 14; ++i) {
555 s3 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]-2) *
556 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2)) *
557 (pow(d_[i] + 2 * phi_[i-9] * rho_red * (rho_red - D_[i-9]), 2)
558 - d_[i] + 2 * phi_[i-9] * pow(rho_red, 2));
562 Evaluation s = s1 + s2 + s3;
572 template <
class Evaluation>
579 for (
int i = 0; i < 7; ++i) {
580 s1 += t_[i] * N_[i] * pow(rho_red, d_[i]) * pow(T_red, t_[i]-1);
585 for (
int i = 7; i < 9; ++i) {
586 s2 += t_[i] * N_[i] * pow(T_red, t_[i]-1) * pow(rho_red, d_[i]) * exp(-pow(rho_red, p_[i-7]));
591 for (
int i = 9; i < 14; ++i) {
592 s3 += N_[i] * pow(T_red, t_[i]-1) * pow(rho_red, d_[i]) *
593 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2)) *
594 (t_[i] + 2 * beta_[i-9] * T_red * (T_red - gamma_[i-9]));
598 Evaluation s = s1 + s2 + s3;
608 template <
class Evaluation>
615 for (
int i = 0; i < 7; ++i) {
616 s1 += t_[i] * (t_[i] - 1) * N_[i] * pow(rho_red, d_[i]) * pow(T_red, t_[i]-2);
621 for (
int i = 7; i < 9; ++i) {
622 s2 += t_[i] * (t_[i] - 1) * N_[i] * pow(T_red, t_[i]-2) * pow(rho_red, d_[i]) * exp(-pow(rho_red, p_[i-7]));
627 for (
int i = 9; i < 14; ++i) {
628 s3 += N_[i] * pow(T_red, t_[i]-2) * pow(rho_red, d_[i]) *
629 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2)) *
630 (pow(t_[i] + 2 * beta_[i-9] * T_red * (T_red - gamma_[i-9]), 2)
631 - t_[i] + 2 * beta_[i-9] * pow(T_red, 2));
635 Evaluation s = s1 + s2 + s3;
646 template <
class Evaluation>
653 for (
int i = 0; i < 7; ++i) {
654 s1 += t_[i] * d_[i] * N_[i] * pow(rho_red, d_[i]-1) * pow(T_red, t_[i]-1);
659 for (
int i = 7; i < 9; ++i) {
660 s2 += t_[i] * N_[i] * pow(T_red, t_[i]-1) * pow(rho_red, d_[i]-1) * exp(-pow(rho_red, p_[i-7]))
661 * (d_[i] - p_[i-7] * pow(rho_red, p_[i-7]));
666 for (
int i = 9; i < 14; ++i) {
667 s3 += N_[i] * pow(T_red, t_[i]-1) * pow(rho_red, d_[i]-1) *
668 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2)) *
669 (t_[i] + 2 * beta_[i-9] * T_red * (T_red - gamma_[i-9]))
670 * (d_[i] + 2 * phi_[i-9] * rho_red * (rho_red - D_[i-9]));
674 Evaluation s = s1 + s2 + s3;
681 static constexpr Scalar a_[7] = {-1.4579856475, 1.888076782, 1.616, -0.4117, -0.792, 0.758, 1.217};
682 static constexpr Scalar b_[5] = {-16.0205159149, -22.6580178006, -60.0090511389, -74.9434303817, -206.9392065168};
685 static constexpr Scalar N_[14] = {-6.93643, 0.01, 2.1101, 4.52059, 0.732564, -1.34086, 0.130985, -0.777414,
686 0.351944, -0.0211716, 0.0226312, 0.032187, -0.0231752, 0.0557346};
687 static constexpr Scalar t_[14] = {0.6844, 1.0, 0.989, 0.489, 0.803, 1.1444, 1.409, 1.754, 1.311, 4.187, 5.646,
688 0.791, 7.249, 2.986};
689 static constexpr Scalar d_[14] = {1, 4, 1, 1, 2, 2, 3, 1, 3, 2, 1, 3, 1, 1};
690 static constexpr Scalar p_[2] = {1, 1};
691 static constexpr Scalar phi_[5] = {-1.685, -0.489, -0.103, -2.506, -1.607};
692 static constexpr Scalar beta_[5] = {-0.1710, -0.2245, -0.1304, -0.2785, -0.3967};
693 static constexpr Scalar gamma_[5] = {0.7164, 1.3444, 1.4517, 0.7204, 1.5445};
694 static constexpr Scalar D_[5] = {1.506, 0.156, 1.736, 0.670, 1.662};
703 template <
class Evaluation>
704 static Evaluation rootFindingObj_(
const Evaluation& rho_red,
const Evaluation& temperature,
const Evaluation& pg)
708 Evaluation p_MPa = pg / 1.0e6;
714 Evaluation obj = rho_red * rho_cRT * (1 + rho_red * dResHelm_dRedRho) - p_MPa;
Abstract base class of a pure chemical species.
Relations valid for an ideal gas.
A number of commonly used algebraic functions for the localized OPM automatic differentiation (AD) fr...
Abstract base class of a pure chemical species.
Definition Component.hpp:44
Properties of pure molecular hydrogen .
Definition H2.hpp:58
static Evaluation secDerivResHelmholtzWrtRedRho(const Evaluation &T_red, const Evaluation &rho_red)
Second derivative of the residual part of Helmholtz energy wrt.
Definition H2.hpp:534
static std::string name()
A human readable name for the .
Definition H2.hpp:71
static Evaluation secDerivResHelmholtzWrtRecipRedTempAndRedRho(const Evaluation &T_red, const Evaluation &rho_red)
Second derivative of the residual part of Helmholtz energy first wrt.
Definition H2.hpp:647
static Evaluation vaporPressure(Evaluation temperature)
The vapor pressure in of pure molecular hydrogen at a given temperature.
Definition H2.hpp:134
static Evaluation residualPartHelmholtz(const Evaluation &T_red, const Evaluation &rho_red)
The residual part of Helmholtz energy.
Definition H2.hpp:464
static Scalar criticalTemperature()
Returns the critical temperature of molecular hydrogen.
Definition H2.hpp:83
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition H2.hpp:191
static Scalar tripleDensity()
Returns the density of molecular hydrogen's triple point.
Definition H2.hpp:113
static Scalar acentricFactor()
Acentric factor of .
Definition H2.hpp:124
static Scalar criticalDensity()
Returns the critical density of molecular hydrogen.
Definition H2.hpp:95
static const Evaluation gasIsochoricHeatCapacity(Evaluation temperature, Evaluation pressure)
Specific isochoric heat capacity of pure hydrogen gas.
Definition H2.hpp:358
static Evaluation secDerivResHelmholtzWrtRecipRedTemp(const Evaluation &T_red, const Evaluation &rho_red)
Second derivative of the residual part of Helmholtz energy wrt.
Definition H2.hpp:609
static Scalar criticalPressure()
Returns the critical pressure of molecular hydrogen.
Definition H2.hpp:89
static Evaluation gasPressure(Evaluation temperature, Evaluation density)
The pressure of gaseous in at a given density and temperature.
Definition H2.hpp:201
static Scalar tripleTemperature()
Returns the temperature at molecular hydrogen's triple point.
Definition H2.hpp:101
static Evaluation idealGasPartHelmholtz(const Evaluation &T_red, const Evaluation &rho_red)
The ideal-gas part of Helmholtz energy.
Definition H2.hpp:394
static Evaluation reducedMolarDensity(const Evaluation &temperature, const Evaluation &pg, bool extrapolate=false)
Calculate reduced density (rho/rho_crit) from pressure and temperature.
Definition H2.hpp:380
static Evaluation derivResHelmholtzWrtRedRho(const Evaluation &T_red, const Evaluation &rho_red)
Derivative of the residual part of Helmholtz energy wrt.
Definition H2.hpp:498
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
Specific internal energy of H2 [J/kg].
Definition H2.hpp:215
static const Evaluation gasHeatCapacity(Evaluation temperature, Evaluation pressure)
Specific isobaric heat capacity of pure hydrogen gas.
Definition H2.hpp:325
static Scalar criticalVolume()
Critical volume of [m2/kmol].
Definition H2.hpp:119
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
The dynamic viscosity of at a given pressure and temperature.
Definition H2.hpp:249
static Evaluation derivResHelmholtzWrtRecipRedTemp(const Evaluation &T_red, const Evaluation &rho_red)
Derivative of the residual part of Helmholtz energy wrt.
Definition H2.hpp:573
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition H2.hpp:185
static Evaluation secDerivIdealHelmholtzWrtRecipRedTemp(const Evaluation &T_red)
Second derivative of the ideal-gas part of Helmholtz energy wrt to reciprocal reduced temperature.
Definition H2.hpp:442
static constexpr Scalar molarMass()
The molar mass in of molecular hydrogen.
Definition H2.hpp:77
static Scalar triplePressure()
Returns the pressure of molecular hydrogen's triple point.
Definition H2.hpp:107
static Evaluation gasDensity(Evaluation temperature, Evaluation pressure, bool extrapolate=false)
The density of at a given pressure and temperature.
Definition H2.hpp:167
static Evaluation gasMolarDensity(Evaluation temperature, Evaluation pressure, bool extrapolate=false)
The molar density of in , depending on pressure and temperature.
Definition H2.hpp:179
static Evaluation derivIdealHelmholtzWrtRecipRedTemp(const Evaluation &T_red)
Derivative of the ideal-gas part of Helmholtz energy wrt to reciprocal reduced temperature.
Definition H2.hpp:417
static const Evaluation gasEnthalpy(Evaluation temperature, Evaluation pressure, bool extrapolate=false)
Specific enthalpy of pure hydrogen gas.
Definition H2.hpp:232
Relations valid for an ideal gas.
Definition IdealGas.hpp:38
static const Scalar R
The ideal gas constant .
Definition IdealGas.hpp:41
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30