GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/material/binarycoefficients/fullermethod.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 4 4 100.0%
Functions: 1 1 100.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 Various relations for molecular diffusion coefficients.
11 */
12 #ifndef DUMUX_FULLERMETHOD_HH
13 #define DUMUX_FULLERMETHOD_HH
14
15 #include <dumux/common/math.hh>
16
17 namespace Dumux {
18 namespace BinaryCoeff {
19 /*!
20 * \ingroup Binarycoefficients
21 * \brief Estimate binary diffusion coefficients \f$\mathrm{[m^2/s]}\f$ in gases according to
22 * the method by Fuller.
23 *
24 * \param M molar masses \f$\mathrm{[g/mol]}\f$
25 * \param SigmaNu atomic diffusion volume
26 * \param temperature The temperature \f$\mathrm{[K]}\f$
27 * \param pressure phase pressure \f$\mathrm{[Pa]}\f$
28 *
29 * This function estimates the diffusion coefficients in binary gases
30 * using to the method proposed by Fuller. This method and is only
31 * valid at "low" pressures.
32 *
33 * See: R. Reid, et al. (1987, pp. 587-588) \cite reid1987
34 */
35 template <class Scalar>
36 22154892 inline Scalar fullerMethod(const Scalar *M, // molar masses [g/mol]
37 const Scalar *SigmaNu, // atomic diffusion volume
38 const Scalar temperature, // [K]
39 const Scalar pressure) // [Pa]
40 {
41 // "effective" molar mass in [g/m^3]
42
1/2
✓ Branch 0 taken 22154892 times.
✗ Branch 1 not taken.
22154892 Scalar Mab = harmonicMean(M[0], M[1]);
43
44 // Fuller's method
45 using std::pow;
46 using std::sqrt;
47 22154892 Scalar tmp = pow(SigmaNu[0], 1./3) + pow(SigmaNu[1], 1./3);
48 22154892 return 1e-4 * (143.0*pow(temperature, 1.75))/(pressure*sqrt(Mab)*tmp*tmp);
49 }
50
51 } // end namespace BinaryCoeff
52 } // end namespace Dumux
53
54 #endif
55