GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/richards/analytical/spatialparams.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 7 14 50.0%
Functions: 1 5 20.0%
Branches: 9 32 28.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 RichardsTests
10 * \brief Spatial parameters for the RichardsAnalyticalProblem.
11 */
12
13 #ifndef DUMUX_RICHARDS_ANALYTICAL_SPATIAL_PARAMETERS_HH
14 #define DUMUX_RICHARDS_ANALYTICAL_SPATIAL_PARAMETERS_HH
15
16 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
17 #include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
18
19 #include <dumux/porousmediumflow/richards/model.hh>
20
21 namespace Dumux {
22
23 /*!
24 * \ingroup RichardsTests
25 * \brief The spatial parameters for the RichardsAnalyticalProblem.
26 */
27 template<class GridGeometry, class Scalar>
28 class RichardsAnalyticalSpatialParams
29 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
30 RichardsAnalyticalSpatialParams<GridGeometry, Scalar>>
31 {
32 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
33 RichardsAnalyticalSpatialParams<GridGeometry, Scalar>>;
34
35 using GridView = typename GridGeometry::GridView;
36 using Element = typename GridView::template Codim<0>::Entity;
37 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
38
39 using PcKrSwCurve = FluidMatrix::LinearMaterialDefault<Scalar>;
40
41 public:
42
43 // export permeability type
44 using PermeabilityType = Scalar;
45
46 1 RichardsAnalyticalSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
47
3/14
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
2 : ParentType(gridGeometry)
48 {
49 1 permeability_ = 5e-12;
50
51
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 typename PcKrSwCurve::BasicParams params(0/*pcEntry*/, 1e10/*pcMax*/);
52
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
1 pcKrSwCurve_ = std::make_unique<PcKrSwCurve>(params);
53 1 }
54
55 /*!
56 * \brief Returns the intrinsic permeability tensor [m^2] at a given location
57 * \param globalPos The global position where we evaluate
58 */
59 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
60 {
61 return permeability_;
62 }
63
64 /*!
65 * \brief Returns the porosity [] at a given location
66 * \param globalPos The global position where we evaluate
67 */
68 Scalar porosityAtPos(const GlobalPosition& globalPos) const
69 { return 0.4; }
70
71 /*!
72 * \brief Returns the fluid-matrix interaction law at a given location
73 * \param globalPos A global coordinate vector
74 */
75 auto fluidMatrixInteractionAtPos(const GlobalPosition &globalPos) const
76 {
77
3/12
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 7174144 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 7174144 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 7174144 times.
43044864 return makeFluidMatrixInteraction(*pcKrSwCurve_);
78 }
79
80 /*!
81 * \brief Returns the temperature [K] at a given location
82 * \param globalPos A global coordinate vector
83 */
84 Scalar temperatureAtPos(const GlobalPosition &globalPos) const
85 { return 273.15 + 10.0; } // -> 10°C
86
87 private:
88 Scalar permeability_;
89 std::unique_ptr<PcKrSwCurve> pcKrSwCurve_;
90 };
91
92 } // end namespace Dumux
93
94 #endif
95