My Project
Loading...
Searching...
No Matches
H2.hpp
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 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
31#ifndef OPM_H2_HPP
32#define OPM_H2_HPP
33
38
39#include <cmath>
40
41namespace Opm {
42
56template <class Scalar>
57class H2 : public Component<Scalar, H2<Scalar> >
58{
60
61 static const UniformTabulated2DFunction<double>& tabulatedEnthalpy;
62 static const UniformTabulated2DFunction<double>& tabulatedDensity;
63
64public:
65 // For H2Tables class
66 static const Scalar brineSalinity;
67
71 static std::string name()
72 { return "H2"; }
73
77 static constexpr Scalar molarMass()
78 { return 2.01588e-3; }
79
83 static Scalar criticalTemperature()
84 { return 33.145; /* [K] */ }
85
89 static Scalar criticalPressure()
90 { return 1.2964e6; /* [N/m^2] */ }
91
95 static Scalar criticalDensity()
96 { return 15.508e-3; /* [mol/cm^3] */ }
97
101 static Scalar tripleTemperature()
102 { return 13.957; /* [K] */ }
103
107 static Scalar triplePressure()
108 { return 0.00736e6; /* [N/m^2] */ }
109
113 static Scalar tripleDensity()
114 { return 38.2e-3; /* [mol/cm^3] */ }
115
119 static Scalar criticalVolume() {return 6.45e-2; }
120
124 static Scalar acentricFactor() { return -0.22; }
125
133 template <class Evaluation>
134 static Evaluation vaporPressure(Evaluation temperature)
135 {
136 if (temperature > criticalTemperature())
137 return criticalPressure();
138 if (temperature < tripleTemperature())
139 return 0; // H2 is solid: We don't take sublimation into
140 // account
141
142 // Intermediate calculations involving temperature
143 Evaluation sigma = 1 - temperature/criticalTemperature();
144 Evaluation T_recp = criticalTemperature() / temperature;
145
146 // Parameters for normal hydrogen in Table 8
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};
149
150 // Eq. (33)
151 Evaluation s = 0.0; // sum calculation
152 for (int i = 0; i < 4; ++i) {
153 s += N[i] * pow(sigma, k[i]);
154 }
155 Evaluation lnPsigmaPc = T_recp * s;
156
157 return exp(lnPsigmaPc) * criticalPressure();
158 }
159
166 template <class Evaluation>
167 static Evaluation gasDensity(Evaluation temperature, Evaluation pressure, bool extrapolate = false)
168 {
169 return tabulatedDensity.eval(temperature, pressure, extrapolate);
170 }
171
178 template <class Evaluation>
179 static Evaluation gasMolarDensity(Evaluation temperature, Evaluation pressure, bool extrapolate = false)
180 { return gasDensity(temperature, pressure, extrapolate) / molarMass(); }
181
185 static constexpr bool gasIsCompressible()
186 { return true; }
187
191 static constexpr bool gasIsIdeal()
192 { return false; }
193
200 template <class Evaluation>
201 static Evaluation gasPressure(Evaluation temperature, Evaluation density)
202 {
203 // Eq. (56) in Span et al. (2000)
204 Scalar R = IdealGas::R;
205 Evaluation rho_red = density / (molarMass() * criticalDensity() * 1e6);
206 Evaluation T_red = H2::criticalTemperature() / temperature;
207 return rho_red * criticalDensity() * R * temperature
208 * (1 + rho_red * derivResHelmholtzWrtRedRho(T_red, rho_red));
209 }
210
214 template <class Evaluation>
215 static Evaluation gasInternalEnergy(const Evaluation& temperature,
216 const Evaluation& pressure,
217 bool extrapolate = false)
218 {
219 const Evaluation h = gasEnthalpy(temperature, pressure, extrapolate);
220 const Evaluation rho = gasDensity(temperature, pressure, extrapolate);
221
222 return h - (pressure / rho);
223 }
224
231 template <class Evaluation>
232 static const Evaluation gasEnthalpy(Evaluation temperature,
233 Evaluation pressure,
234 bool extrapolate = false)
235 {
236 return tabulatedEnthalpy.eval(temperature, pressure, extrapolate);
237 }
238
248 template <class Evaluation>
249 static Evaluation gasViscosity(const Evaluation& temperature,
250 const Evaluation& pressure,
251 bool extrapolate = false)
252 {
253 // Some needed parameters and variables
254 const Scalar M = molarMass() * 1e3; // g/mol
255 const Scalar epsilon_div_kb = 30.41;
256 const Scalar sigma = 0.297; // nm
257 const Scalar Na = 6.022137e23; // Avogadro's number
258
259 Evaluation T_star = temperature / epsilon_div_kb;
260 Evaluation ln_T_star = log(T_star);
261 Evaluation T_r = temperature / criticalTemperature();
262 Evaluation rho = gasDensity(temperature, pressure, extrapolate);
263 Evaluation rho_r = rho / 90.909090909; // see corrections
264
265 //
266 // Eta_0 terms (zero-density viscocity)
267 //
268 // Parameters in Table 2 for Eq. (4)
269 static constexpr Scalar a[5] =
270 {2.0963e-1, -4.55274e-1, 1.43602e-1, -3.35325e-2, 2.76981e-3};
271
272 // Eq. (4)
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);
276 }
277
278 // Eq. (3)
279 Evaluation eta_0 = 0.021357 * sqrt(M * temperature) / (sigma * sigma * exp(ln_S_star));
280
281 //
282 // Eta_1 terms (excess contribution)
283 //
284 //
285 // Parameters in Table 3 for Eq. (7)
286 static constexpr Scalar b[7] =
287 {-0.187, 2.4871, 3.7151, -11.0972, 9.0965, -3.8292, 0.5166};
288
289 // Eq. (7) with corrections
290 Evaluation B_star = 0.0;
291 for (int i = 0; i < 7; ++i) {
292 B_star += b[i] * pow(T_star, -i);
293 }
294
295 // Eq. (9) (eta_1 part) using Eq. (5-7) with corrections and sigma in m (instead of nm). Note that Na * sigma_m
296 // ^ 3 have unit [m3/mol], so we need to multiply with molar density (= rho / molarMass) and not mass density in
297 // Eq. (9)
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;
300
301 //
302 // delta eta_h terms (higher-order effects)
303 //
304 // Parameters in Table 4 for Eq. (9)
305 static constexpr Scalar c[6] =
306 {6.43449673, 4.56334068e-2, 2.32797868e-1, 9.58326120e-1, 1.27941189e-1, 3.63576595e-1};
307
308 // delta eta_h terms in Eq. (9)
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));
311
312 // return all terms in Eq. (9) converted from muPa*s to Pa*s
313 return (eta_0 + eta_1 + delta_eta_h) * 1e-6;
314 }
315
324 template <class Evaluation>
325 static const Evaluation gasHeatCapacity(Evaluation temperature,
326 Evaluation pressure)
327 {
328 // Reduced variables
329 Evaluation rho_red = reducedMolarDensity(temperature, pressure);
330 Evaluation T_red = criticalTemperature() / temperature;
331
332 // Need Eq. (62) in Span et al. (2000)
333 Evaluation cv = gasIsochoricHeatCapacity(temperature, pressure); // [J/(kg*K)]
334
335 // Some intermediate calculations
336 Evaluation numerator = pow(1 + rho_red * derivResHelmholtzWrtRedRho(T_red, rho_red)
337 - rho_red * T_red * secDerivResHelmholtzWrtRecipRedTempAndRedRho(T_red, rho_red), 2);
338
339 Evaluation denominator = 1 + 2 * rho_red * derivResHelmholtzWrtRedRho(T_red, rho_red)
340 + pow(rho_red, 2) * secDerivResHelmholtzWrtRedRho(T_red, rho_red);
341
342 // Eq. (63) in Span et al. (2000).
343 Scalar R = IdealGas::R;
344 Evaluation cp = cv + R * (numerator / denominator) / molarMass(); // divide by M to get [J/(kg*K)]
345
346 // Return
347 return cp;
348 }
349
357 template <class Evaluation>
358 static const Evaluation gasIsochoricHeatCapacity(Evaluation temperature,
359 Evaluation pressure)
360 {
361 // Reduced variables
362 Evaluation rho_red = reducedMolarDensity(temperature, pressure);
363 Evaluation T_red = criticalTemperature() / temperature;
364
365 // Eq. (62) in Span et al. (2000)
366 Scalar R = IdealGas::R;
367 Evaluation cv = R * (-pow(T_red, 2) * (secDerivIdealHelmholtzWrtRecipRedTemp(T_red)
368 + secDerivResHelmholtzWrtRecipRedTemp(T_red, rho_red))); // [J/(mol*K)]
369
370 return cv / molarMass();
371 }
379 template <class Evaluation>
380 static Evaluation reducedMolarDensity(const Evaluation& temperature,
381 const Evaluation& pg,
382 bool extrapolate = false)
383 {
384 return gasDensity(temperature, pg, extrapolate) / (molarMass() * criticalDensity() * 1e6);
385 }
386
393 template <class Evaluation>
394 static Evaluation idealGasPartHelmholtz(const Evaluation& T_red, const Evaluation& rho_red)
395 {
396 // Eq. (31), which can be compared with Eq. (53) in Span et al. (2000)
397 // Terms not in sum
398 Evaluation s1 = log(rho_red) + 1.5*log(T_red) + a_[0] + a_[1] * T_red;
399
400 // Sum term
401 Evaluation s2 = 0.0;
402 for (int i = 2; i < 7; ++i) {
403 s1 += a_[i] * log(1 - exp(b_[i-2] * T_red));
404 }
405
406 // Return total
407 Evaluation s = s1 + s2;
408 return s;
409 }
410
416 template <class Evaluation>
417 static Evaluation derivIdealHelmholtzWrtRecipRedTemp(const Evaluation& T_red)
418 {
419 // Derivative of Eq. (31) wrt. reciprocal reduced temperature, which can be compared with Eq. (79) in Span et
420 // al. (2000)
421 // Terms not in sum
422 Evaluation s1 = (1.5 / T_red) + a_[1];
423
424 // Sum term
425 Evaluation s2 = 0.0;
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));
428 }
429
430 // Return total
431 Evaluation s = s1 + s2;
432 return s;
433 }
434
441 template <class Evaluation>
442 static Evaluation secDerivIdealHelmholtzWrtRecipRedTemp(const Evaluation& T_red)
443 {
444 // Second derivative of Eq. (31) wrt. reciprocal reduced temperature, which can be compared with Eq. (80) in
445 // Span et al. (2000)
446 // Sum term
447 Evaluation s1 = 0.0;
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);
450 }
451
452 // Return total
453 Evaluation s = (-1.5 / pow(T_red, 2)) + s1;
454 return s;
455 }
456
463 template <class Evaluation>
464 static Evaluation residualPartHelmholtz(const Evaluation& T_red, const Evaluation& rho_red)
465 {
466 // Eq. (32), which can be compared with Eq. (55) in Span et al. (2000)
467 // First sum term
468 Evaluation s1 = 0.0;
469 for (int i = 0; i < 7; ++i) {
470 s1 += N_[i] * pow(rho_red, d_[i]) * pow(T_red, t_[i]);
471 }
472
473 // Second sum term
474 Evaluation s2 = 0.0;
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]));
477 }
478
479 // Third, and last, sum term
480 Evaluation s3 = 0.0;
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));
484 }
485
486 // Return total sum
487 Evaluation s = s1 + s2 + s3;
488 return s;
489 }
490
497 template <class Evaluation>
498 static Evaluation derivResHelmholtzWrtRedRho(const Evaluation& T_red, const Evaluation& rho_red)
499 {
500 // Derivative of Eq. (32) wrt to reduced density, which can be compared with Eq. (81) in Span et al. (2000)
501 // First sum term
502 Evaluation s1 = 0.0;
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]);
505 }
506
507 // Second sum term
508 Evaluation s2 = 0.0;
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]));
512 }
513
514 // Third, and last, sum term
515 Evaluation s3 = 0.0;
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]));
520 }
521
522 // Return total sum
523 Evaluation s = s1 + s2 + s3;
524 return s;
525 }
526
533 template <class Evaluation>
534 static Evaluation secDerivResHelmholtzWrtRedRho(const Evaluation& T_red, const Evaluation& rho_red)
535 {
536 // Second derivative of Eq. (32) wrt to reduced density, which can be compared with Eq. (82) in Span et al.
537 // (2000)
538 // First sum term
539 Evaluation s1 = 0.0;
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]);
542 }
543
544 // Second sum term
545 Evaluation s2 = 0.0;
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]));
550 }
551
552 // Third, and last, sum term
553 Evaluation s3 = 0.0;
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));
559 }
560
561 // Return total sum
562 Evaluation s = s1 + s2 + s3;
563 return s;
564 }
565
572 template <class Evaluation>
573 static Evaluation derivResHelmholtzWrtRecipRedTemp(const Evaluation& T_red, const Evaluation& rho_red)
574 {
575 // Derivative of Eq. (32) wrt to reciprocal reduced temperature, which can be compared with Eq. (84) in Span et
576 // al. (2000).
577 // First sum term
578 Evaluation s1 = 0.0;
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);
581 }
582
583 // Second sum term
584 Evaluation s2 = 0.0;
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]));
587 }
588
589 // Third, and last, sum term
590 Evaluation s3 = 0.0;
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]));
595 }
596
597 // Return total sum
598 Evaluation s = s1 + s2 + s3;
599 return s;
600 }
601
608 template <class Evaluation>
609 static Evaluation secDerivResHelmholtzWrtRecipRedTemp(const Evaluation& T_red, const Evaluation& rho_red)
610 {
611 // Second derivative of Eq. (32) wrt to reciprocal reduced temperature, which can be compared with Eq. (85) in
612 // Span et al. (2000).
613 // First sum term
614 Evaluation s1 = 0.0;
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);
617 }
618
619 // Second sum term
620 Evaluation s2 = 0.0;
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]));
623 }
624
625 // Third, and last, sum term
626 Evaluation s3 = 0.0;
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));
632 }
633
634 // Return total sum
635 Evaluation s = s1 + s2 + s3;
636 return s;
637 }
638
646 template <class Evaluation>
647 static Evaluation secDerivResHelmholtzWrtRecipRedTempAndRedRho(const Evaluation& T_red, const Evaluation& rho_red)
648 {
649 // Second derivative of Eq. (32) wrt to reciprocal reduced temperature and reduced density, which can be
650 // compared with Eq. (86) in Span et al. (2000).
651 // First sum term
652 Evaluation s1 = 0.0;
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);
655 }
656
657 // Second sum term
658 Evaluation s2 = 0.0;
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]));
662 }
663
664 // Third, and last, sum term
665 Evaluation s3 = 0.0;
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]));
671 }
672
673 // Return total sum
674 Evaluation s = s1 + s2 + s3;
675 return s;
676 }
677
678private:
679
680 // Parameter values need in the ideal-gas contribution to the reduced Helmholtz free energy given in Table 4
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};
683
684 // Parameter values needed in the residual contribution to the reduced Helmholtz free energy given in Table 5.
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};
695
703 template <class Evaluation>
704 static Evaluation rootFindingObj_(const Evaluation& rho_red, const Evaluation& temperature, const Evaluation& pg)
705 {
706 // Temporary calculations
707 Evaluation T_red = criticalTemperature() / temperature; // reciprocal reduced temp.
708 Evaluation p_MPa = pg / 1.0e6; // Pa --> MPa
709 Scalar R = IdealGas::R;
710 Evaluation rho_cRT = criticalDensity() * R * temperature;
711
712 // Eq. (56) in Span et al. (2000)
713 Evaluation dResHelm_dRedRho = derivResHelmholtzWrtRedRho(T_red, rho_red);
714 Evaluation obj = rho_red * rho_cRT * (1 + rho_red * dResHelm_dRedRho) - p_MPa;
715 return obj;
716 }
717};
718
719} // end namespace Opm
720
721#endif
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...
Implements a scalar function that depends on two variables and which is sampled on an uniform X-Y gri...
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
Implements a scalar function that depends on two variables and which is sampled on an uniform X-Y gri...
Definition UniformTabulated2DFunction.hpp:52
Evaluation eval(const Evaluation &x, const Evaluation &y, bool extrapolate) const
Evaluate the function at a given (x,y) position.
Definition UniformTabulated2DFunction.hpp:196
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30