3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program 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 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_HENRY_IAPWS_HH
25#define DUMUX_HENRY_IAPWS_HH
26
28
29namespace Dumux {
51template <class Scalar>
52inline Scalar henryIAPWS(Scalar E,
53 Scalar F,
54 Scalar G,
55 Scalar H,
56 Scalar temperature)
57{
59
60 // regularizing temperature helps for stability.
61 // Results are unphysical!
62 if (temperature > H2O::criticalTemperature())
63 temperature = H2O::criticalTemperature();
64
65 Scalar Tr = temperature/H2O::criticalTemperature();
66 Scalar tau = 1 - Tr;
67
68 static const Scalar c[6] = {
69 1.99274064, 1.09965342, -0.510839303,
70 -1.75493479,-45.5170352, -6.7469445e5
71 };
72 static const Scalar d[6] = {
73 1/3.0, 2/3.0, 5/3.0,
74 16/3.0, 43/3.0, 110/3.0
75 };
76 static const Scalar q = -0.023767;
77
78 Scalar f = 0;
79 using std::pow;
80 for (int i = 0; i < 6; ++i) {
81 f += c[i]*pow(tau, d[i]);
82 }
83
84 Scalar exponent =
85 q*F +
86 E/temperature*f +
87 (F +
88 G*pow(tau, 2.0/3) +
89 H*tau)*
90 exp((H2O::tripleTemperature() - temperature)/100);
91
92 using std::exp;
93 return exp(exponent)*H2O::vaporPressure(temperature);
94}
95}
96
97#endif
Material properties of pure water .
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:52
Definition: adapt.hh:29
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
Material properties of pure water .
Definition: h2o.hh:60