GCC Code Coverage Report


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