GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/test/porousmediumflow/3p/conduction/spatialparams.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 12 12 100.0%
Functions: 2 2 100.0%
Branches: 5 10 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 ThreePTests
10 * \brief Definition of the spatial parameters for the 3pni problems.
11 */
12
13 #ifndef DUMUX_THREEPNI_SPATIAL_PARAMS_HH
14 #define DUMUX_THREEPNI_SPATIAL_PARAMS_HH
15
16 #include <dumux/porousmediumflow/properties.hh>
17 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
18 #include <dumux/material/fluidmatrixinteractions/3p/parkervangenuchten.hh>
19
20 namespace Dumux {
21
22 /*!
23 * \ingroup ThreePTests
24 * \brief Definition of the spatial parameters for the 3pni problems.
25 */
26 template<class GridGeometry, class Scalar>
27
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 class ThreePNISpatialParams
28 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
29 ThreePNISpatialParams<GridGeometry, Scalar>>
30 {
31 using GridView = typename GridGeometry::GridView;
32 using FVElementGeometry = typename GridGeometry::LocalView;
33 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
34 using Element = typename GridView::template Codim<0>::Entity;
35 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
36 ThreePNISpatialParams<GridGeometry, Scalar>>;
37
38 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
39
40 using ThreePhasePcKrSw = FluidMatrix::ParkerVanGenuchten3PDefault<Scalar>;
41
42 public:
43 //! Export permeability type
44 using PermeabilityType = Scalar;
45
46 4 ThreePNISpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
47 : ParentType(gridGeometry)
48
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")
49 {
50 4 permeability_ = 1e-10;
51 4 porosity_ = 0.4;
52 4 }
53
54 /*!
55 * \brief Returns the scalar intrinsic permeability \f$[m^2]\f$
56 *
57 * \param globalPos The global position
58 */
59 710340 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
60 {
61 710340 return permeability_;
62 }
63
64 /*!
65 * \brief Returns the porosity \f$[-]\f$
66 *
67 * \param globalPos The global position
68 */
69 710474 Scalar porosityAtPos(const GlobalPosition& globalPos) const
70 {
71
1/2
✓ Branch 2 taken 134 times.
✗ Branch 3 not taken.
710474 return porosity_;
72 }
73
74 /*!
75 * \brief Returns the fluid-matrix interaction law at a given location
76 *
77 * \param globalPos The global coordinates for the given location
78 */
79 1420680 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
80 {
81 1420680 return makeFluidMatrixInteraction(pcKrSwCurve_);
82 }
83
84 private:
85
86 const ThreePhasePcKrSw pcKrSwCurve_;
87 Scalar permeability_;
88 Scalar porosity_;
89 };
90
91 } // end namespace Dumux
92
93 #endif
94