GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/material/fluidmatrixinteractions/diffusivitymillingtonquirk.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 5 5 100.0%
Functions: 63 74 85.1%
Branches: 6 8 75.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 #ifndef DUMUX_MATERIAL_DIFFUSIVITY_MILLINGTON_QUIRK_HH
8 #define DUMUX_MATERIAL_DIFFUSIVITY_MILLINGTON_QUIRK_HH
9
10 #include <cmath>
11 #include <algorithm>
12
13 namespace Dumux {
14
15 /*!
16 * \addtogroup EffectiveDiffusivity
17 * \copydetails Dumux::DiffusivityMillingtonQuirk
18 */
19
20 /*!
21 * \ingroup EffectiveDiffusivity
22 * \brief Relation for the effective diffusion coefficient after Millington and Quirk
23 *
24 * ### Millington Quirk
25 *
26 * For `DiffusivityMillingtonQuirk`,
27 * the tortuosity coefficient is estimated after Millington and Quirk (1961) \cite millington1961
28 * by
29 * \f[
30 * \tau = \frac{1}{\phi^2} \left(\phi S_\alpha\right)^{7/3}.
31 * \f]
32 *
33 * See also Helmig (1997) \cite helmig1997 [page 129].
34 */
35 template<class Scalar>
36 class DiffusivityMillingtonQuirk
37 {
38 public:
39 /*!
40 * \brief Returns the effective diffusion coefficient (\f$\mathrm{m^2/s}\f$)
41 *
42 * Returns the effective diffusion coefficient (\f$\mathrm{m^2/s}\f$)
43 * of component \f$ \kappa \f$ (index `compIdxI`) in phase \f$ \alpha \f$ computed as
44 * \f$ D^\kappa_{\text{eff},\alpha} = \phi S_\alpha \tau D^\kappa_\alpha \f$.
45 *
46 * \param volVars The Volume Variables
47 * \param phaseIdx the index of the phase
48 * \param compIdxI the component index i
49 * \param compIdxJ the component index j
50 */
51 template<class VolumeVariables>
52 245701320 static Scalar effectiveDiffusionCoefficient(const VolumeVariables& volVars,
53 const int phaseIdx,
54 const int compIdxI,
55 const int compIdxJ)
56 {
57 // instead of D_eff = phi S tau D = phi S 1/phi^2 (phi S)^(7/3) D
58 // we implement more efficiently D_eff = phi S^3 cubicroot(phi S) D
59 using std::cbrt;
60 using std::max;
61
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
245701320 const Scalar diffCoeff = volVars.diffusionCoefficient(phaseIdx, compIdxI, compIdxJ);
62
2/2
✓ Branch 0 taken 1693 times.
✓ Branch 1 taken 177405336 times.
262391535 const Scalar porosity = volVars.porosity();
63
4/4
✓ Branch 0 taken 2929 times.
✓ Branch 1 taken 228983344 times.
✓ Branch 2 taken 2929 times.
✓ Branch 3 taken 228983344 times.
474687593 const Scalar sat = max<Scalar>(volVars.saturation(phaseIdx), 0.0);
64 245701320 return porosity * (sat*sat*sat) * cbrt(porosity * sat) * diffCoeff;
65 }
66 };
67
68 } // end namespace Dumux
69
70 #endif
71