GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/material/fluidmatrixinteractions/permeabilitykozenycarman.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 3 3 100.0%
Functions: 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-FileCopyrightText: 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 Fluidmatrixinteractions
10 * \brief The Kozeny-Carman relationship for the calculation of a porosity-dependent permeability.
11 */
12
13 #ifndef DUMUX_PERMEABILITY_KOZENY_CARMAN_HH
14 #define DUMUX_PERMEABILITY_KOZENY_CARMAN_HH
15
16 #include <cmath>
17 #include <dune/common/fmatrix.hh>
18 #include <dune/common/math.hh>
19
20 namespace Dumux {
21
22 /*!
23 * \ingroup Fluidmatrixinteractions
24 * \brief The Kozeny-Carman relationship for the calculation of a porosity-dependent permeability.
25 * When the porosity is implemented as solution-independent, using this relationship for the
26 * permeability leads to unnecessary overhead.
27 *
28 * \tparam PermeabilityType The type used for the intrinsic permeability
29 */
30 template<class PermeabilityType>
31 class PermeabilityKozenyCarman
32 {
33 public:
34 /*!
35 * \brief Calculates the permeability for a given sub-control volume
36 * \param refPerm Reference permeability before porosity changes
37 * \param refPoro The poro corresponding to the reference permeability
38 * \param poro The porosity for which permeability is to be evaluated
39 */
40 template<class Scalar>
41 7766187 PermeabilityType evaluatePermeability(PermeabilityType refPerm, Scalar refPoro, Scalar poro) const
42 {
43 using Dune::power;
44 15532374 auto factor = power((1.0 - refPoro)/(1.0 - poro), 2) * power(poro/refPoro, 3);
45 7766187 refPerm *= factor;
46 return refPerm;
47 }
48 };
49
50 } // namespace Dumux
51
52 #endif
53