GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/test/porousmediumflow/1p/compressible/stationary/problem.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 12 12 100.0%
Functions: 3 3 100.0%
Branches: 47 60 78.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-FileCopyrightText: 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
2/4
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 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
10/12
✓ 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.
3504 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
59 {
60 3504 BoundaryTypes values;
61
62
10/12
✓ 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.
3504 Scalar eps = 1.0e-6;
63
20/24
✓ Branch 0 taken 224 times.
✓ Branch 1 taken 80 times.
✓ Branch 2 taken 80 times.
✓ Branch 3 taken 144 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 552 times.
✓ Branch 9 taken 184 times.
✓ Branch 10 taken 184 times.
✓ Branch 11 taken 368 times.
✓ Branch 12 taken 696 times.
✓ Branch 13 taken 232 times.
✓ Branch 14 taken 232 times.
✓ Branch 15 taken 464 times.
✓ Branch 16 taken 240 times.
✓ Branch 17 taken 80 times.
✓ Branch 18 taken 80 times.
✓ Branch 19 taken 160 times.
✓ Branch 20 taken 912 times.
✓ Branch 21 taken 304 times.
✓ Branch 22 taken 304 times.
✓ Branch 23 taken 608 times.
3504 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 688 PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
79 {
80
2/3
✓ Branch 2 taken 160 times.
✗ Branch 3 not taken.
✓ Branch 1 taken 80 times.
688 PrimaryVariables values(0);
81
2/3
✓ Branch 2 taken 160 times.
✗ Branch 3 not taken.
✓ Branch 1 taken 80 times.
688 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