GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/2p2c/injection/spatialparams.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 20 25 80.0%
Functions: 8 30 26.7%
Branches: 34 76 44.7%

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 TwoPTwoCTests
10 * \brief The spatial parameters of the problem where air is injected under a low permeable layer in a depth of 2700m.
11 */
12
13 #ifndef DUMUX_INJECTION_SPATIAL_PARAMS_HH
14 #define DUMUX_INJECTION_SPATIAL_PARAMS_HH
15
16 #include <dumux/porousmediumflow/properties.hh>
17 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
18 #include <dumux/material/fluidmatrixinteractions/2p/brookscorey.hh>
19
20 namespace Dumux {
21
22 /*!
23 * \ingroup TwoPTwoCTests
24 * \brief Definition of the spatial parameters for the injection problem
25 * which uses the isothermal two-phase two-component fully implicit model.
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 10 times.
✗ Branch 5 not taken.
10 class InjectionSpatialParams
29 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
30 InjectionSpatialParams<GridGeometry, Scalar>>
31 {
32 using GridView = typename GridGeometry::GridView;
33 using FVElementGeometry = typename GridGeometry::LocalView;
34 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
35 using Element = typename GridView::template Codim<0>::Entity;
36 using ThisType = InjectionSpatialParams<GridGeometry, Scalar>;
37 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, ThisType>;
38
39 static constexpr int dimWorld = GridView::dimensionworld;
40
41 using PcKrSwCurve = FluidMatrix::BrooksCoreyDefault<Scalar>;
42
43 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
44
45 public:
46 //! Export the type used for the permeability
47 using PermeabilityType = Scalar;
48
49 10 InjectionSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
50 : ParentType(gridGeometry)
51 , finePcKrSwCurve_("SpatialParams.FineMaterial")
52
12/32
✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 10 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 10 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 10 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 10 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 10 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 10 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 10 times.
✗ Branch 25 not taken.
✓ Branch 27 taken 10 times.
✗ Branch 28 not taken.
✓ Branch 29 taken 10 times.
✗ Branch 30 not taken.
✓ Branch 32 taken 10 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.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
70 , coarsePcKrSwCurve_("SpatialParams.CoarseMaterial")
53 {
54 10 layerBottom_ = 22.5;
55
56 // intrinsic permeabilities
57 10 fineK_ = 1e-13;
58 10 coarseK_ = 1e-12;
59
60 // porosities
61 10 finePorosity_ = 0.3;
62 10 coarsePorosity_ = 0.3;
63
64 // temperature
65
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 temperature_ = getParam<Scalar>("SpatialParams.InitialTemperature");
66 10 }
67
68 /*!
69 * \brief Returns the intrinsic permeability tensor \f$[m^2]\f$
70 *
71 * \param globalPos The global position
72 */
73 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
74 {
75 3846800 if (isFineMaterial_(globalPos))
76 840201 return fineK_;
77 1083199 return coarseK_;
78 }
79
80 /*!
81 * \brief Returns the porosity \f$[-]\f$
82 *
83 * \param globalPos The global position
84 */
85 Scalar porosityAtPos(const GlobalPosition& globalPos) const
86 {
87 3846800 if (isFineMaterial_(globalPos))
88 840201 return finePorosity_;
89 1083199 return coarsePorosity_;
90 }
91
92
93 /*!
94 * \brief Returns the parameter object for the capillary-pressure/
95 * saturation material law
96 *
97 * \param globalPos The global position
98 */
99 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
100 {
101 7693600 if (isFineMaterial_(globalPos))
102 1680402 return makeFluidMatrixInteraction(finePcKrSwCurve_);
103 2166398 return makeFluidMatrixInteraction(coarsePcKrSwCurve_);
104 }
105
106 /*!
107 * \brief Function for defining which phase is to be considered as the wetting phase.
108 *
109 * \param globalPos The position of the center of the element
110 * \return The wetting phase index
111 */
112 template<class FluidSystem>
113 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
114 { return FluidSystem::H2OIdx; }
115
116 /*!
117 * \brief Returns the temperature at the domain at the given position
118 * \param globalPos The position in global coordinates where the temperature should be specified
119 */
120 Scalar temperatureAtPos(const GlobalPosition& globalPos) const
121 {
122 return temperature_;
123 }
124
125 private:
126 bool isFineMaterial_(const GlobalPosition &globalPos) const
127
20/36
✗ 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 taken 301909 times.
✓ Branch 9 taken 390259 times.
✓ Branch 10 taken 301909 times.
✓ Branch 11 taken 390259 times.
✓ Branch 12 taken 538292 times.
✓ Branch 13 taken 692940 times.
✓ Branch 14 taken 538292 times.
✓ Branch 15 taken 692940 times.
✓ Branch 16 taken 840201 times.
✓ Branch 17 taken 1083199 times.
✓ Branch 18 taken 840201 times.
✓ Branch 19 taken 1083199 times.
✓ Branch 20 taken 840201 times.
✓ Branch 21 taken 1083199 times.
✓ Branch 22 taken 840201 times.
✓ Branch 23 taken 1083199 times.
✓ Branch 24 taken 840201 times.
✓ Branch 25 taken 1083199 times.
✓ Branch 26 taken 840201 times.
✓ Branch 27 taken 1083199 times.
✗ 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.
15387200 { return globalPos[dimWorld-1] > layerBottom_; }
128
129 Scalar fineK_;
130 Scalar coarseK_;
131 Scalar layerBottom_;
132
133 Scalar finePorosity_;
134 Scalar coarsePorosity_;
135
136 Scalar temperature_;
137
138 const PcKrSwCurve finePcKrSwCurve_;
139 const PcKrSwCurve coarsePcKrSwCurve_;
140 };
141
142 } // end namespace Dumux
143
144 #endif
145