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 A discrete fracture network embedded in an impermeable matrix. | ||
11 | * | ||
12 | * The fracture is a 2D network embedded in 3D. | ||
13 | */ | ||
14 | |||
15 | #ifndef DUMUX_ONEP_FRACTURE_TEST_PROBLEM_HH | ||
16 | #define DUMUX_ONEP_FRACTURE_TEST_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 A discrete fracture network embedded in an impermeable matrix. | ||
29 | * | ||
30 | * The fracture is a 2D network embedded in 3D. | ||
31 | * This problem uses the \ref OnePModel. | ||
32 | */ | ||
33 | template <class TypeTag> | ||
34 | class FractureProblem : public PorousMediumFlowProblem<TypeTag> | ||
35 | { | ||
36 | using ParentType = PorousMediumFlowProblem<TypeTag>; | ||
37 | using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView; | ||
38 | using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; | ||
39 | |||
40 | enum { dimWorld = GridView::dimensionworld }; | ||
41 | |||
42 | enum { | ||
43 | // index of the primary variable | ||
44 | pressureIdx = Indices::pressureIdx | ||
45 | }; | ||
46 | |||
47 | using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; | ||
48 | using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; | ||
49 | using Scalar = GetPropType<TypeTag, Properties::Scalar>; | ||
50 | using Element = typename GridView::template Codim<0>::Entity; | ||
51 | using GlobalPosition = typename Element::Geometry::GlobalCoordinate; | ||
52 | using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; | ||
53 | |||
54 | public: | ||
55 | 3 | FractureProblem(std::shared_ptr<const GridGeometry> gridGeometry) | |
56 |
7/20✓ 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 18 taken 3 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.
|
9 | : ParentType(gridGeometry) |
57 | { | ||
58 |
2/4✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 3 times.
|
3 | name_ = getParam<std::string>("Problem.Name"); |
59 | 3 | } | |
60 | |||
61 | /*! | ||
62 | * \name Problem parameters | ||
63 | */ | ||
64 | // \{ | ||
65 | |||
66 | /*! | ||
67 | * \brief Returns the problem name | ||
68 | * | ||
69 | * This is used as a prefix for files generated by the simulation. | ||
70 | */ | ||
71 | const std::string& name() const | ||
72 | { | ||
73 |
1/2✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
|
3 | return name_; |
74 | } | ||
75 | |||
76 | /*! | ||
77 | * \name Boundary conditions | ||
78 | */ | ||
79 | // \{ | ||
80 | |||
81 | /*! | ||
82 | * \brief Specifies which kind of boundary condition should be | ||
83 | * used for which equation on a given boundary segment. | ||
84 | * | ||
85 | * \param globalPos The global position | ||
86 | */ | ||
87 | BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const | ||
88 | { | ||
89 |
10/14✓ Branch 0 taken 2631 times.
✓ Branch 1 taken 210 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12408 times.
✓ Branch 5 taken 888 times.
✓ Branch 6 taken 19362 times.
✓ Branch 7 taken 1372 times.
✓ Branch 8 taken 3836 times.
✓ Branch 9 taken 280 times.
✓ Branch 10 taken 5382 times.
✓ Branch 11 taken 384 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
|
46753 | BoundaryTypes values; |
90 | |||
91 | 46753 | values.setAllNeumann(); | |
92 |
10/14✓ Branch 0 taken 2631 times.
✓ Branch 1 taken 210 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12408 times.
✓ Branch 5 taken 888 times.
✓ Branch 6 taken 19362 times.
✓ Branch 7 taken 1372 times.
✓ Branch 8 taken 3836 times.
✓ Branch 9 taken 280 times.
✓ Branch 10 taken 5382 times.
✓ Branch 11 taken 384 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
|
46753 | const auto& gg = this->gridGeometry(); |
93 |
80/112✓ Branch 0 taken 2631 times.
✓ Branch 1 taken 210 times.
✓ Branch 2 taken 2631 times.
✓ Branch 3 taken 210 times.
✓ Branch 4 taken 2631 times.
✓ Branch 5 taken 210 times.
✓ Branch 6 taken 2631 times.
✓ Branch 7 taken 210 times.
✓ Branch 8 taken 2382 times.
✓ Branch 9 taken 249 times.
✓ Branch 10 taken 2382 times.
✓ Branch 11 taken 249 times.
✓ Branch 12 taken 2382 times.
✓ Branch 13 taken 249 times.
✓ Branch 14 taken 2382 times.
✓ Branch 15 taken 249 times.
✗ 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 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✓ Branch 32 taken 12408 times.
✓ Branch 33 taken 888 times.
✓ Branch 34 taken 12408 times.
✓ Branch 35 taken 888 times.
✓ Branch 36 taken 12408 times.
✓ Branch 37 taken 888 times.
✓ Branch 38 taken 12408 times.
✓ Branch 39 taken 888 times.
✓ Branch 40 taken 11208 times.
✓ Branch 41 taken 1200 times.
✓ Branch 42 taken 11208 times.
✓ Branch 43 taken 1200 times.
✓ Branch 44 taken 11208 times.
✓ Branch 45 taken 1200 times.
✓ Branch 46 taken 11208 times.
✓ Branch 47 taken 1200 times.
✓ Branch 48 taken 19362 times.
✓ Branch 49 taken 1372 times.
✓ Branch 50 taken 19362 times.
✓ Branch 51 taken 1372 times.
✓ Branch 52 taken 19362 times.
✓ Branch 53 taken 1372 times.
✓ Branch 54 taken 19362 times.
✓ Branch 55 taken 1372 times.
✓ Branch 56 taken 17472 times.
✓ Branch 57 taken 1890 times.
✓ Branch 58 taken 17472 times.
✓ Branch 59 taken 1890 times.
✓ Branch 60 taken 17472 times.
✓ Branch 61 taken 1890 times.
✓ Branch 62 taken 17472 times.
✓ Branch 63 taken 1890 times.
✓ Branch 64 taken 3836 times.
✓ Branch 65 taken 280 times.
✓ Branch 66 taken 3836 times.
✓ Branch 67 taken 280 times.
✓ Branch 68 taken 3836 times.
✓ Branch 69 taken 280 times.
✓ Branch 70 taken 3836 times.
✓ Branch 71 taken 280 times.
✓ Branch 72 taken 3472 times.
✓ Branch 73 taken 364 times.
✓ Branch 74 taken 3472 times.
✓ Branch 75 taken 364 times.
✓ Branch 76 taken 3472 times.
✓ Branch 77 taken 364 times.
✓ Branch 78 taken 3472 times.
✓ Branch 79 taken 364 times.
✓ Branch 80 taken 5382 times.
✓ Branch 81 taken 384 times.
✓ Branch 82 taken 5382 times.
✓ Branch 83 taken 384 times.
✓ Branch 84 taken 5382 times.
✓ Branch 85 taken 384 times.
✓ Branch 86 taken 5382 times.
✓ Branch 87 taken 384 times.
✓ Branch 88 taken 4860 times.
✓ Branch 89 taken 522 times.
✓ Branch 90 taken 4860 times.
✓ Branch 91 taken 522 times.
✓ Branch 92 taken 4860 times.
✓ Branch 93 taken 522 times.
✓ Branch 94 taken 4860 times.
✓ Branch 95 taken 522 times.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 103 not taken.
✗ Branch 104 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
|
187012 | if (globalPos[0] > gg.bBoxMax()[0] - eps_ || globalPos[0] < gg.bBoxMin()[0] + eps_) |
94 | values.setAllDirichlet(); | ||
95 | |||
96 | return values; | ||
97 | } | ||
98 | |||
99 | /*! | ||
100 | * \brief Evaluates the boundary conditions for a Dirichlet | ||
101 | * boundary segment | ||
102 | * | ||
103 | * \param globalPos The global position | ||
104 | */ | ||
105 | PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const | ||
106 | { | ||
107 | 8730 | return initialAtPos(globalPos); | |
108 | } | ||
109 | |||
110 | // \} | ||
111 | |||
112 | /*! | ||
113 | * \name Volume terms | ||
114 | */ | ||
115 | // \{ | ||
116 | |||
117 | |||
118 | /*! | ||
119 | * \brief Evaluates the initial values for a control volume | ||
120 | * | ||
121 | * \param globalPos The global position | ||
122 | */ | ||
123 | PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const | ||
124 | { | ||
125 |
1/2✓ Branch 1 taken 2940 times.
✗ Branch 2 not taken.
|
4365 | PrimaryVariables values(0.0); |
126 |
1/2✓ Branch 1 taken 2940 times.
✗ Branch 2 not taken.
|
4365 | const auto& gg = this->gridGeometry(); |
127 |
8/16✓ Branch 1 taken 2940 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2940 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2940 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2940 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 2940 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 2940 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 2940 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 2940 times.
✗ Branch 23 not taken.
|
34920 | values[pressureIdx] = 1.0e5*(globalPos[0] - gg.bBoxMin()[0])/(gg.bBoxMax()[0] - gg.bBoxMin()[0]) + 1.0e5; |
128 | return values; | ||
129 | } | ||
130 | // \} | ||
131 | |||
132 | private: | ||
133 | static constexpr Scalar eps_ = 1.5e-7; | ||
134 | std::string name_; | ||
135 | }; | ||
136 | |||
137 | } // end namespace Dumux | ||
138 | |||
139 | #endif | ||
140 |