GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/test/porousmediumflow/3pwateroil/spatialparams.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 24 24 100.0%
Functions: 1 1 100.0%
Branches: 14 18 77.8%

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 ThreePWaterOilTests
10 * \brief Definition of the spatial parameters for the steam-assisted gravity
11 * drainage (SAGD) problem.
12 */
13
14 #ifndef DUMUX_SAGD_SPATIAL_PARAMS_HH
15 #define DUMUX_SAGD_SPATIAL_PARAMS_HH
16
17 #include <dumux/porousmediumflow/properties.hh>
18 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
19
20 #include <dumux/material/fluidmatrixinteractions/3p/parkervangenuchten.hh>
21
22 namespace Dumux {
23
24 /*!
25 * \ingroup ThreePWaterOilTests
26 * \brief Definition of the spatial parameters for the steam-assisted gravity
27 * drainage (SAGD) problem
28 */
29 template<class GridGeometry, class Scalar>
30
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 class SagdSpatialParams
31 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
32 SagdSpatialParams<GridGeometry, Scalar>>
33 {
34 using GridView = typename GridGeometry::GridView;
35 using FVElementGeometry = typename GridGeometry::LocalView;
36 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
37
38 enum { dimWorld=GridView::dimensionworld };
39
40 using GlobalPosition = typename SubControlVolume::GlobalPosition;
41
42 using Element = typename GridView::template Codim<0>::Entity;
43 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
44 SagdSpatialParams<GridGeometry, Scalar>>;
45
46 using ThreePhasePcKrSw = FluidMatrix::ParkerVanGenuchten3PDefault<Scalar>;
47
48 public:
49 using PermeabilityType = Scalar;
50
51 1 SagdSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
52 : ParentType(gridGeometry)
53
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 , pcKrSwCurve_("SpatialParams")
54
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 , eps_(1e-6)
55 {
56 1 layerBottom_ = 35.0;
57
58 // intrinsic permeabilities
59 1 fineK_ = 1e-16;
60 1 coarseK_ = 4e-14;
61
62 // porosities
63 1 finePorosity_ = 0.10;
64 1 coarsePorosity_ = 0.1;
65 1 }
66
67 /*!
68 * \brief Function for defining the (intrinsic) permeability \f$[m^2]\f$
69 * \note It is possibly solution dependent.
70 *
71 * \param element The current element
72 * \param scv The sub-control volume inside the element.
73 * \param elemSol The solution at the dofs connected to the element.
74 * \return The permeability
75 */
76 template<class ElementSolution>
77
2/2
✓ Branch 0 taken 533126 times.
✓ Branch 1 taken 3321820 times.
3854946 PermeabilityType permeability(const Element& element,
78 const SubControlVolume& scv,
79 const ElementSolution& elemSol) const
80 3854946 { return permeabilityAtPos(scv.dofPosition());}
81
82 /*!
83 * \brief Returns the intrinsic permeability tensor \f$[m^2]\f$
84 *
85 * \param globalPos The global position
86 */
87 3854946 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
88 {
89 3854946 if (isFineMaterial_(globalPos))
90 533126 return fineK_;
91 3321820 return coarseK_;
92 }
93
94 /*!
95 * \brief Returns the porosity \f$[-]\f$
96 *
97 * \param globalPos The global position
98 */
99 3854946 Scalar porosityAtPos(const GlobalPosition& globalPos) const
100 {
101 3854946 if (isFineMaterial_(globalPos))
102 483270 return finePorosity_;
103 else
104 3371676 return coarsePorosity_;
105 }
106
107 /*!
108 * \brief Returns the fluid-matrix interaction law at a given location
109 *
110 * \param globalPos The global coordinates for the given location
111 */
112 7709894 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
113 {
114 7709894 return makeFluidMatrixInteraction(pcKrSwCurve_);
115 }
116
117 private:
118
119
4/4
✓ Branch 0 taken 533126 times.
✓ Branch 1 taken 3321820 times.
✓ Branch 2 taken 483270 times.
✓ Branch 3 taken 3371676 times.
7709892 bool isFineMaterial_(const GlobalPosition& pos) const
120
4/4
✓ Branch 0 taken 533126 times.
✓ Branch 1 taken 3321820 times.
✓ Branch 2 taken 483270 times.
✓ Branch 3 taken 3371676 times.
7709892 { return pos[dimWorld-1] > layerBottom_ - eps_; }
121
122 Scalar layerBottom_;
123
124 Scalar fineK_;
125 Scalar coarseK_;
126
127 Scalar finePorosity_;
128 Scalar coarsePorosity_;
129
130 const ThreePhasePcKrSw pcKrSwCurve_;
131
132 Scalar eps_;
133 };
134
135 }
136
137 #endif
138