GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/2pnc/diffusion/spatialparams.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 8 16 50.0%
Functions: 1 6 16.7%
Branches: 9 28 32.1%

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 TwoPNCTests
10 * \brief Definition of the spatial parameters for a diffusion
11 * problem which uses the isothermal 2p2c box model.
12 */
13
14 #ifndef DUMUX_TWOPNC_DIFFUSION_SPATIAL_PARAMS_HH
15 #define DUMUX_TWOPNC_DIFFUSION_SPATIAL_PARAMS_HH
16
17 #include <dumux/porousmediumflow/properties.hh>
18 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
19 #include <dumux/material/fluidmatrixinteractions/2p/brookscorey.hh>
20
21 namespace Dumux {
22 /*!
23 * \ingroup TwoPNCTests
24 * \brief Definition of the spatial parameters for a diffusion
25 * problem which uses the isothermal 2p2c box model.
26 */
27 template<class GridGeometry, class Scalar>
28
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 TwoPNCDiffusionSpatialParams
29 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
30 TwoPNCDiffusionSpatialParams<GridGeometry, Scalar>>
31 {
32 using GridView = typename GridGeometry::GridView;
33 using ThisType = TwoPNCDiffusionSpatialParams<GridGeometry, Scalar>;
34 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, ThisType>;
35
36 static constexpr int dimWorld = GridView::dimensionworld;
37
38 using Element = typename GridView::template Codim<0>::Entity;
39 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
40
41 using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
42
43 using PcKrSwCurve = FluidMatrix::BrooksCoreyDefault<Scalar>;
44
45 public:
46 using PermeabilityType = DimWorldMatrix;
47
48 2 TwoPNCDiffusionSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
49 : ParentType(gridGeometry)
50 , K_(0)
51
6/18
✓ 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 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
8 , pcKrSwCurve_("SpatialParams")
52 {
53 // intrinsic permeabilities
54 4 K_[0][0] = 5e-11;
55 4 K_[1][1] = 5e-11;
56 2 }
57
58
59 /*!
60 * \brief Returns the hydraulic conductivity \f$[m^2]\f$
61 *
62 * \param globalPos The global position
63 */
64 DimWorldMatrix permeabilityAtPos(const GlobalPosition& globalPos) const
65 399000 { return K_; }
66
67 /*!
68 * \brief Defines the porosity \f$[-]\f$ of the spatial parameters
69 *
70 * \param globalPos The global position
71 */
72 Scalar porosityAtPos(const GlobalPosition& globalPos) const
73 { return 0.2; }
74
75 /*!
76 * \brief Returns the fluid-matrix interaction law at a given location
77 *
78 * \param globalPos The global coordinates for the given location
79 */
80 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
81
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 399000 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 399000 times.
1596000 { return makeFluidMatrixInteraction(pcKrSwCurve_); }
82
83 /*!
84 * \brief Function for defining which phase is to be considered as the wetting phase.
85 *
86 * \param globalPos The position of the center of the element
87 * \return The wetting phase index
88 */
89 template<class FluidSystem>
90 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
91 { return FluidSystem::H2OIdx; }
92
93 /*!
94 * \brief Returns the temperature in the domain at the given position
95 * \param globalPos The position in global coordinates where the temperature should be specified.
96 */
97 Scalar temperatureAtPos(const GlobalPosition& globalPos) const
98 {
99 return 293.15;
100 }
101
102 private:
103 DimWorldMatrix K_;
104 static constexpr Scalar eps_ = 1e-6;
105 const PcKrSwCurve pcKrSwCurve_;
106 };
107
108 } // end namespace Dumux
109
110 #endif
111