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 FacetTests | ||
10 | * \brief The problem for the bulk domain in the single-phase facet coupling test. | ||
11 | */ | ||
12 | #ifndef DUMUX_TEST_TPFAFACETCOUPLING_ONEP_BULKPROBLEM_HH | ||
13 | #define DUMUX_TEST_TPFAFACETCOUPLING_ONEP_BULKPROBLEM_HH | ||
14 | |||
15 | #include <dumux/common/properties.hh> | ||
16 | #include <dumux/common/parameters.hh> | ||
17 | #include <dumux/common/boundarytypes.hh> | ||
18 | #include <dumux/common/numeqvector.hh> | ||
19 | |||
20 | #include <dumux/porousmediumflow/problem.hh> | ||
21 | |||
22 | namespace Dumux { | ||
23 | |||
24 | /*! | ||
25 | * \ingroup FacetTests | ||
26 | * \brief Test problem for the incompressible one-phase model | ||
27 | * with coupling across the bulk grid facets. | ||
28 | */ | ||
29 | template<class TypeTag> | ||
30 | class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag> | ||
31 | { | ||
32 | using ParentType = PorousMediumFlowProblem<TypeTag>; | ||
33 | |||
34 | using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; | ||
35 | using PrimaryVariables = typename GridVariables::PrimaryVariables; | ||
36 | using Scalar = typename GridVariables::Scalar; | ||
37 | |||
38 | using GridGeometry = typename GridVariables::GridGeometry; | ||
39 | using FVElementGeometry = typename GridGeometry::LocalView; | ||
40 | using SubControlVolume = typename GridGeometry::SubControlVolume; | ||
41 | using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; | ||
42 | using GridView = typename GridGeometry::GridView; | ||
43 | using Element = typename GridView::template Codim<0>::Entity; | ||
44 | using GlobalPosition = typename Element::Geometry::GlobalCoordinate; | ||
45 | |||
46 | using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; | ||
47 | using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; | ||
48 | using NumEqVector = Dumux::NumEqVector<PrimaryVariables>; | ||
49 | |||
50 | public: | ||
51 | 6 | OnePBulkProblem(std::shared_ptr<const GridGeometry> gridGeometry, | |
52 | std::shared_ptr<typename ParentType::SpatialParams> spatialParams, | ||
53 | std::shared_ptr<CouplingManager> couplingManager, | ||
54 | const std::string& paramGroup = "") | ||
55 | : ParentType(gridGeometry, spatialParams, paramGroup) | ||
56 |
4/14✓ Branch 3 taken 6 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 6 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 6 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 6 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
|
18 | , couplingManagerPtr_(couplingManager) |
57 | { | ||
58 |
7/22✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 6 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 6 times.
✗ Branch 8 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 6 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 6 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 6 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 6 times.
✗ 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.
|
6 | problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + |
59 |
2/4✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 6 times.
✗ Branch 5 not taken.
|
12 | getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); |
60 | 6 | } | |
61 | |||
62 | //! The problem name. | ||
63 | const std::string& name() const | ||
64 |
1/2✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
|
6 | { return problemName_; } |
65 | |||
66 | //! Specifies the type of boundary condition at a given position. | ||
67 | BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const | ||
68 | { | ||
69 |
8/10✓ Branch 0 taken 14814 times.
✓ Branch 1 taken 2070 times.
✓ Branch 2 taken 22257 times.
✓ Branch 3 taken 3123 times.
✓ Branch 4 taken 9918 times.
✓ Branch 5 taken 1386 times.
✓ Branch 6 taken 4986 times.
✓ Branch 7 taken 702 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
|
59256 | BoundaryTypes values; |
70 | 59256 | values.setAllNeumann(); | |
71 |
56/70✓ Branch 0 taken 14814 times.
✓ Branch 1 taken 2070 times.
✓ Branch 2 taken 14814 times.
✓ Branch 3 taken 2070 times.
✓ Branch 4 taken 12744 times.
✓ Branch 5 taken 2070 times.
✓ Branch 6 taken 12744 times.
✓ Branch 7 taken 2070 times.
✓ Branch 8 taken 12744 times.
✓ Branch 9 taken 2070 times.
✓ Branch 10 taken 12744 times.
✓ Branch 11 taken 2070 times.
✓ Branch 12 taken 12744 times.
✓ Branch 13 taken 2070 times.
✓ Branch 14 taken 22257 times.
✓ Branch 15 taken 3123 times.
✓ Branch 16 taken 22257 times.
✓ Branch 17 taken 3123 times.
✓ Branch 18 taken 19134 times.
✓ Branch 19 taken 3123 times.
✓ Branch 20 taken 19134 times.
✓ Branch 21 taken 3123 times.
✓ Branch 22 taken 19134 times.
✓ Branch 23 taken 3123 times.
✓ Branch 24 taken 19134 times.
✓ Branch 25 taken 3123 times.
✓ Branch 26 taken 19134 times.
✓ Branch 27 taken 3123 times.
✓ Branch 28 taken 9918 times.
✓ Branch 29 taken 1386 times.
✓ Branch 30 taken 9918 times.
✓ Branch 31 taken 1386 times.
✓ Branch 32 taken 8532 times.
✓ Branch 33 taken 1386 times.
✓ Branch 34 taken 8532 times.
✓ Branch 35 taken 1386 times.
✓ Branch 36 taken 8532 times.
✓ Branch 37 taken 1386 times.
✓ Branch 38 taken 8532 times.
✓ Branch 39 taken 1386 times.
✓ Branch 40 taken 8532 times.
✓ Branch 41 taken 1386 times.
✓ Branch 42 taken 4986 times.
✓ Branch 43 taken 702 times.
✓ Branch 44 taken 4986 times.
✓ Branch 45 taken 702 times.
✓ Branch 46 taken 4284 times.
✓ Branch 47 taken 702 times.
✓ Branch 48 taken 4284 times.
✓ Branch 49 taken 702 times.
✓ Branch 50 taken 4284 times.
✓ Branch 51 taken 702 times.
✓ Branch 52 taken 4284 times.
✓ Branch 53 taken 702 times.
✓ Branch 54 taken 4284 times.
✓ Branch 55 taken 702 times.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
|
118512 | if (globalPos[0] < 1e-6 || globalPos[0] > this->gridGeometry().bBoxMax()[0] - 1e-6) |
72 | values.setAllDirichlet(); | ||
73 | return values; | ||
74 | } | ||
75 | |||
76 | //! Specifies the type of interior boundary condition at a given position. | ||
77 | ✗ | BoundaryTypes interiorBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const | |
78 | { | ||
79 |
2/4✓ Branch 0 taken 11934 times.
✓ Branch 1 taken 4158 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
16092 | BoundaryTypes values; |
80 |
2/4✓ Branch 0 taken 11934 times.
✓ Branch 1 taken 4158 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
16092 | values.setAllNeumann(); |
81 | ✗ | return values; | |
82 | } | ||
83 | |||
84 | //! Evaluates the source term at a given position. | ||
85 | ✗ | NumEqVector sourceAtPos(const GlobalPosition& globalPos) const | |
86 |
1/4✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 165672 times.
|
165672 | { return NumEqVector(0.0); } |
87 | |||
88 | //! Evaluates the Dirichlet boundary condition for a given position. | ||
89 | PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const | ||
90 | 9684 | { return initialAtPos(globalPos); } | |
91 | |||
92 | //! Evaluates the Neumann boundary condition for a boundary segment. | ||
93 | ✗ | NumEqVector neumannAtPos(const GlobalPosition& globalPos) const | |
94 |
2/2✓ Branch 0 taken 12816 times.
✓ Branch 1 taken 8424 times.
|
21240 | { return NumEqVector(0.0); } |
95 | |||
96 | //! Evaluates the initial conditions. | ||
97 | PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const | ||
98 |
5/10✓ Branch 1 taken 2736 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2736 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2736 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2736 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 2736 times.
✗ Branch 14 not taken.
|
162270 | { return PrimaryVariables(1.0 + globalPos[0]/this->gridGeometry().bBoxMax()[0]); } |
99 | |||
100 | //! Returns reference to the coupling manager. | ||
101 | const CouplingManager& couplingManager() const | ||
102 |
26/34✓ Branch 0 taken 1004310 times.
✓ Branch 1 taken 113418 times.
✓ Branch 2 taken 1004310 times.
✓ Branch 3 taken 11934 times.
✓ Branch 4 taken 101484 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 48564 times.
✓ Branch 7 taken 3233124 times.
✓ Branch 8 taken 48564 times.
✓ Branch 9 taken 3233124 times.
✓ Branch 10 taken 649980 times.
✓ Branch 11 taken 59166 times.
✓ Branch 12 taken 649980 times.
✓ Branch 13 taken 8424 times.
✓ Branch 14 taken 50742 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 8424 times.
✓ Branch 17 taken 654228 times.
✓ Branch 18 taken 8424 times.
✓ Branch 19 taken 654228 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✓ Branch 28 taken 4158 times.
✓ Branch 29 taken 658458 times.
✓ Branch 30 taken 4158 times.
✓ Branch 31 taken 658458 times.
✓ Branch 32 taken 40140 times.
✓ Branch 33 taken 2600136 times.
✓ Branch 34 taken 40140 times.
✓ Branch 35 taken 2600136 times.
|
18188928 | { return *couplingManagerPtr_; } |
103 | |||
104 | private: | ||
105 | std::shared_ptr<CouplingManager> couplingManagerPtr_; | ||
106 | std::string problemName_; | ||
107 | }; | ||
108 | |||
109 | } // end namespace Dumux | ||
110 | |||
111 | #endif | ||
112 |