GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/material/binarycoefficients/h2o_air.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 13 13 100.0%
Functions: 0 0 -%
Branches: 6 10 60.0%

Line Branch Exec Source
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-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 /*!
8 * \file
9 * \ingroup Binarycoefficients
10 * \brief Binary coefficients for water and air.
11 */
12 #ifndef DUMUX_BINARY_COEFF_H2O_AIR_HH
13 #define DUMUX_BINARY_COEFF_H2O_AIR_HH
14
15 #include <cmath>
16
17 namespace Dumux::BinaryCoeff {
18
19 /*!
20 * \ingroup Binarycoefficients
21 * \brief Binary coefficients for water and air.
22 */
23 class H2O_Air
24 {
25 public:
26 /*!
27 * \brief Henry coefficient \f$\mathrm{[Pa]}\f$ for air in liquid water.
28 * \param temperature the temperature \f$\mathrm{[K]}\f$
29 *
30 * Henry coefficient See:
31 * Stefan Finsterle (1993, page 33 Formula (2.9)) \cite finsterle1993 <BR>
32 * (fitted to data from Tchobanoglous & Schroeder, 1985 \cite tchobanoglous1985 )
33 */
34 template <class Scalar>
35 12933896 static Scalar henry(Scalar temperature)
36 {
37 using std::exp;
38 12933896 Scalar r = (0.8942+1.47*exp(-0.04394*(temperature-273.15)))*1.E-10;
39
40 12933896 return 1./r;
41 }
42
43 /*!
44 * \brief Binary diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for molecular water and air
45 *
46 * \param temperature the temperature \f$\mathrm{[K]}\f$
47 * \param pressure the phase pressure \f$\mathrm{[Pa]}\f$
48 * Vargaftik: Tables on the thermophysical properties of liquids and gases.
49 * John Wiley & Sons, New York, 1975. \cite vargaftik1975 <BR>
50 * Walker, Sabey, Hampton: Studies of heat transfer and water migration in soils.
51 * Dep. of Agricultural and Chemical Engineering, Colorado State University,
52 * Fort Collins, 1981. \cite walker1981
53 */
54 template <class Scalar>
55 52791195 static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
56 {
57 52791196 const Scalar Theta=1.8;
58 52791196 const Scalar Daw=2.13e-5; /* reference value */
59 52791196 const Scalar pg0=1.e5; /* reference pressure */
60
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
52791196 const Scalar T0=273.15; /* reference temperature */
61 Scalar Dgaw;
62
63 using std::pow;
64
2/2
✓ Branch 0 taken 3296657 times.
✓ Branch 1 taken 3296657 times.
52791195 Dgaw=Daw*(pg0/pressure)*pow((temperature/T0),Theta);
65
66 return Dgaw;
67 }
68
69 /*!
70 * Lacking better data on water-air diffusion in liquids, we use at the
71 * moment the diffusion coefficient of the air's main component nitrogen!!
72 * \brief Diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for molecular nitrogen in liquid water.
73 *
74 * \param temperature the temperature \f$\mathrm{[K]}\f$
75 * \param pressure the phase pressure \f$\mathrm{[Pa]}\f$
76 *
77 * The empirical equations for estimating the diffusion coefficient in
78 * infinite solution which are presented in Reid, 1987 all show a
79 * linear dependency on temperature. We thus simply scale the
80 * experimentally obtained diffusion coefficient of Ferrell and
81 * Himmelblau by the temperature.
82 *
83 * See:
84 * R. Reid et al. (1987, pp. 599) \cite reid1987 <BR>
85 * R. Ferrell, D. Himmelblau (1967, pp. 111-115) \cite ferrell1967
86 */
87 template <class Scalar>
88 32190517 static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
89 {
90 32190518 const Scalar Texp = 273.15 + 25; // [K]
91
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
32190518 const Scalar Dexp = 2.01e-9; // [m^2/s]
92
2/4
✓ Branch 0 taken 4678725 times.
✓ Branch 1 taken 4678725 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
32190517 return Dexp * temperature/Texp;
93 }
94 };
95
96 } // end namespace Dumux::BinaryCoeff
97
98 #endif
99