GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/richardsnc/spatialparams.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 17 19 89.5%
Functions: 2 4 50.0%
Branches: 105 238 44.1%

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 RichardsNCTests
10 * \brief The spatial parameters for the RichardsWellTracerProblem.
11 */
12
13 #ifndef DUMUX_RICHARDS_LENS_SPATIAL_PARAMETERS_HH
14 #define DUMUX_RICHARDS_LENS_SPATIAL_PARAMETERS_HH
15
16 #include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh>
17 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
18 #include <dumux/porousmediumflow/richards/model.hh>
19
20 namespace Dumux {
21
22 /*!
23 * \ingroup RichardsModel
24 * \ingroup ImplicitTestProblems
25 * \brief The spatial parameters for the RichardsWellTracerProblem.
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 2 times.
✗ Branch 5 not taken.
2 class RichardsWellTracerSpatialParams
29 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
30 RichardsWellTracerSpatialParams<GridGeometry, Scalar>>
31 {
32 using GridView = typename GridGeometry::GridView;
33 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
34 RichardsWellTracerSpatialParams<GridGeometry, Scalar>>;
35
36 enum { dimWorld=GridView::dimensionworld };
37 using Element = typename GridView::template Codim<0>::Entity;
38 using FVElementGeometry = typename GridGeometry::LocalView;
39 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
40 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
41
42 using PcKrSwCurve = FluidMatrix::VanGenuchtenNoReg<Scalar>;
43
44 public:
45 // export permeability type
46 using PermeabilityType = Scalar;
47
48 2 RichardsWellTracerSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
49 : ParentType(gridGeometry)
50 , lensPcKrSwCurve_("SpatialParams.Lens")
51
14/36
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 2 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 2 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 2 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 2 times.
✗ Branch 25 not taken.
✓ Branch 27 taken 2 times.
✗ Branch 28 not taken.
✓ Branch 30 taken 2 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 2 times.
✗ Branch 34 not taken.
✓ Branch 35 taken 2 times.
✗ Branch 36 not taken.
✓ Branch 38 taken 2 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
18 , outerPcKrSwCurve_("SpatialParams.OuterDomain")
52 {
53
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 lensLowerLeft_ = getParam<GlobalPosition>("Problem.LensLowerLeft");
54
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 lensUpperRight_ = getParam<GlobalPosition>("Problem.LensUpperRight");
55
56 2 lensK_ = 1e-14;
57 2 outerK_ = 5e-12;
58 2 }
59
60 /*!
61 * \brief Returns the intrinsic permeability tensor [m^2] at a given location
62 *
63 * \param globalPos The global position where we evaluate
64 */
65 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
66 {
67
4/6
✓ Branch 0 taken 398052 times.
✓ Branch 1 taken 4564548 times.
✓ Branch 2 taken 398052 times.
✓ Branch 3 taken 4564548 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
9925200 if (isInLens_(globalPos))
68 796104 return lensK_;
69 9129096 return outerK_;
70 }
71
72 /*!
73 * \brief Returns the temperature within the domain.
74 *
75 * \param element The finite volume element
76 * \param scv The sub-control volume
77 * \param elemSol The element solution
78 */
79 template<class ElementSolution>
80 Scalar temperature(const Element& element,
81 const SubControlVolume& scv,
82 const ElementSolution& elemSol) const
83 { return 273.15 + 10; }; // -> 10°C
84
85 /*!
86 * \brief Returns the porosity [] at a given location
87 *
88 * \param globalPos The global position where we evaluate
89 */
90 Scalar porosityAtPos(const GlobalPosition& globalPos) const
91 {
92
2/8
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 398052 times.
✓ Branch 7 taken 4564548 times.
4962600 if (isInLens_(globalPos))
93 return 0.2;
94 return 0.4;
95 }
96
97 /*!
98 * \brief Returns the fluid-matrix interaction law at a given location
99 *
100 * \param globalPos The global coordinates for the given location
101 */
102 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
103 {
104
5/10
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 398052 times.
✓ Branch 5 taken 4564548 times.
✓ Branch 6 taken 398052 times.
✓ Branch 7 taken 4564548 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
9925202 if (isInLens_(globalPos))
105 796104 return makeFluidMatrixInteraction(lensPcKrSwCurve_);
106 else
107 9129098 return makeFluidMatrixInteraction(outerPcKrSwCurve_);
108 }
109
110 private:
111 bool isInLens_(const GlobalPosition &globalPos) const
112 {
113
11/24
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 5623164 times.
✓ Branch 11 taken 398052 times.
✓ Branch 12 taken 5623164 times.
✓ Branch 13 taken 398052 times.
✓ Branch 14 taken 5623164 times.
✓ Branch 15 taken 398052 times.
✓ Branch 16 taken 5623164 times.
✓ Branch 17 taken 398052 times.
✓ Branch 18 taken 5623164 times.
✓ Branch 19 taken 398052 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
30106082 for (int i = 0; i < dimWorld; ++i)
114
66/144
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 2 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 19 taken 2 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 2 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✓ Branch 60 taken 4167432 times.
✓ Branch 61 taken 1455732 times.
✓ Branch 62 taken 4167432 times.
✓ Branch 63 taken 1455732 times.
✓ Branch 64 taken 4167432 times.
✓ Branch 65 taken 1455732 times.
✓ Branch 66 taken 1058616 times.
✓ Branch 67 taken 3108816 times.
✓ Branch 68 taken 1058616 times.
✓ Branch 69 taken 3108816 times.
✓ Branch 70 taken 1058616 times.
✓ Branch 71 taken 3108816 times.
✓ Branch 72 taken 4167432 times.
✓ Branch 73 taken 1455732 times.
✓ Branch 74 taken 4167432 times.
✓ Branch 75 taken 1455732 times.
✓ Branch 76 taken 4167432 times.
✓ Branch 77 taken 1455732 times.
✓ Branch 78 taken 1058616 times.
✓ Branch 79 taken 3108816 times.
✓ Branch 80 taken 1058616 times.
✓ Branch 81 taken 3108816 times.
✓ Branch 82 taken 1058616 times.
✓ Branch 83 taken 3108816 times.
✓ Branch 84 taken 4167432 times.
✓ Branch 85 taken 1455732 times.
✓ Branch 86 taken 4167432 times.
✓ Branch 87 taken 1455732 times.
✓ Branch 88 taken 4167432 times.
✓ Branch 89 taken 1455732 times.
✓ Branch 90 taken 1058616 times.
✓ Branch 91 taken 3108816 times.
✓ Branch 92 taken 1058616 times.
✓ Branch 93 taken 3108816 times.
✓ Branch 94 taken 1058616 times.
✓ Branch 95 taken 3108816 times.
✓ Branch 96 taken 4167432 times.
✓ Branch 97 taken 1455732 times.
✓ Branch 98 taken 4167432 times.
✓ Branch 99 taken 1455732 times.
✓ Branch 100 taken 4167432 times.
✓ Branch 101 taken 1455732 times.
✓ Branch 102 taken 1058616 times.
✓ Branch 103 taken 3108816 times.
✓ Branch 104 taken 1058616 times.
✓ Branch 105 taken 3108816 times.
✓ Branch 106 taken 1058616 times.
✓ Branch 107 taken 3108816 times.
✓ Branch 108 taken 4167432 times.
✓ Branch 109 taken 1455732 times.
✓ Branch 110 taken 4167432 times.
✓ Branch 111 taken 1455732 times.
✓ Branch 112 taken 4167432 times.
✓ Branch 113 taken 1455732 times.
✓ Branch 114 taken 1058616 times.
✓ Branch 115 taken 3108816 times.
✓ Branch 116 taken 1058616 times.
✓ Branch 117 taken 3108816 times.
✓ Branch 118 taken 1058616 times.
✓ Branch 119 taken 3108816 times.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✗ Branch 123 not taken.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
✗ Branch 126 not taken.
✗ Branch 127 not taken.
✗ Branch 128 not taken.
✗ Branch 129 not taken.
✗ Branch 130 not taken.
✗ Branch 131 not taken.
✗ Branch 132 not taken.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 137 not taken.
✗ Branch 138 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✗ Branch 141 not taken.
✗ Branch 142 not taken.
✗ Branch 143 not taken.
84347466 if (globalPos[i] < lensLowerLeft_[i] - eps_ || globalPos[i] > lensUpperRight_[i] + eps_)
115 return false;
116
117 return true;
118 }
119
120 static constexpr Scalar eps_ = 1.5e-7;
121
122 GlobalPosition lensLowerLeft_;
123 GlobalPosition lensUpperRight_;
124
125 Scalar lensK_;
126 Scalar outerK_;
127
128 const PcKrSwCurve lensPcKrSwCurve_;
129 const PcKrSwCurve outerPcKrSwCurve_;
130 };
131
132 } // end namespace Dumux
133
134 #endif
135