GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/spatialparams.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 9 20 45.0%
Functions: 1 7 14.3%
Branches: 14 38 36.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-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 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/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 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
7/20
✓ 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 not taken.
✓ Branch 16 taken 2 times.
✓ Branch 18 taken 2 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
6 , 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 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
60 { return permeability_; }
61
62 /*! \brief Defines the porosity in [-].
63 *
64 * \param globalPos The global position
65 */
66 Scalar porosityAtPos(const GlobalPosition& globalPos) const
67 { return porosity_; }
68
69 /*! \brief Defines the temperature in [K].
70 *
71 * \param globalPos The global position
72 */
73 Scalar temperatureAtPos(const GlobalPosition& globalPos) const
74 { return temperature_; }
75
76 /*! \brief Defines the Beavers-Joseph coefficient in [-].
77 *
78 * \param globalPos The global position
79 */
80 Scalar beaversJosephCoeffAtPos(const GlobalPosition& globalPos) const
81 { 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 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
89 {
90
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 234176 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 234176 times.
936704 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