GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/test/porousmediumflow/2p1c/spatialparams.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 14 14 100.0%
Functions: 2 2 100.0%
Branches: 7 12 58.3%

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 TwoPOneCTests
10 * \brief Spatial parameters non-isothermal steam injection test problem for the 2p1cni model.
11 */
12
13 #ifndef DUMUX_STEAMINJECTION_SPATIAL_PARAMS_HH
14 #define DUMUX_STEAMINJECTION_SPATIAL_PARAMS_HH
15
16 #include <dumux/porousmediumflow/properties.hh>
17 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
18 #include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh>
19
20 namespace Dumux {
21 /*!
22 * \ingroup TwoPOneCTests
23 * \brief Definition of the spatial parameters for various steam injection problems.
24 */
25 template<class GridGeometry, class Scalar>
26
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 class InjectionProblemSpatialParams
27 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
28 InjectionProblemSpatialParams<GridGeometry, Scalar>>
29 {
30 using GridView = typename GridGeometry::GridView;
31 using FVElementGeometry = typename GridGeometry::LocalView;
32 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
33 using Element = typename GridView::template Codim<0>::Entity;
34 using ThisType = InjectionProblemSpatialParams<GridGeometry, Scalar>;
35 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, ThisType>;
36
37 static constexpr int dimWorld = GridView::dimensionworld;
38
39 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
40
41 using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
42
43 using PcKrSwCurve = FluidMatrix::VanGenuchtenDefault<Scalar>;
44
45 public:
46 using PermeabilityType = DimWorldMatrix;
47
48 4 InjectionProblemSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
49 : ParentType(gridGeometry)
50
3/6
✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 4 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
8 , pcKrSwCurve_("SpatialParams")
51 {
52
1/2
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
4 gasWetting_ = getParam<bool>("SpatialParams.GasWetting", false);
53 4 }
54
55 /*!
56 * \brief Returns the hydraulic conductivity \f$[m^2]\f$
57 *
58 * \param globalPos The global position
59 */
60 1226483 DimWorldMatrix permeabilityAtPos(const GlobalPosition& globalPos) const
61 {
62 2452966 DimWorldMatrix permMatrix(0.0);
63
64 // intrinsic permeability
65 1226483 permMatrix[0][0] = 1e-9;
66 1226483 permMatrix[1][1] = 1e-9;
67
68 return permMatrix; //default value
69 }
70
71 /*!
72 * \brief Defines the porosity \f$[-]\f$ of the spatial parameters
73 *
74 * \param globalPos The global position
75 */
76 Scalar porosityAtPos(const GlobalPosition& globalPos) const
77 {
78 return 0.4;
79 }
80
81 /*!
82 * \brief Returns the parameter object for the capillary-pressure/
83 * saturation material law.
84 *
85 * \param globalPos The global position
86 */
87 2452970 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
88 {
89 2452970 return makeFluidMatrixInteraction(pcKrSwCurve_);
90 }
91
92 /*!
93 * \brief Function for defining which phase is to be considered as the wetting phase.
94 *
95 * \param globalPos The position of the center of the element
96 * \return The wetting phase index
97 */
98 template<class FluidSystem>
99 1226487 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
100 {
101
2/2
✓ Branch 0 taken 825160 times.
✓ Branch 1 taken 401327 times.
1226487 if (gasWetting_)
102 return FluidSystem::gasPhaseIdx;
103 else
104 825160 return FluidSystem::liquidPhaseIdx;
105 }
106
107 private:
108 bool gasWetting_;
109 const PcKrSwCurve pcKrSwCurve_;
110 };
111
112 }
113
114 #endif
115