GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/3p3c/columnxylol/spatialparams.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 17 28 60.7%
Functions: 2 12 16.7%
Branches: 27 84 32.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 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/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 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 , pcKrSwCurveFine_("SpatialParams.Fine")
48
12/30
✓ 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 15 taken 2 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 2 times.
✗ Branch 19 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 29 taken 2 times.
✗ Branch 30 not taken.
✓ Branch 32 taken 2 times.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
14 , 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/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 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 PermeabilityType permeability(const Element& element,
73 const SubControlVolume& scv,
74 const ElementSolution& elemSol) const
75 {
76
2/4
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 2459996 times.
✓ Branch 3 taken 836661 times.
3296657 const auto& globalPos = scv.dofPosition();
77 6593314 if (isFineMaterial_(globalPos))
78 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 Scalar porosityAtPos(const GlobalPosition& globalPos) const
87 {
88 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 auto fluidMatrixInteraction(const Element& element,
100 const SubControlVolume& scv,
101 const ElementSolution& elemSol) const
102 {
103
2/4
✓ Branch 0 taken 836661 times.
✓ Branch 1 taken 2459996 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
3296657 const auto& globalPos = scv.dofPosition();
104 6593314 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 Scalar solidHeatCapacity(const Element& element,
121 const SubControlVolume& scv,
122 const ElementSolution& elemSol,
123 const SolidState& solidState) const
124 {
125 const auto& globalPos = scv.dofPosition();
126 if (isFineMaterial_(globalPos))
127 return fineHeatCap_;
128 else
129 return coarseHeatCap_;
130 }
131
132 private:
133 bool isFineMaterial_(const GlobalPosition &globalPos) const
134 {
135
8/28
✗ 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 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 836661 times.
✓ Branch 17 taken 2459996 times.
✓ Branch 18 taken 836661 times.
✓ Branch 19 taken 2459996 times.
✓ Branch 20 taken 2459996 times.
✓ Branch 21 taken 836661 times.
✓ Branch 22 taken 2459996 times.
✓ Branch 23 taken 836661 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
13186628 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