GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/material/binarycoefficients/h2o_n2.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 11 12 91.7%
Functions: 0 1 0.0%
Branches: 1 2 50.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-FileCopyrightInfo: 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 nitrogen.
11 */
12 #ifndef DUMUX_BINARY_COEFF_H2O_N2_HH
13 #define DUMUX_BINARY_COEFF_H2O_N2_HH
14
15 #include "henryiapws.hh"
16 #include "fullermethod.hh"
17
18 #include <dumux/material/components/n2.hh>
19 #include <dumux/material/components/h2o.hh>
20
21 namespace Dumux {
22 namespace BinaryCoeff {
23
24 /*!
25 * \ingroup Binarycoefficients
26 * \brief Binary coefficients for water and nitrogen.
27 */
28 class H2O_N2
29 {
30 public:
31 /*!
32 * \brief Henry coefficient \f$\mathrm{[Pa]}\f$ for molecular nitrogen in liquid water.
33 * \param temperature the temperature \f$\mathrm{[K]}\f$
34 */
35 template <class Scalar>
36 static Scalar henry(Scalar temperature)
37 {
38 17813678 const Scalar E = 2388.8777;
39 17813678 const Scalar F = -14.9593;
40 17813678 const Scalar G = 42.0179;
41 17813678 const Scalar H = -29.4396;
42
43 17813678 return henryIAPWS(E, F, G, H, temperature);
44 }
45
46 /*!
47 * \brief Binary diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for molecular water and nitrogen.
48 *
49 * Uses fullerMethod to determine the diffusion of water in nitrogen.
50 * \param temperature the temperature \f$\mathrm{[K]}\f$
51 * \param pressure the phase pressure \f$\mathrm{[Pa]}\f$
52 */
53 template <class Scalar>
54 static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
55 {
56 using H2O = Dumux::Components::H2O<Scalar>;
57 using N2 = Dumux::Components::N2<Scalar>;
58
59 // atomic diffusion volumes
60 19399348 const Scalar SigmaNu[2] = { 13.1 /* H2O */, 18.5 /* N2 */ };
61 // molar masses [g/mol]
62 19399348 const Scalar M[2] = { H2O::molarMass()*Scalar(1e3), N2::molarMass()*Scalar(1e3) };
63
64 19399348 return fullerMethod(M, SigmaNu, temperature, pressure);
65 }
66
67 /*!
68 * \brief Diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for molecular nitrogen in liquid water.
69 * \param temperature the temperature \f$\mathrm{[K]}\f$
70 * \param pressure the phase pressure \f$\mathrm{[Pa]}\f$
71 *
72 * The empirical equations for estimating the diffusion coefficient in
73 * infinite solution which are presented in Reid, 1987 all show a
74 * linear dependency on temperature. We thus simply scale the
75 * experimentally obtained diffusion coefficient of Ferrell and
76 * Himmelblau by the temperature.
77 *
78 * See:
79 *
80 * R. Reid et al. (1987, pp. 599) \cite reid1987 <BR>
81 *
82 * R. Ferrell, D. Himmelblau (1967, pp. 111-115) \cite ferrell1967
83 */
84 template <class Scalar>
85 static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
86 {
87 34743338 const Scalar Texp = 273.15 + 25; // [K]
88
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
34743338 const Scalar Dexp = 2.01e-9; // [m^2/s]
89
90 34743337 return Dexp * temperature/Texp;
91 }
92 };
93
94 } // end namespace BinaryCoeff
95 } // end namespace Dumux
96
97 #endif
98