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 lower-dimensional domain in the single-phase facet coupling test. | ||
11 | */ | ||
12 | #ifndef DUMUX_TEST_TPFAFACETCOUPLING_ONEP_LOWDIMPROBLEM_HH | ||
13 | #define DUMUX_TEST_TPFAFACETCOUPLING_ONEP_LOWDIMPROBLEM_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 The lower-dimensional test problem for the incompressible | ||
27 | * one-phase model with coupling across the bulk grid facets. | ||
28 | */ | ||
29 | template<class TypeTag> | ||
30 | class OnePLowDimProblem : public PorousMediumFlowProblem<TypeTag> | ||
31 | { | ||
32 | using ParentType = PorousMediumFlowProblem<TypeTag>; | ||
33 | |||
34 | using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; | ||
35 | using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; | ||
36 | using PrimaryVariables = typename GridVariables::PrimaryVariables; | ||
37 | using Scalar = typename GridVariables::Scalar; | ||
38 | |||
39 | using GridGeometry = typename GridVariables::GridGeometry; | ||
40 | using FVElementGeometry = typename GridGeometry::LocalView; | ||
41 | using SubControlVolume = typename GridGeometry::SubControlVolume; | ||
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 | OnePLowDimProblem(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/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) |
59 | { | ||
60 |
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") + "_" + |
61 |
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"); |
62 | 6 | } | |
63 | |||
64 | //! The problem name. | ||
65 | 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 | ✗ | BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const | |
70 | { | ||
71 |
2/4✗ Branch 0 not taken.
✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
|
72 | BoundaryTypes values; |
72 |
2/4✗ Branch 0 not taken.
✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
|
72 | values.setAllNeumann(); |
73 | ✗ | return values; | |
74 | } | ||
75 | |||
76 | //! Evaluates the source term at a given position. | ||
77 | 696 | NumEqVector source(const Element& element, | |
78 | const FVElementGeometry& fvGeometry, | ||
79 | const ElementVolumeVariables& elemVolVars, | ||
80 | const SubControlVolume& scv) const | ||
81 | { | ||
82 | // evaluate sources from bulk domain | ||
83 | 1392 | auto source = couplingManagerPtr_->evalSourcesFromBulk(element, fvGeometry, elemVolVars, scv); | |
84 | 696 | source /= scv.volume()*elemVolVars[scv].extrusionFactor(); | |
85 | 696 | return source; | |
86 | } | ||
87 | |||
88 | //! Evaluates the Dirichlet boundary condition for a given position. | ||
89 | PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const | ||
90 | ✗ | { return initialAtPos(globalPos); } | |
91 | |||
92 | //! Evaluates the initial conditions. | ||
93 | PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const | ||
94 | { | ||
95 | ✗ | const auto g = this->spatialParams().gravity(globalPos)[dimWorld-1]; | |
96 | ✗ | const auto h = 1.0 - (3.0-globalPos[dimWorld-1])*g; | |
97 | ✗ | return PrimaryVariables(h); | |
98 | } | ||
99 | |||
100 | //! Returns reference to the coupling manager. | ||
101 | const CouplingManager& couplingManager() const | ||
102 | { 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 |