GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/material/binarycoefficients/h2o_ch4.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 3 5 60.0%
Functions: 0 1 0.0%
Branches: 0 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 methane.
11 */
12 #ifndef DUMUX_BINARY_COEFF_H2O_CH4_HH
13 #define DUMUX_BINARY_COEFF_H2O_CH4_HH
14
15 #include <dumux/material/binarycoefficients/henryiapws.hh>
16 #include <dumux/material/binarycoefficients/fullermethod.hh>
17
18 #include <dumux/material/components/ch4.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 methane.
27 */
28 class H2O_CH4
29 {
30 public:
31 /*!
32 * \brief Henry coefficient \f$[N/m^2]\f$ for molecular methane in liquid water.
33 *
34 * See:
35 *
36 * IAPWS: "Guideline on the Henry's Constant and Vapor-Liquid
37 * Distribution Constant for Gases in H2O and D2O at High
38 * Temperatures"
39 * http://www.iapws.org/relguide/HenGuide.pdf
40 */
41 template <class Scalar>
42 static Scalar henry(Scalar temperature)
43 {
44 const Scalar E = 2215.6977;
45 const Scalar F = -0.1089;
46 const Scalar G = -6.6240;
47 const Scalar H = 4.6789;
48
49 return henryIAPWS(E, F, G, H, temperature);
50 }
51
52 /*!
53 * \brief Binary diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for molecular water in methane.
54 *
55 * \param temperature the temperature \f$\mathrm{[K]}\f$
56 * \param pressure the phase pressure \f$\mathrm{[Pa]}\f$
57 */
58 template <class Scalar>
59 static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
60 {
61 // DUNE_THROW(Dune::NotImplemented, "diffusion coefficient for gasous water and methane");
62
63 typedef Dumux::Components::H2O<Scalar> H2O;
64 typedef Dumux::Components::CH4<Scalar> CH4;
65
66 // atomic diffusion volumes
67 // Vch4 = sum(ni*Vi) = 15.9 + 4*2.31 = 25.14 (Tang et al., 2015)--> method, (Poling et al., 2001, p.11.11)--> values
68 1 const Scalar SigmaNu[2] = { 13.1 /* H2O */, 25.14 /* CH4 */ };
69 // molar masses [g/mol]
70 1 const Scalar M[2] = { H2O::molarMass()*Scalar(1e3), CH4::molarMass()*Scalar(1e3) };
71
72 1 return fullerMethod(M, SigmaNu, temperature, pressure);
73 }
74
75 /*!
76 * \brief Diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for molecular methane in liquid water.
77 * \param temperature the temperature \f$\mathrm{[K]}\f$
78 * \param pressure the phase pressure \f$\mathrm{[Pa]}\f$
79 *
80 * The empirical equations for estimating the diffusion coefficient in
81 * infinite solution which are presented in Reid, 1987 \cite reid1987 all show a
82 * linear dependency on temperature. We thus simply scale the
83 * experimentally obtained diffusion coefficient of Ferrell and
84 * Himmelblau by the temperature.<br>
85 * This function use an interpolation of the data by \cite witherspoon1965
86 * http://dx.doi.org/10.1021/j100895a017
87 */
88 template <class Scalar>
89 static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
90 {
91 return 2.93856e-11 * temperature - 6.89402e-09;
92 }
93 };
94
95 } // end namespace BinaryCoeff
96 } // end namespace Dumux
97
98 #endif
99