GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/test/porousmediumflow/richards/benchmarks/spatialparams.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 16 16 100.0%
Functions: 1 1 100.0%
Branches: 16 26 61.5%

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 RichardsTests
10 * \brief Spatial parameters for the Richards benchmarks
11 */
12
13 #ifndef DUMUX_RICHARDS_BENCHMARKS_SPATIAL_PARAMETERS_HH
14 #define DUMUX_RICHARDS_BENCHMARKS_SPATIAL_PARAMETERS_HH
15
16 #include <dumux/common/parameters.hh>
17
18 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
19 #include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh>
20
21 namespace Dumux {
22
23 /*!
24 * \ingroup RichardsTests
25 * \brief Spatial parameters for the Richards benchmarks
26 */
27 template<class GridGeometry, class Scalar>
28
1/2
✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
7 class RichardsBenchmarkSpatialParams
29 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, RichardsBenchmarkSpatialParams<GridGeometry, Scalar>>
30 {
31 using ThisType = RichardsBenchmarkSpatialParams<GridGeometry, Scalar>;
32 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, ThisType>;
33 using GridView = typename GridGeometry::GridView;
34 using GlobalPosition = typename GridView::template Codim<0>::Geometry::GlobalCoordinate;
35 using PcKrSwCurve = FluidMatrix::VanGenuchtenDefault<Scalar>;
36
37 public:
38 // export permeability type
39 using PermeabilityType = Scalar;
40
41 7 RichardsBenchmarkSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
42 : ParentType(gridGeometry)
43
1/2
✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
7 , pcKrSwCurve_("SpatialParams")
44
1/2
✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
7 , permeability_(getParam<Scalar>("SpatialParams.Permeability"))
45
3/6
✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 7 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 7 times.
✗ Branch 9 not taken.
21 , porosity_(getParam<Scalar>("SpatialParams.Porosity"))
46 {
47 // The potential rate decides about the type of the scenario.
48 // See the problem file for more information.
49
1/2
✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
7 const auto potentialRate = getParam<Scalar>("Problem.SurfaceFluxMilliMeterPerDay");
50
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 4 times.
7 extrusionFactor_ = (potentialRate > 0) ? 0.1*0.1 : 0.05*0.05;
51 7 }
52
53 /*!
54 * \brief Returns the intrinsic permeability tensor [m^2] at a given location
55 */
56 33552406 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
57 33552406 { return permeability_; }
58
59 /*!
60 * \brief Returns the porosity [-] at a given location
61 */
62 33552406 Scalar porosityAtPos(const GlobalPosition& globalPos) const
63 33552406 { return porosity_; }
64
65 /*!
66 * \brief Returns the fluid-matrix interaction law for the sub-control volume
67 */
68 91588719 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
69
7/10
✓ Branch 1 taken 31323 times.
✓ Branch 2 taken 6771 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 14800917 times.
✓ Branch 6 taken 1483589 times.
✓ Branch 9 taken 7 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 3014525 times.
✓ Branch 12 taken 30537881 times.
91588719 { return makeFluidMatrixInteraction(pcKrSwCurve_); }
70
71 /*!
72 * \brief Returns the temperature [K] at a given location
73 */
74 Scalar temperatureAtPos(const GlobalPosition &globalPos) const
75 { return 273.15 + 10.0; } // -> 10°C
76
77 /*!
78 * \brief Returns the extrusion factor [m^2] at a given location
79 */
80 33552406 Scalar extrusionFactorAtPos(const GlobalPosition &globalPos) const
81 33552406 { return extrusionFactor_; }
82
83 private:
84 const PcKrSwCurve pcKrSwCurve_;
85 const Scalar permeability_, porosity_;
86 Scalar extrusionFactor_;
87 };
88
89 } // end namespace Dumux
90
91 #endif
92