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 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 | static constexpr int dimWorld = GridView::dimensionworld; | ||
51 | |||
52 | public: | ||
53 | 6 | OnePBulkProblem(std::shared_ptr<const GridGeometry> gridGeometry, | |
54 | std::shared_ptr<typename ParentType::SpatialParams> spatialParams, | ||
55 | std::shared_ptr<CouplingManager> couplingManager, | ||
56 | const std::string& paramGroup = "") | ||
57 | : ParentType(gridGeometry, spatialParams, paramGroup) | ||
58 |
4/10✓ 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.
|
18 | , couplingManagerPtr_(couplingManager) |
59 | { | ||
60 |
3/6✓ 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.
|
12 | problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + |
61 |
1/2✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
|
6 | getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); |
62 | 6 | } | |
63 | |||
64 | //! The problem name. | ||
65 | 6 | const std::string& name() const | |
66 |
1/2✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
|
6 | { return problemName_; } |
67 | |||
68 | //! Specifies the type of boundary condition at a given position. | ||
69 |
8/8✓ Branch 0 taken 7356 times.
✓ Branch 1 taken 1020 times.
✓ Branch 2 taken 11058 times.
✓ Branch 3 taken 1542 times.
✓ Branch 4 taken 4932 times.
✓ Branch 5 taken 684 times.
✓ Branch 6 taken 2484 times.
✓ Branch 7 taken 348 times.
|
29424 | BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const |
70 | { | ||
71 |
8/8✓ Branch 0 taken 7356 times.
✓ Branch 1 taken 1020 times.
✓ Branch 2 taken 11058 times.
✓ Branch 3 taken 1542 times.
✓ Branch 4 taken 4932 times.
✓ Branch 5 taken 684 times.
✓ Branch 6 taken 2484 times.
✓ Branch 7 taken 348 times.
|
29424 | BoundaryTypes values; |
72 |
8/8✓ Branch 0 taken 7356 times.
✓ Branch 1 taken 1020 times.
✓ Branch 2 taken 11058 times.
✓ Branch 3 taken 1542 times.
✓ Branch 4 taken 4932 times.
✓ Branch 5 taken 684 times.
✓ Branch 6 taken 2484 times.
✓ Branch 7 taken 348 times.
|
29424 | values.setAllNeumann(); |
73 |
16/16✓ Branch 0 taken 7356 times.
✓ Branch 1 taken 1020 times.
✓ Branch 2 taken 1020 times.
✓ Branch 3 taken 6336 times.
✓ Branch 4 taken 11058 times.
✓ Branch 5 taken 1542 times.
✓ Branch 6 taken 1542 times.
✓ Branch 7 taken 9516 times.
✓ Branch 8 taken 4932 times.
✓ Branch 9 taken 684 times.
✓ Branch 10 taken 684 times.
✓ Branch 11 taken 4248 times.
✓ Branch 12 taken 2484 times.
✓ Branch 13 taken 348 times.
✓ Branch 14 taken 348 times.
✓ Branch 15 taken 2136 times.
|
29424 | if (globalPos[1] < 1e-6 || globalPos[1] > this->gridGeometry().bBoxMax()[1] - 1e-6) |
74 | values.setAllDirichlet(); | ||
75 | return values; | ||
76 | } | ||
77 | |||
78 | //! Specifies the type of interior boundary condition at a given position. | ||
79 |
3/4✓ Branch 0 taken 5916 times.
✓ Branch 1 taken 2052 times.
✓ Branch 2 taken 4176 times.
✗ Branch 3 not taken.
|
12144 | BoundaryTypes interiorBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const |
80 | { | ||
81 |
3/4✓ Branch 0 taken 5916 times.
✓ Branch 1 taken 2052 times.
✓ Branch 2 taken 4176 times.
✗ Branch 3 not taken.
|
12144 | BoundaryTypes values; |
82 | values.setAllNeumann(); | ||
83 | return values; | ||
84 | } | ||
85 | |||
86 | //! Evaluates the source term at a given position. | ||
87 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 61248 times.
|
61248 | NumEqVector sourceAtPos(const GlobalPosition& globalPos) const |
88 | { return NumEqVector(0.0); } | ||
89 | |||
90 | //! Evaluates the Dirichlet boundary condition for a given position. | ||
91 | 2388 | PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const | |
92 | 2388 | { return initialAtPos(globalPos); } | |
93 | |||
94 | //! Evaluates the Neumann boundary condition for a boundary segment. | ||
95 |
2/2✓ Branch 0 taken 6384 times.
✓ Branch 1 taken 4176 times.
|
10560 | NumEqVector neumannAtPos(const GlobalPosition& globalPos) const |
96 | { return NumEqVector(0.0); } | ||
97 | |||
98 | //! Evaluates the initial conditions. | ||
99 | 17700 | PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const | |
100 | { | ||
101 |
2/4✓ Branch 1 taken 1692 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 696 times.
✗ Branch 5 not taken.
|
17700 | const auto g = this->spatialParams().gravity(globalPos)[dimWorld-1]; |
102 |
2/4✓ Branch 1 taken 1692 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 696 times.
✗ Branch 5 not taken.
|
17700 | const auto h = 1.0 - (3.0-globalPos[dimWorld-1])*g; |
103 |
2/4✓ Branch 1 taken 1692 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 696 times.
✗ Branch 5 not taken.
|
17700 | return PrimaryVariables(h); |
104 | } | ||
105 | |||
106 | //! Returns reference to the coupling manager. | ||
107 | 3427008 | const CouplingManager& couplingManager() const | |
108 |
12/17✓ Branch 1 taken 55812 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 23976 times.
✓ Branch 4 taken 1185096 times.
✓ Branch 6 taken 29124 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 290688 times.
✗ Branch 10 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 2052 times.
✓ Branch 15 taken 242892 times.
✓ Branch 16 taken 19800 times.
✓ Branch 17 taken 954864 times.
✓ Branch 0 taken 372540 times.
✓ Branch 5 taken 238680 times.
✓ Branch 8 taken 4176 times.
|
3429792 | { return *couplingManagerPtr_; } |
109 | |||
110 | private: | ||
111 | std::shared_ptr<CouplingManager> couplingManagerPtr_; | ||
112 | std::string problemName_; | ||
113 | }; | ||
114 | |||
115 | } // end namespace Dumux | ||
116 | |||
117 | #endif | ||
118 |