GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/material/fluidmatrixinteractions/diffusivityconstanttortuosity.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 4 4 100.0%
Functions: 14 14 100.0%
Branches: 5 6 83.3%

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_CONSTANT_TORTUOSITY_HH
8 #define DUMUX_MATERIAL_DIFFUSIVITY_CONSTANT_TORTUOSITY_HH
9
10 #include <dumux/common/parameters.hh>
11
12 namespace Dumux {
13
14 /*!
15 * \addtogroup EffectiveDiffusivity
16 * \copydetails Dumux::DiffusivityConstantTortuosity
17 */
18
19 /*!
20 * \ingroup EffectiveDiffusivity
21 * \brief Relation for the effective diffusion coefficient with constant tortuosity
22 *
23 * ### Constant Tortuosity
24 *
25 * For `DiffusivityConstantTortuosity`, \f$ \tau = \text{const.} \f$,
26 * with default value 0.5, empirically obtained by Carman \cite carman1937.
27 * The value can be changed at runtime by setting parameter
28 * `"SpatialParams.Tortuosity"`. This will change the value of \f$ \tau \f$,
29 * and therefore the effective diffusion coefficient wherever
30 * the function `effectiveDiffusionCoefficient` is used.
31 */
32 template<class Scalar>
33 class DiffusivityConstantTortuosity
34 {
35 public:
36 /*!
37 * \brief Returns the effective diffusion coefficient (\f$\mathrm{m^2/s}\f$)
38 *
39 * Returns the effective diffusion coefficient (\f$\mathrm{m^2/s}\f$)
40 * of component \f$ \kappa \f$ (index `compIdxI`) in phase \f$ \alpha \f$ based
41 * on a constant tortuosity coefficient: \f$ D^\kappa_{\text{eff},\alpha} = \phi S_\alpha \tau D^\kappa_\alpha \f$.
42 *
43 * \param volVars The volume variables
44 * \param phaseIdx the index of phase \f$ \alpha \f$
45 * \param compIdxI the component index i (the component diffusing in phase \f$ \alpha \f$)
46 * \param compIdxJ the component index j (the main component of phase \f$ \alpha \f$)
47 */
48 template<class VolumeVariables>
49 76590786 static Scalar effectiveDiffusionCoefficient(const VolumeVariables& volVars,
50 const int phaseIdx,
51 const int compIdxI,
52 const int compIdxJ)
53 {
54
5/6
✓ Branch 0 taken 45 times.
✓ Branch 1 taken 44492301 times.
✓ Branch 3 taken 19 times.
✓ Branch 4 taken 26 times.
✓ Branch 6 taken 19 times.
✗ Branch 7 not taken.
76590786 static const Scalar tau = getParam<Scalar>("SpatialParams.Tortuosity", 0.5);
55 76590786 const Scalar diffCoeff = volVars.diffusionCoefficient(phaseIdx, compIdxI, compIdxJ);
56 153180570 return volVars.porosity() * volVars.saturation(phaseIdx) * tau * diffCoeff;
57 }
58
59 };
60 } // end namespace Dumux
61
62 #endif
63