GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/1p/compressible/instationary/problem.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 11 14 78.6%
Functions: 3 9 33.3%
Branches: 90 136 66.2%

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 The properties for the incompressible test
11 */
12
13 #ifndef DUMUX_COMPRESSIBLE_ONEP_TEST_PROBLEM_HH
14 #define DUMUX_COMPRESSIBLE_ONEP_TEST_PROBLEM_HH
15
16 #include <dumux/common/properties.hh>
17 #include <dumux/common/parameters.hh>
18
19 #include <dumux/common/boundarytypes.hh>
20 #include <dumux/porousmediumflow/problem.hh>
21
22 #include <dumux/material/components/h2o.hh>
23 #include <dumux/material/components/tabulatedcomponent.hh>
24 namespace Dumux {
25 /*!
26 * \ingroup OnePTests
27 * \brief Test problem for the compressible one-phase model.
28 */
29 template<class TypeTag>
30 4 class OnePTestProblem : public PorousMediumFlowProblem<TypeTag>
31 {
32 using ParentType = PorousMediumFlowProblem<TypeTag>;
33 using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView;
34 using Element = typename GridView::template Codim<0>::Entity;
35 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
36 using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
37 using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
38 using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>;
39 static constexpr int dimWorld = GridView::dimensionworld;
40 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
41
42 public:
43 4 OnePTestProblem(std::shared_ptr<const GridGeometry> gridGeometry)
44
6/16
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 4 times.
✓ Branch 15 taken 4 times.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
12 : ParentType(gridGeometry)
45 {
46 Components::TabulatedComponent<Components::H2O<Scalar>>
47
1/2
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
4 ::init(273.15, 294.15, 10, 1.0e4, 1.0e6, 200);
48 4 }
49
50 /*!
51 * \brief Specifies which kind of boundary condition should be
52 * used for which equation on a given boundary control volume.
53 *
54 * \param globalPos The position of the center of the finite volume
55 */
56 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
57 {
58
10/14
✓ Branch 0 taken 2856 times.
✓ Branch 1 taken 1020 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 8904 times.
✓ Branch 5 taken 2968 times.
✓ Branch 6 taken 12402 times.
✓ Branch 7 taken 4134 times.
✓ Branch 8 taken 3180 times.
✓ Branch 9 taken 1060 times.
✓ Branch 10 taken 12084 times.
✓ Branch 11 taken 4028 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
52636 BoundaryTypes values;
59
60 52636 Scalar eps = 1.0e-6;
61
70/98
✓ Branch 0 taken 2856 times.
✓ Branch 1 taken 1020 times.
✓ Branch 2 taken 2856 times.
✓ Branch 3 taken 1020 times.
✓ Branch 4 taken 1020 times.
✓ Branch 5 taken 1836 times.
✓ Branch 6 taken 1020 times.
✓ Branch 7 taken 1836 times.
✓ Branch 8 taken 1020 times.
✓ Branch 9 taken 1836 times.
✓ Branch 10 taken 1020 times.
✓ Branch 11 taken 1836 times.
✓ Branch 12 taken 1020 times.
✓ Branch 13 taken 1836 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✓ Branch 28 taken 8904 times.
✓ Branch 29 taken 2968 times.
✓ Branch 30 taken 8904 times.
✓ Branch 31 taken 2968 times.
✓ Branch 32 taken 2968 times.
✓ Branch 33 taken 5936 times.
✓ Branch 34 taken 2968 times.
✓ Branch 35 taken 5936 times.
✓ Branch 36 taken 2968 times.
✓ Branch 37 taken 5936 times.
✓ Branch 38 taken 2968 times.
✓ Branch 39 taken 5936 times.
✓ Branch 40 taken 2968 times.
✓ Branch 41 taken 5936 times.
✓ Branch 42 taken 12402 times.
✓ Branch 43 taken 4134 times.
✓ Branch 44 taken 12402 times.
✓ Branch 45 taken 4134 times.
✓ Branch 46 taken 4134 times.
✓ Branch 47 taken 8268 times.
✓ Branch 48 taken 4134 times.
✓ Branch 49 taken 8268 times.
✓ Branch 50 taken 4134 times.
✓ Branch 51 taken 8268 times.
✓ Branch 52 taken 4134 times.
✓ Branch 53 taken 8268 times.
✓ Branch 54 taken 4134 times.
✓ Branch 55 taken 8268 times.
✓ Branch 56 taken 3180 times.
✓ Branch 57 taken 1060 times.
✓ Branch 58 taken 3180 times.
✓ Branch 59 taken 1060 times.
✓ Branch 60 taken 1060 times.
✓ Branch 61 taken 2120 times.
✓ Branch 62 taken 1060 times.
✓ Branch 63 taken 2120 times.
✓ Branch 64 taken 1060 times.
✓ Branch 65 taken 2120 times.
✓ Branch 66 taken 1060 times.
✓ Branch 67 taken 2120 times.
✓ Branch 68 taken 1060 times.
✓ Branch 69 taken 2120 times.
✓ Branch 70 taken 12084 times.
✓ Branch 71 taken 4028 times.
✓ Branch 72 taken 12084 times.
✓ Branch 73 taken 4028 times.
✓ Branch 74 taken 4028 times.
✓ Branch 75 taken 8056 times.
✓ Branch 76 taken 4028 times.
✓ Branch 77 taken 8056 times.
✓ Branch 78 taken 4028 times.
✓ Branch 79 taken 8056 times.
✓ Branch 80 taken 4028 times.
✓ Branch 81 taken 8056 times.
✓ Branch 82 taken 4028 times.
✓ Branch 83 taken 8056 times.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
105272 if (globalPos[dimWorld-1] < eps || globalPos[dimWorld-1] > this->gridGeometry().bBoxMax()[dimWorld-1] - eps)
62 values.setAllDirichlet();
63 else
64 values.setAllNeumann();
65
66 return values;
67 }
68
69 /*!
70 * \brief Evaluates the boundary conditions for a Dirichlet control volume.
71 *
72 * \param globalPos The center of the finite volume which ought to be set.
73 *
74 * For this method, the \a values parameter stores primary variables.
75 */
76 PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
77 {
78
1/2
✓ Branch 1 taken 3816 times.
✗ Branch 2 not taken.
10096 PrimaryVariables values(0);
79
2/4
✓ Branch 1 taken 3816 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3816 times.
✗ Branch 5 not taken.
20192 values[0] = 1.0e+5*(2.0 - globalPos[dimWorld-1]);
80 return values;
81 }
82
83 /*!
84 * \brief Evaluates the initial conditions
85 *
86 * \param globalPos The center of the finite volume which ought to be set.
87 */
88 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
89 {
90 421 return PrimaryVariables(1.0e5);
91 }
92 };
93
94 } // end namespace Dumux
95
96 #endif
97