GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/1p/compressible/stationary/problem.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 10 12 83.3%
Functions: 3 6 50.0%
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 #include <dumux/common/boundarytypes.hh>
19
20 #include <dumux/material/components/h2o.hh>
21 #include <dumux/material/components/tabulatedcomponent.hh>
22
23 #include <dumux/porousmediumflow/problem.hh>
24
25 namespace Dumux{
26
27 /*!
28 * \ingroup OnePTests
29 * \brief Test problem for the compressible one-phase model.
30 */
31 template<class TypeTag>
32 3 class OnePTestProblem : public PorousMediumFlowProblem<TypeTag>
33 {
34 using ParentType = PorousMediumFlowProblem<TypeTag>;
35 using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView;
36 using Element = typename GridView::template Codim<0>::Entity;
37 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
38 using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
39 using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
40 using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>;
41 static constexpr int dimWorld = GridView::dimensionworld;
42 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
43
44 public:
45 3 OnePTestProblem(std::shared_ptr<const GridGeometry> gridGeometry)
46
6/16
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 3 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 3 times.
✓ Branch 15 taken 3 times.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
9 : ParentType(gridGeometry)
47 {
48 Components::TabulatedComponent<Components::H2O<Scalar>>
49
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 ::init(273.15, 294.15, 10, 1.0e4, 1.0e6, 200);
50 3 }
51
52 /*!
53 * \brief Specifies which kind of boundary condition should be
54 * used for which equation on a given boundary control volume.
55 *
56 * \param globalPos The position of the center of the finite volume
57 */
58 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
59 {
60
10/14
✓ Branch 0 taken 224 times.
✓ Branch 1 taken 80 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 552 times.
✓ Branch 5 taken 184 times.
✓ Branch 6 taken 696 times.
✓ Branch 7 taken 232 times.
✓ Branch 8 taken 240 times.
✓ Branch 9 taken 80 times.
✓ Branch 10 taken 912 times.
✓ Branch 11 taken 304 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
3504 BoundaryTypes values;
61
62 3504 Scalar eps = 1.0e-6;
63
70/98
✓ Branch 0 taken 224 times.
✓ Branch 1 taken 80 times.
✓ Branch 2 taken 224 times.
✓ Branch 3 taken 80 times.
✓ Branch 4 taken 80 times.
✓ Branch 5 taken 144 times.
✓ Branch 6 taken 80 times.
✓ Branch 7 taken 144 times.
✓ Branch 8 taken 80 times.
✓ Branch 9 taken 144 times.
✓ Branch 10 taken 80 times.
✓ Branch 11 taken 144 times.
✓ Branch 12 taken 80 times.
✓ Branch 13 taken 144 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 552 times.
✓ Branch 29 taken 184 times.
✓ Branch 30 taken 552 times.
✓ Branch 31 taken 184 times.
✓ Branch 32 taken 184 times.
✓ Branch 33 taken 368 times.
✓ Branch 34 taken 184 times.
✓ Branch 35 taken 368 times.
✓ Branch 36 taken 184 times.
✓ Branch 37 taken 368 times.
✓ Branch 38 taken 184 times.
✓ Branch 39 taken 368 times.
✓ Branch 40 taken 184 times.
✓ Branch 41 taken 368 times.
✓ Branch 42 taken 696 times.
✓ Branch 43 taken 232 times.
✓ Branch 44 taken 696 times.
✓ Branch 45 taken 232 times.
✓ Branch 46 taken 232 times.
✓ Branch 47 taken 464 times.
✓ Branch 48 taken 232 times.
✓ Branch 49 taken 464 times.
✓ Branch 50 taken 232 times.
✓ Branch 51 taken 464 times.
✓ Branch 52 taken 232 times.
✓ Branch 53 taken 464 times.
✓ Branch 54 taken 232 times.
✓ Branch 55 taken 464 times.
✓ Branch 56 taken 240 times.
✓ Branch 57 taken 80 times.
✓ Branch 58 taken 240 times.
✓ Branch 59 taken 80 times.
✓ Branch 60 taken 80 times.
✓ Branch 61 taken 160 times.
✓ Branch 62 taken 80 times.
✓ Branch 63 taken 160 times.
✓ Branch 64 taken 80 times.
✓ Branch 65 taken 160 times.
✓ Branch 66 taken 80 times.
✓ Branch 67 taken 160 times.
✓ Branch 68 taken 80 times.
✓ Branch 69 taken 160 times.
✓ Branch 70 taken 912 times.
✓ Branch 71 taken 304 times.
✓ Branch 72 taken 912 times.
✓ Branch 73 taken 304 times.
✓ Branch 74 taken 304 times.
✓ Branch 75 taken 608 times.
✓ Branch 76 taken 304 times.
✓ Branch 77 taken 608 times.
✓ Branch 78 taken 304 times.
✓ Branch 79 taken 608 times.
✓ Branch 80 taken 304 times.
✓ Branch 81 taken 608 times.
✓ Branch 82 taken 304 times.
✓ Branch 83 taken 608 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.
7008 if (globalPos[dimWorld-1] < eps || globalPos[dimWorld-1] > this->gridGeometry().bBoxMax()[dimWorld-1] - eps)
64 values.setAllDirichlet();
65 else
66 values.setAllNeumann();
67
68 return values;
69 }
70
71 /*!
72 * \brief Evaluates the boundary conditions for a Dirichlet control volume.
73 *
74 * \param globalPos The center of the finite volume which ought to be set.
75 *
76 * For this method, the \a values parameter stores primary variables.
77 */
78 PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
79 {
80
1/2
✓ Branch 1 taken 288 times.
✗ Branch 2 not taken.
688 PrimaryVariables values(0);
81
2/4
✓ Branch 1 taken 288 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 288 times.
✗ Branch 5 not taken.
1376 values[0] = 1.0e+5*(2.0 - globalPos[dimWorld-1]);
82 return values;
83 }
84
85 /*!
86 * \brief Evaluates the initial conditions
87 *
88 * \param globalPos The center of the finite volume which ought to be set.
89 */
90 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
91 {
92 return PrimaryVariables(1.0e5);
93 }
94 };
95
96 } // end namespace Dumux
97
98 #endif
99