GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/richards/benchmarks/spatialparams.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 8 17 47.1%
Functions: 1 6 16.7%
Branches: 31 58 53.4%

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 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/6
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 7 times.
✗ Branch 5 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 , pcKrSwCurve_("SpatialParams")
44 7 , permeability_(getParam<Scalar>("SpatialParams.Permeability"))
45
9/24
✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 7 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 7 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 7 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 7 times.
✓ Branch 18 taken 7 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 7 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 7 times.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 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 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
57 { return permeability_; }
58
59 /*!
60 * \brief Returns the porosity [-] at a given location
61 */
62 Scalar porosityAtPos(const GlobalPosition& globalPos) const
63 { return porosity_; }
64
65 /*!
66 * \brief Returns the fluid-matrix interaction law for the sub-control volume
67 */
68 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
69
18/24
✓ Branch 2 taken 31323 times.
✓ Branch 3 taken 6771 times.
✓ Branch 4 taken 31323 times.
✓ Branch 5 taken 6771 times.
✓ Branch 7 taken 7 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 7 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 14800917 times.
✓ Branch 17 taken 1483589 times.
✓ Branch 18 taken 14800917 times.
✓ Branch 19 taken 1483589 times.
✓ Branch 20 taken 14800917 times.
✓ Branch 21 taken 1483589 times.
✓ Branch 22 taken 14800917 times.
✓ Branch 23 taken 1483589 times.
✓ Branch 26 taken 3014525 times.
✓ Branch 27 taken 30537881 times.
✓ Branch 28 taken 3014525 times.
✓ Branch 29 taken 30537881 times.
215746450 { 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 Scalar extrusionFactorAtPos(const GlobalPosition &globalPos) const
81 { 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