GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/test/porousmediumflow/3p3c/columnxylol/spatialparams.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 29 29 100.0%
Functions: 2 2 100.0%
Branches: 24 32 75.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 ThreePThreeCTests
10 * \brief Definition of the spatial parameters for the column problem.
11 */
12 #ifndef DUMUX_COLUMNXYLOL_SPATIAL_PARAMS_HH
13 #define DUMUX_COLUMNXYLOL_SPATIAL_PARAMS_HH
14
15 #include <dumux/porousmediumflow/properties.hh>
16 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
17 #include <dumux/material/fluidmatrixinteractions/3p/parkervangenuchten.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup ThreePThreeCModel
23 * \brief Definition of the spatial parameters for the column problem.
24 */
25 template<class GridGeometry, class Scalar>
26
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 class ColumnSpatialParams
27 : public FVPorousMediumFlowSpatialParams<GridGeometry, Scalar,
28 ColumnSpatialParams<GridGeometry, Scalar>>
29 {
30 using GridView = typename GridGeometry::GridView;
31 using FVElementGeometry = typename GridGeometry::LocalView;
32 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
33
34 using Element = typename GridView::template Codim<0>::Entity;
35 using ParentType = FVPorousMediumFlowSpatialParams<GridGeometry, Scalar,
36 ColumnSpatialParams<GridGeometry, Scalar>>;
37
38 using GlobalPosition = typename SubControlVolume::GlobalPosition;
39
40 using ThreePhasePcKrSw = FluidMatrix::ParkerVanGenuchten3PDefault<Scalar>;
41
42 public:
43 using PermeabilityType = Scalar;
44
45 2 ColumnSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
46 : ParentType(gridGeometry)
47
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 , pcKrSwCurveFine_("SpatialParams.Fine")
48
4/8
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
6 , pcKrSwCurveCoarse_("SpatialParams.Coarse")
49 {
50 // intrinsic permeabilities
51 2 fineK_ = 1.4e-11;
52 2 coarseK_ = 1.4e-8;
53
54 // porosities
55 2 porosity_ = 0.46;
56
57 // specific heat capacities
58
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 fineHeatCap_ = getParam<Scalar>("Component.SolidHeatCapacityFine", 850.0);
59
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 coarseHeatCap_ = getParam<Scalar>("Component.SolidHeatCapacityCoarse", 84000.0);
60 2 }
61
62 /*!
63 * \brief Function for defining the (intrinsic) permeability \f$[m^2]\f$
64 * \note It is possibly solution dependent.
65 *
66 * \param element The current element
67 * \param scv The sub-control volume inside the element.
68 * \param elemSol The solution at the dofs connected to the element.
69 * \return The permeability
70 */
71 template<class ElementSolution>
72
2/2
✓ Branch 0 taken 836661 times.
✓ Branch 1 taken 2459996 times.
3296657 PermeabilityType permeability(const Element& element,
73 const SubControlVolume& scv,
74 const ElementSolution& elemSol) const
75 {
76 3296657 const auto& globalPos = scv.dofPosition();
77 3296657 if (isFineMaterial_(globalPos))
78 836661 return fineK_;
79 2459996 return coarseK_;
80 }
81
82 /*! \brief Defines the porosity in [-].
83 *
84 * \param globalPos The global position where we evaluate
85 */
86 3296657 Scalar porosityAtPos(const GlobalPosition& globalPos) const
87 {
88 3296657 return porosity_;
89 }
90
91 /*!
92 * \brief Returns the fluid-matrix interaction law.
93 *
94 * \param element The current element
95 * \param scv The sub-control volume inside the element.
96 * \param elemSol The solution at the dofs connected to the element.
97 */
98 template<class ElementSolution>
99
2/2
✓ Branch 0 taken 836661 times.
✓ Branch 1 taken 2459996 times.
3296657 auto fluidMatrixInteraction(const Element& element,
100 const SubControlVolume& scv,
101 const ElementSolution& elemSol) const
102 {
103 3296657 const auto& globalPos = scv.dofPosition();
104 3296657 if (isFineMaterial_(globalPos))
105 836661 return makeFluidMatrixInteraction(pcKrSwCurveFine_);
106 else
107 2459996 return makeFluidMatrixInteraction(pcKrSwCurveCoarse_);
108 }
109
110 /*!
111 * \brief Returns the user-defined solid heat capacity.
112 *
113 * \param element The current element
114 * \param scv The sub-control volume inside the element.
115 * \param elemSol The solution at the dofs connected to the element.
116 * \param solidState The solid state
117 * \return The solid heat capacity
118 */
119 template <class ElementSolution, class SolidState>
120
2/2
✓ Branch 0 taken 836661 times.
✓ Branch 1 taken 2459996 times.
3296657 Scalar solidHeatCapacity(const Element& element,
121 const SubControlVolume& scv,
122 const ElementSolution& elemSol,
123 const SolidState& solidState) const
124 {
125 3296657 const auto& globalPos = scv.dofPosition();
126 3296657 if (isFineMaterial_(globalPos))
127 836661 return fineHeatCap_;
128 else
129 2459996 return coarseHeatCap_;
130 }
131
132 private:
133
4/4
✓ Branch 0 taken 836661 times.
✓ Branch 1 taken 2459996 times.
✓ Branch 2 taken 836661 times.
✓ Branch 3 taken 2459996 times.
6593314 bool isFineMaterial_(const GlobalPosition &globalPos) const
134 {
135
6/6
✓ Branch 0 taken 836661 times.
✓ Branch 1 taken 2459996 times.
✓ Branch 2 taken 836661 times.
✓ Branch 3 taken 2459996 times.
✓ Branch 4 taken 836661 times.
✓ Branch 5 taken 2459996 times.
9889971 return (0.90 - eps_ <= globalPos[1]);
136 }
137
138 Scalar fineK_;
139 Scalar coarseK_;
140
141 Scalar porosity_;
142
143 Scalar fineHeatCap_;
144 Scalar coarseHeatCap_;
145
146 const ThreePhasePcKrSw pcKrSwCurveFine_;
147 const ThreePhasePcKrSw pcKrSwCurveCoarse_;
148
149 static constexpr Scalar eps_ = 1e-6;
150 };
151
152 } // end namespace Dumux
153
154 #endif
155