GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/multidomain/embedded/1d3d/1p2c_richards2c/spatialparams_soil.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 7 14 50.0%
Functions: 1 5 20.0%
Branches: 12 34 35.3%

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 EmbeddedTests
10 * \brief Definition of the spatial parameters for the soil problem.
11 */
12
13 #ifndef DUMUX_SOIL_SPATIAL_PARAMS_HH
14 #define DUMUX_SOIL_SPATIAL_PARAMS_HH
15
16 #include <dumux/common/parameters.hh>
17 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
18 #include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh>
19
20 namespace Dumux {
21
22 /*!
23 * \ingroup EmbeddedTests
24 * \brief Definition of the spatial parameters for the soil problem.
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 1 times.
✗ Branch 5 not taken.
1 class SoilSpatialParams
28 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry,Scalar, SoilSpatialParams<GridGeometry, Scalar>>
29 {
30 using ThisType = SoilSpatialParams<GridGeometry, Scalar>;
31 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, ThisType>;
32 using GridView = typename GridGeometry::GridView;
33 using Element = typename GridView::template Codim<0>::Entity;
34 using SubControlVolume = typename GridGeometry::SubControlVolume;
35 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
36
37 using PcKrSwCurve = FluidMatrix::VanGenuchtenDefault<Scalar>;
38
39 public:
40 // export permeability type
41 using PermeabilityType = Scalar;
42
43 1 SoilSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
44 : ParentType(gridGeometry)
45
7/20
✓ 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 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 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.
4 , pcKrSwCurve_("Soil.SpatialParams")
46 {
47 // perm and poro
48
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 permeability_ = getParam<Scalar>("Soil.SpatialParams.Permeability");
49
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 porosity_ = getParam<Scalar>("Soil.SpatialParams.Porosity");
50 1 }
51
52 /*!
53 * \brief Defines the intrinsic permeability \f$\mathrm{[m^2]}\f$.
54 *
55 * \param element The element
56 * \param scv The sub control volume
57 * \param elemSol The element solution vector
58 */
59 template<class ElementSolution>
60 PermeabilityType permeability(const Element& element,
61 const SubControlVolume& scv,
62 const ElementSolution& elemSol) const
63 {
64 return permeability_;
65 }
66
67 /*!
68 * \brief Defines the porosity \f$\mathrm{[-]}\f$.
69 *
70 * \param element The current finite element
71 * \param scv The sub control volume
72 * \param elemSol The current element solution vector
73 */
74 template<class ElementSolution>
75 Scalar porosity(const Element& element,
76 const SubControlVolume& scv,
77 const ElementSolution& elemSol) const
78 {
79 return porosity_;
80 }
81
82 /*!
83 * \brief Returns the temperature \f$[K]\f$.
84 *
85 * \param globalPos the scv center
86 */
87 Scalar temperatureAtPos(const GlobalPosition& globalPos) const
88 {
89 return 273.15 + 10.0;
90 }
91
92 /*!
93 * \brief Returns the parameters for the material law at a given location
94 *
95 * \param globalPos The global coordinates for the given location
96 */
97 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
98 {
99
2/4
✓ Branch 2 taken 329394 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 329394 times.
✗ Branch 5 not taken.
1317578 return makeFluidMatrixInteraction(pcKrSwCurve_);
100 }
101
102 private:
103 const PcKrSwCurve pcKrSwCurve_;
104 Scalar permeability_;
105 Scalar porosity_;
106 };
107
108 } // end namespace Dumux
109
110 #endif
111