47 static constexpr double brineSalinity = 1.000000000000000e-01;
51 typedef double Scalar;
52 static const char *name;
53 static const int numX = 200;
54 static const Scalar xMin;
55 static const Scalar xMax;
56 static const int numY = 500;
57 static const Scalar yMin;
58 static const Scalar yMax;
60 static const Scalar vals[200][500];
64 typedef double Scalar;
65 static const char *name;
66 static const int numX = 200;
67 static const Scalar xMin;
68 static const Scalar xMax;
69 static const int numY = 500;
70 static const Scalar yMin;
71 static const Scalar yMax;
72 static const Scalar vals[200][500];
88template <
class Scalar>
98 static const Scalar brineSalinity;
110 {
return 2.01588e-3; }
128 {
return 15.508e-3; }
140 {
return 0.00736e6; }
165 template <
class Evaluation>
179 static const Scalar N[4] = {-4.89789, 0.988558, 0.349689, 0.499356};
180 static const Scalar k[4] = {1.0, 1.5, 2.0, 2.85};
184 for (
int i = 0; i < 4; ++i) {
185 s += N[i] * pow(sigma, k[i]);
187 Evaluation lnPsigmaPc = T_recp * s;
198 template <
class Evaluation>
199 static Evaluation
gasDensity(Evaluation temperature, Evaluation pressure,
bool extrapolate =
false)
201 return tabulatedDensity.
eval(temperature, pressure, extrapolate);
210 template <
class Evaluation>
211 static Evaluation
gasMolarDensity(Evaluation temperature, Evaluation pressure,
bool extrapolate =
false)
232 template <
class Evaluation>
233 static Evaluation
gasPressure(Evaluation temperature, Evaluation density)
246 template <
class Evaluation>
248 const Evaluation& pressure,
249 bool extrapolate =
false)
251 const Evaluation h =
gasEnthalpy(temperature, pressure, extrapolate);
252 const Evaluation rho =
gasDensity(temperature, pressure, extrapolate);
254 return h - (pressure / rho);
263 template <
class Evaluation>
266 bool extrapolate =
false)
268 return tabulatedEnthalpy.
eval(temperature, pressure, extrapolate);
280 template <
class Evaluation>
282 const Evaluation& pressure,
283 bool extrapolate =
false)
287 const Scalar epsilon_div_kb = 30.41;
288 const Scalar sigma = 0.297;
289 const Scalar Na = 6.022137e23;
291 Evaluation T_star = temperature / epsilon_div_kb;
292 Evaluation ln_T_star = log(T_star);
294 Evaluation rho =
gasDensity(temperature, pressure, extrapolate);
295 Evaluation rho_r = rho / 90.909090909;
301 static constexpr Scalar a[5] =
302 {2.0963e-1, -4.55274e-1, 1.43602e-1, -3.35325e-2, 2.76981e-3};
305 Evaluation ln_S_star = 0.0;
306 for (
int i = 0; i < 5; ++i) {
307 ln_S_star += a[i] * pow(ln_T_star, i);
311 Evaluation eta_0 = 0.021357 * sqrt(M * temperature) / (sigma * sigma * exp(ln_S_star));
318 static constexpr Scalar b[7] =
319 {-0.187, 2.4871, 3.7151, -11.0972, 9.0965, -3.8292, 0.5166};
322 Evaluation B_star = 0.0;
323 for (
int i = 0; i < 7; ++i) {
324 B_star += b[i] * pow(T_star, -i);
330 const Scalar sigma_m = sigma * 1e-9;
331 Evaluation eta_1 = B_star * Na * sigma_m * sigma_m * sigma_m * eta_0 * rho / M;
337 static constexpr Scalar c[6] =
338 {6.43449673, 4.56334068e-2, 2.32797868e-1, 9.58326120e-1, 1.27941189e-1, 3.63576595e-1};
341 Evaluation delta_eta_h = c[0] * rho_r * rho_r * exp(c[1] * T_r + c[2] / T_r +
342 (c[3] * rho_r * rho_r) / (c[4] + T_r) + c[5] * pow(rho_r, 6));
345 return (eta_0 + eta_1 + delta_eta_h) * 1e-6;
356 template <
class Evaluation>
376 Evaluation cp = cv + R * (numerator / denominator) /
molarMass();
389 template <
class Evaluation>
411 template <
class Evaluation>
413 const Evaluation& pg,
414 bool extrapolate =
false)
425 template <
class Evaluation>
430 Evaluation s1 = log(rho_red) + 1.5*log(T_red) + a_[0] + a_[1] * T_red;
434 for (
int i = 2; i < 7; ++i) {
435 s1 += a_[i] * log(1 - exp(b_[i-2] * T_red));
439 Evaluation s = s1 + s2;
448 template <
class Evaluation>
454 Evaluation s1 = (1.5 / T_red) + a_[1];
458 for (
int i = 2; i < 7; ++i) {
459 s2 += (-a_[i] * b_[i-2] * exp(b_[i-2] * T_red)) / (1 - exp(b_[i-2] * T_red));
463 Evaluation s = s1 + s2;
473 template <
class Evaluation>
480 for (
int i = 2; i < 7; ++i) {
481 s1 += (-a_[i] * pow(b_[i-2], 2) * exp(b_[i-2] * T_red)) / pow(1 - exp(b_[i-2] * T_red), 2);
485 Evaluation s = (-1.5 / pow(T_red, 2)) + s1;
495 template <
class Evaluation>
501 for (
int i = 0; i < 7; ++i) {
502 s1 += N_[i] * pow(rho_red, d_[i]) * pow(T_red, t_[i]);
507 for (
int i = 7; i < 9; ++i) {
508 s2 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]) * exp(-pow(rho_red, p_[i-7]));
513 for (
int i = 9; i < 14; ++i) {
514 s3 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]) *
515 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2));
519 Evaluation s = s1 + s2 + s3;
529 template <
class Evaluation>
535 for (
int i = 0; i < 7; ++i) {
536 s1 += d_[i] * N_[i] * pow(rho_red, d_[i]-1) * pow(T_red, t_[i]);
541 for (
int i = 7; i < 9; ++i) {
542 s2 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]-1) * exp(-pow(rho_red, p_[i-7])) *
543 (d_[i] - p_[i-7]*pow(rho_red, p_[i-7]));
548 for (
int i = 9; i < 14; ++i) {
549 s3 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]-1) *
550 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2)) *
551 (d_[i] + 2 * phi_[i-9] * rho_red * (rho_red - D_[i-9]));
555 Evaluation s = s1 + s2 + s3;
565 template <
class Evaluation>
572 for (
int i = 0; i < 7; ++i) {
573 s1 += d_[i] * (d_[i] - 1) * N_[i] * pow(rho_red, d_[i]-2) * pow(T_red, t_[i]);
578 for (
int i = 7; i < 9; ++i) {
579 s2 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]-2) * exp(-pow(rho_red, p_[i-7])) *
580 ((d_[i] - p_[i-7] * pow(rho_red, p_[i-7])) * (d_[i] - p_[i-7] * pow(rho_red, p_[i-7]) - 1.0)
581 - pow(p_[i-7], 2) * pow(rho_red, p_[i-7]));
586 for (
int i = 9; i < 14; ++i) {
587 s3 += N_[i] * pow(T_red, t_[i]) * pow(rho_red, d_[i]-2) *
588 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2)) *
589 (pow(d_[i] + 2 * phi_[i-9] * rho_red * (rho_red - D_[i-9]), 2)
590 - d_[i] + 2 * phi_[i-9] * pow(rho_red, 2));
594 Evaluation s = s1 + s2 + s3;
604 template <
class Evaluation>
611 for (
int i = 0; i < 7; ++i) {
612 s1 += t_[i] * N_[i] * pow(rho_red, d_[i]) * pow(T_red, t_[i]-1);
617 for (
int i = 7; i < 9; ++i) {
618 s2 += t_[i] * N_[i] * pow(T_red, t_[i]-1) * pow(rho_red, d_[i]) * exp(-pow(rho_red, p_[i-7]));
623 for (
int i = 9; i < 14; ++i) {
624 s3 += N_[i] * pow(T_red, t_[i]-1) * pow(rho_red, d_[i]) *
625 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2)) *
626 (t_[i] + 2 * beta_[i-9] * T_red * (T_red - gamma_[i-9]));
630 Evaluation s = s1 + s2 + s3;
640 template <
class Evaluation>
647 for (
int i = 0; i < 7; ++i) {
648 s1 += t_[i] * (t_[i] - 1) * N_[i] * pow(rho_red, d_[i]) * pow(T_red, t_[i]-2);
653 for (
int i = 7; i < 9; ++i) {
654 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]));
659 for (
int i = 9; i < 14; ++i) {
660 s3 += N_[i] * pow(T_red, t_[i]-2) * pow(rho_red, d_[i]) *
661 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2)) *
662 (pow(t_[i] + 2 * beta_[i-9] * T_red * (T_red - gamma_[i-9]), 2)
663 - t_[i] + 2 * beta_[i-9] * pow(T_red, 2));
667 Evaluation s = s1 + s2 + s3;
678 template <
class Evaluation>
685 for (
int i = 0; i < 7; ++i) {
686 s1 += t_[i] * d_[i] * N_[i] * pow(rho_red, d_[i]-1) * pow(T_red, t_[i]-1);
691 for (
int i = 7; i < 9; ++i) {
692 s2 += t_[i] * N_[i] * pow(T_red, t_[i]-1) * pow(rho_red, d_[i]-1) * exp(-pow(rho_red, p_[i-7]))
693 * (d_[i] - p_[i-7] * pow(rho_red, p_[i-7]));
698 for (
int i = 9; i < 14; ++i) {
699 s3 += N_[i] * pow(T_red, t_[i]-1) * pow(rho_red, d_[i]-1) *
700 exp(phi_[i-9] * pow(rho_red - D_[i-9], 2) + beta_[i-9] * pow(T_red - gamma_[i-9], 2)) *
701 (t_[i] + 2 * beta_[i-9] * T_red * (T_red - gamma_[i-9]))
702 * (d_[i] + 2 * phi_[i-9] * rho_red * (rho_red - D_[i-9]));
706 Evaluation s = s1 + s2 + s3;
713 static constexpr Scalar a_[7] = {-1.4579856475, 1.888076782, 1.616, -0.4117, -0.792, 0.758, 1.217};
714 static constexpr Scalar b_[5] = {-16.0205159149, -22.6580178006, -60.0090511389, -74.9434303817, -206.9392065168};
717 static constexpr Scalar N_[14] = {-6.93643, 0.01, 2.1101, 4.52059, 0.732564, -1.34086, 0.130985, -0.777414,
718 0.351944, -0.0211716, 0.0226312, 0.032187, -0.0231752, 0.0557346};
719 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,
720 0.791, 7.249, 2.986};
721 static constexpr Scalar d_[14] = {1, 4, 1, 1, 2, 2, 3, 1, 3, 2, 1, 3, 1, 1};
722 static constexpr Scalar p_[2] = {1, 1};
723 static constexpr Scalar phi_[5] = {-1.685, -0.489, -0.103, -2.506, -1.607};
724 static constexpr Scalar beta_[5] = {-0.1710, -0.2245, -0.1304, -0.2785, -0.3967};
725 static constexpr Scalar gamma_[5] = {0.7164, 1.3444, 1.4517, 0.7204, 1.5445};
726 static constexpr Scalar D_[5] = {1.506, 0.156, 1.736, 0.670, 1.662};
736 template <
class Evaluation>
737 static Evaluation rootFindingObj_(
const Evaluation& rho_red,
const Evaluation& temperature,
const Evaluation& pg)
741 Evaluation p_MPa = pg / 1.0e6;
747 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:90
static Evaluation secDerivResHelmholtzWrtRedRho(const Evaluation &T_red, const Evaluation &rho_red)
Second derivative of the residual part of Helmholtz energy wrt.
Definition H2.hpp:566
static std::string name()
A human readable name for the .
Definition H2.hpp:103
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:679
static Evaluation vaporPressure(Evaluation temperature)
The vapor pressure in of pure molecular hydrogen at a given temperature.
Definition H2.hpp:166
static Evaluation residualPartHelmholtz(const Evaluation &T_red, const Evaluation &rho_red)
The residual part of Helmholtz energy.
Definition H2.hpp:496
static Scalar criticalTemperature()
Returns the critical temperature of molecular hydrogen.
Definition H2.hpp:115
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition H2.hpp:223
static Scalar tripleDensity()
Returns the density of molecular hydrogen's triple point.
Definition H2.hpp:145
static Scalar acentricFactor()
Acentric factor of .
Definition H2.hpp:156
static Scalar criticalDensity()
Returns the critical density of molecular hydrogen.
Definition H2.hpp:127
static const Evaluation gasIsochoricHeatCapacity(Evaluation temperature, Evaluation pressure)
Specific isochoric heat capacity of pure hydrogen gas.
Definition H2.hpp:390
static Evaluation secDerivResHelmholtzWrtRecipRedTemp(const Evaluation &T_red, const Evaluation &rho_red)
Second derivative of the residual part of Helmholtz energy wrt.
Definition H2.hpp:641
static Scalar criticalPressure()
Returns the critical pressure of molecular hydrogen.
Definition H2.hpp:121
static Evaluation gasPressure(Evaluation temperature, Evaluation density)
The pressure of gaseous in at a given density and temperature.
Definition H2.hpp:233
static Scalar tripleTemperature()
Returns the temperature at molecular hydrogen's triple point.
Definition H2.hpp:133
static Evaluation idealGasPartHelmholtz(const Evaluation &T_red, const Evaluation &rho_red)
The ideal-gas part of Helmholtz energy.
Definition H2.hpp:426
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:412
static Evaluation derivResHelmholtzWrtRedRho(const Evaluation &T_red, const Evaluation &rho_red)
Derivative of the residual part of Helmholtz energy wrt.
Definition H2.hpp:530
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
Specific internal energy of H2 [J/kg].
Definition H2.hpp:247
static const Evaluation gasHeatCapacity(Evaluation temperature, Evaluation pressure)
Specific isobaric heat capacity of pure hydrogen gas.
Definition H2.hpp:357
static Scalar criticalVolume()
Critical volume of [m2/kmol].
Definition H2.hpp:151
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:281
static Evaluation derivResHelmholtzWrtRecipRedTemp(const Evaluation &T_red, const Evaluation &rho_red)
Derivative of the residual part of Helmholtz energy wrt.
Definition H2.hpp:605
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition H2.hpp:217
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:474
static constexpr Scalar molarMass()
The molar mass in of molecular hydrogen.
Definition H2.hpp:109
static Scalar triplePressure()
Returns the pressure of molecular hydrogen's triple point.
Definition H2.hpp:139
static Evaluation gasDensity(Evaluation temperature, Evaluation pressure, bool extrapolate=false)
The density of at a given pressure and temperature.
Definition H2.hpp:199
static Evaluation gasMolarDensity(Evaluation temperature, Evaluation pressure, bool extrapolate=false)
The molar density of in , depending on pressure and temperature.
Definition H2.hpp:211
static Evaluation derivIdealHelmholtzWrtRecipRedTemp(const Evaluation &T_red)
Derivative of the ideal-gas part of Helmholtz energy wrt to reciprocal reduced temperature.
Definition H2.hpp:449
static const Evaluation gasEnthalpy(Evaluation temperature, Evaluation pressure, bool extrapolate=false)
Specific enthalpy of pure hydrogen gas.
Definition H2.hpp:264
Relations valid for an ideal gas.
Definition IdealGas.hpp:39
static constexpr Scalar R
The ideal gas constant .
Definition IdealGas.hpp:42
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30