GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/spatialparams.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 18 18 100.0%
Functions: 1 1 100.0%
Branches: 9 18 50.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 BoundaryTests
10 * \brief The spatial parameters class for the test problem using the 1p cc model.
11 */
12
13 #ifndef DUMUX_CONSERVATION_SPATIAL_PARAMS_HH
14 #define DUMUX_CONSERVATION_SPATIAL_PARAMS_HH
15
16 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
17 #include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup BoundaryTests
23 * \brief The spatial parameters class for the test problem using the
24 * 1p cc model.
25 */
26 template<class GridGeometry, class Scalar>
27
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 class TwoPTwoCSpatialParams
28 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, TwoPTwoCSpatialParams<GridGeometry, Scalar>>
29 {
30 using GridView = typename GridGeometry::GridView;
31 using Element = typename GridView::template Codim<0>::Entity;
32 using FVElementGeometry = typename GridGeometry::LocalView;
33 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
34 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, TwoPTwoCSpatialParams<GridGeometry, Scalar>>;
35
36 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
37
38 using PcKrSwCurve = FluidMatrix::VanGenuchtenDefault<Scalar>;
39
40 public:
41 using PermeabilityType = Scalar;
42
43 2 TwoPTwoCSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
44 : ParentType(gridGeometry)
45
3/6
✓ 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.
4 , pcKrSwCurve_("SpatialParams")
46 {
47
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 permeability_ = getParam<Scalar>("SpatialParams.Permeability");
48
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 porosity_ = getParam<Scalar>("SpatialParams.Porosity");
49
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 alphaBJ_ = getParam<Scalar>("SpatialParams.AlphaBJ");
50
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 temperature_ = getParam<Scalar>("SpatialParams.PorousMediumTemperature");
51 2 }
52
53 /*!
54 * \brief Function for defining the (intrinsic) permeability \f$[m^2]\f$.
55 *
56 * \param globalPos The global position
57 * \return the intrinsic permeability
58 */
59 234864 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
60 234864 { return permeability_; }
61
62 /*! \brief Defines the porosity in [-].
63 *
64 * \param globalPos The global position
65 */
66 234864 Scalar porosityAtPos(const GlobalPosition& globalPos) const
67 234864 { return porosity_; }
68
69 /*! \brief Defines the temperature in [K].
70 *
71 * \param globalPos The global position
72 */
73 109008 Scalar temperatureAtPos(const GlobalPosition& globalPos) const
74 109008 { return temperature_; }
75
76 /*! \brief Defines the Beavers-Joseph coefficient in [-].
77 *
78 * \param globalPos The global position
79 */
80 142570 Scalar beaversJosephCoeffAtPos(const GlobalPosition& globalPos) const
81 142570 { return alphaBJ_; }
82
83 /*!
84 * \brief Returns the parameters for the material law at a given location
85 *
86 * \param globalPos The global coordinates for the given location
87 */
88 469728 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
89 {
90
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 234864 times.
469728 return makeFluidMatrixInteraction(pcKrSwCurve_);
91 }
92
93 /*!
94 * \brief Function for defining which phase is to be considered as the wetting phase.
95 *
96 * \param globalPos The global position
97 * \return The wetting phase index
98 */
99 template<class FluidSystem>
100 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
101 { return FluidSystem::phase0Idx; }
102
103 private:
104 Scalar permeability_;
105 Scalar porosity_;
106 Scalar alphaBJ_;
107 Scalar temperature_;
108 const PcKrSwCurve pcKrSwCurve_;
109 static constexpr Scalar eps_ = 1.0e-7;
110 };
111
112 } // end namespace Dumux
113
114 #endif
115