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 Test for the OnePModel in combination with the NI model for a conduction problem. | ||
11 | * | ||
12 | * The simulation domain is a tube with an elevated temperature on the left hand side. | ||
13 | */ | ||
14 | |||
15 | #ifndef DUMUX_1PNI_CONDUCTION_PROBLEM_HH | ||
16 | #define DUMUX_1PNI_CONDUCTION_PROBLEM_HH | ||
17 | |||
18 | #include <dumux/common/properties.hh> | ||
19 | #include <dumux/common/parameters.hh> | ||
20 | |||
21 | #include <dumux/common/boundarytypes.hh> | ||
22 | #include <dumux/porousmediumflow/problem.hh> | ||
23 | |||
24 | namespace Dumux { | ||
25 | |||
26 | /*! | ||
27 | * \ingroup OnePTests | ||
28 | * \brief Test for the OnePModel in combination with the NI model | ||
29 | */ | ||
30 | template <class TypeTag> | ||
31 | class OnePNISimpleProblem : public PorousMediumFlowProblem<TypeTag> | ||
32 | { | ||
33 | using ParentType = PorousMediumFlowProblem<TypeTag>; | ||
34 | using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView; | ||
35 | using Scalar = GetPropType<TypeTag, Properties::Scalar>; | ||
36 | using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; | ||
37 | using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; | ||
38 | using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; | ||
39 | using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; | ||
40 | using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; | ||
41 | using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; | ||
42 | using Element = typename GridView::template Codim<0>::Entity; | ||
43 | using GlobalPosition = typename Element::Geometry::GlobalCoordinate; | ||
44 | using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; | ||
45 | static constexpr int dimWorld = GridView::dimensionworld; | ||
46 | |||
47 | public: | ||
48 | 4 | OnePNISimpleProblem(std::shared_ptr<const GridGeometry> gridGeometry) | |
49 |
7/20✓ 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 18 taken 4 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
|
12 | : ParentType(gridGeometry) |
50 | { | ||
51 |
2/4✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 4 times.
|
4 | name_ = getParam<std::string>("Problem.Name"); |
52 |
1/2✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
|
4 | direction_ = getParam<int>("Problem.Direction"); |
53 | 4 | } | |
54 | |||
55 | const std::string& name() const | ||
56 |
1/2✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
|
4 | { return name_; } |
57 | |||
58 | |||
59 | 37048 | BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const | |
60 | { | ||
61 | 37048 | BoundaryTypes bcTypes; | |
62 | |||
63 |
8/8✓ Branch 0 taken 36508 times.
✓ Branch 1 taken 540 times.
✓ Branch 2 taken 36508 times.
✓ Branch 3 taken 540 times.
✓ Branch 4 taken 36508 times.
✓ Branch 5 taken 540 times.
✓ Branch 6 taken 36508 times.
✓ Branch 7 taken 540 times.
|
148192 | if (globalPos[direction_] < this->gridGeometry().bBoxMin()[direction_] + eps_ |
64 |
12/12✓ Branch 0 taken 36508 times.
✓ Branch 1 taken 540 times.
✓ Branch 2 taken 35968 times.
✓ Branch 3 taken 540 times.
✓ Branch 4 taken 35968 times.
✓ Branch 5 taken 540 times.
✓ Branch 6 taken 35968 times.
✓ Branch 7 taken 540 times.
✓ Branch 8 taken 35968 times.
✓ Branch 9 taken 540 times.
✓ Branch 10 taken 35968 times.
✓ Branch 11 taken 540 times.
|
37048 | || globalPos[direction_] > this->gridGeometry().bBoxMax()[direction_] - eps_) |
65 | bcTypes.setAllDirichlet(); | ||
66 | else | ||
67 | bcTypes.setAllNeumann(); | ||
68 | |||
69 | 37048 | return bcTypes; | |
70 | } | ||
71 | |||
72 | PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const | ||
73 | { | ||
74 |
22/38✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 252 times.
✓ Branch 11 taken 252 times.
✓ Branch 12 taken 252 times.
✓ Branch 13 taken 252 times.
✓ Branch 14 taken 252 times.
✓ Branch 15 taken 252 times.
✓ Branch 16 taken 252 times.
✓ Branch 17 taken 252 times.
✓ Branch 18 taken 252 times.
✓ Branch 19 taken 252 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 5400 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 5400 times.
✗ Branch 24 not taken.
✓ Branch 25 taken 5400 times.
✗ Branch 26 not taken.
✓ Branch 27 taken 5400 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✓ Branch 30 taken 20 times.
✓ Branch 31 taken 6000 times.
✓ Branch 32 taken 20 times.
✓ Branch 33 taken 6000 times.
✓ Branch 34 taken 20 times.
✓ Branch 35 taken 6000 times.
✓ Branch 36 taken 20 times.
✓ Branch 37 taken 6000 times.
|
48200 | if (globalPos[direction_] < this->gridGeometry().bBoxMin()[direction_] + eps_) |
75 | 544 | return {0, 0.0}; | |
76 | else | ||
77 | 23304 | return {1e5, 0.0}; | |
78 | } | ||
79 | |||
80 | PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const | ||
81 |
2/2✓ Branch 0 taken 20 times.
✓ Branch 1 taken 11400 times.
|
11420 | { return dirichletAtPos(globalPos); } |
82 | |||
83 | private: | ||
84 | static constexpr Scalar eps_ = 1e-6; | ||
85 | std::string name_; | ||
86 | int direction_; | ||
87 | }; | ||
88 | |||
89 | } // end namespace Dumux | ||
90 | |||
91 | #endif | ||
92 |