version 3.10-dev
henryiapws.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-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_HENRY_IAPWS_HH
13#define DUMUX_HENRY_IAPWS_HH
14
16
17namespace Dumux {
39template <class Scalar>
40inline Scalar henryIAPWS(Scalar E,
41 Scalar F,
42 Scalar G,
43 Scalar H,
44 Scalar temperature)
45{
47
48 // regularizing temperature helps for stability.
49 // Results are unphysical!
50 if (temperature > H2O::criticalTemperature())
51 temperature = H2O::criticalTemperature();
52
53 Scalar Tr = temperature/H2O::criticalTemperature();
54 Scalar tau = 1 - Tr;
55
56 static const Scalar c[6] = {
57 1.99274064, 1.09965342, -0.510839303,
58 -1.75493479,-45.5170352, -6.7469445e5
59 };
60 static const Scalar d[6] = {
61 1/3.0, 2/3.0, 5/3.0,
62 16/3.0, 43/3.0, 110/3.0
63 };
64 static const Scalar q = -0.023767;
65
66 Scalar f = 0;
67 using std::pow;
68 for (int i = 0; i < 6; ++i) {
69 f += c[i]*pow(tau, d[i]);
70 }
71
72 Scalar exponent =
73 q*F +
74 E/temperature*f +
75 (F +
76 G*pow(tau, 2.0/3) +
77 H*tau)*
78 exp((H2O::tripleTemperature() - temperature)/100);
79
80 using std::exp;
81 return exp(exponent)*H2O::vaporPressure(temperature);
82}
83}
84
85#endif
Material properties of pure water .
Definition: h2o.hh:49
Scalar henryIAPWS(Scalar E, Scalar F, Scalar G, Scalar H, Scalar temperature)
The Henry constants in liquid water using the IAPWS 2004 formulation.
Definition: henryiapws.hh:40
Material properties of pure water .
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
Definition: adapt.hh:17