GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/1p/rootbenchmark/spatialparams.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 10 20 50.0%
Functions: 1 6 16.7%
Branches: 8 24 33.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 OnePTests
10 * \brief Root benchmark
11 */
12
13 #ifndef DUMUX_ONEP_ROOTBENCHMARK_SPATIALPARAMS_HH
14 #define DUMUX_ONEP_ROOTBENCHMARK_SPATIALPARAMS_HH
15
16 #include <dumux/porousmediumflow/properties.hh>
17 #include <dumux/porousmediumflow/fvspatialparams1p.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup OnePTests
23 * \brief Root benchmark spatial params
24 */
25 template<class GridGeometry, class Scalar>
26
1/6
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
12 class RootBenchmarkSpatialParams
27 : public FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar,
28 RootBenchmarkSpatialParams<GridGeometry, Scalar>>
29 {
30 using FVElementGeometry = typename GridGeometry::LocalView;
31 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
32 using GridView = typename GridGeometry::GridView;
33 using Element = typename GridView::template Codim<0>::Entity;
34
35 using ThisType = RootBenchmarkSpatialParams<GridGeometry, Scalar>;
36 using ParentType = FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, ThisType>;
37
38 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
39
40 public:
41 // export permeability type
42 using PermeabilityType = Scalar;
43
44 12 RootBenchmarkSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
45
2/8
✓ Branch 2 taken 12 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
12 : ParentType(gridGeometry)
46 {
47
1/2
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
12 radius_ = getParam<double>("Problem.Radius");
48
1/2
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
12 const auto rho = getParam<double>("Component.LiquidDensity");
49
1/2
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
12 const auto mu = getParam<double>("Component.LiquidKinematicViscosity")*rho;
50
1/2
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
12 Kx_ = getParam<double>("Problem.AxialConductivity")/(86400.0*1000*9.81)*1e-6; // cm^3/day -> m^4/(Pa*s)
51
1/2
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
12 Kr_ = getParam<double>("Problem.RadialConductivity")/(86400.0*1000*9.81); // 1/day -> m/(Pa*s)
52 12 permeability_ = Kx_*mu/(M_PI*radius_*radius_);
53 12 }
54
55 /*!
56 * \brief Function for defining the (intrinsic) permeability \f$[m^2]\f$.
57 */
58 template<class ElementSolution>
59 PermeabilityType permeability(const Element& element,
60 const SubControlVolume& scv,
61 const ElementSolution& elemSol) const
62 {
63 return permeability_;
64 }
65
66 /*!
67 * \brief Returns the root radius in \f$[m]\f$.
68 */
69 Scalar radius() const
70 { return radius_; }
71
72 /*!
73 * \brief The axial conductivity \f$[m^4 Pa^{-1} s^{-1}]\f$.
74 */
75 Scalar axialConductivity() const
76 { return Kx_; }
77
78 /*!
79 * \brief The radial conductivity \f$[m Pa^{-1} s^{-1}]\f$.
80 */
81 Scalar radialConductivity() const
82 { return Kr_; }
83
84 /*!
85 * \brief The porosity \f$\mathrm{[-]}\f$.
86 */
87 Scalar porosityAtPos(const GlobalPosition& globalPos) const
88 { return 1.0; }
89
90 /*!
91 * \brief Returns how much the domain is extruded at a given sub-control volume.
92 * Assume circular cross section with given radius
93 */
94 Scalar extrusionFactorAtPos(const GlobalPosition& globalPos) const
95 { return M_PI*radius_*radius_; }
96
97 private:
98 Scalar radius_, permeability_, Kx_, Kr_;
99 static constexpr Scalar eps_ = 1e-8;
100 };
101
102 } // end namespace Dumux
103
104 #endif
105