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 (d-1)-dimensional facet domain in the single-phase | ||
11 | * facet coupling test involving three domains. | ||
12 | */ | ||
13 | |||
14 | #ifndef DUMUX_TEST_FACETCOUPLING_THREEDOMAIN_ONEP_FACETPROBLEM_HH | ||
15 | #define DUMUX_TEST_FACETCOUPLING_THREEDOMAIN_ONEP_FACETPROBLEM_HH | ||
16 | |||
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 (d-1)-dimensional test problem for the incompressible | ||
27 | * one-phase model with coupling across the bulk grid facets. | ||
28 | */ | ||
29 | template<class TypeTag> | ||
30 | class OnePFacetProblem : public PorousMediumFlowProblem<TypeTag> | ||
31 | { | ||
32 | using ParentType = PorousMediumFlowProblem<TypeTag>; | ||
33 | using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; | ||
34 | using PrimaryVariables = typename GridVariables::PrimaryVariables; | ||
35 | using NumEqVector = Dumux::NumEqVector<PrimaryVariables>; | ||
36 | using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; | ||
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 SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; | ||
43 | using GridView = typename GridGeometry::GridView; | ||
44 | using Element = typename GridView::template Codim<0>::Entity; | ||
45 | using GlobalPosition = typename Element::Geometry::GlobalCoordinate; | ||
46 | |||
47 | using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; | ||
48 | using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; | ||
49 | |||
50 | public: | ||
51 | 2 | OnePFacetProblem(std::shared_ptr<const GridGeometry> gridGeometry, | |
52 | std::shared_ptr<typename ParentType::SpatialParams> spatialParams, | ||
53 | std::shared_ptr<CouplingManager> couplingManagerPtr, | ||
54 | const std::string& paramGroup = "Facet") | ||
55 | : ParentType(gridGeometry, spatialParams, paramGroup) | ||
56 |
4/14✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 2 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.
|
6 | , couplingManagerPtr_(couplingManagerPtr) |
57 | { | ||
58 |
9/26✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 2 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 2 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
✗ 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.
|
4 | problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); |
59 | 2 | } | |
60 | |||
61 | /*! | ||
62 | * \brief The problem name. | ||
63 | */ | ||
64 | const std::string& name() const | ||
65 | { | ||
66 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | return problemName_; |
67 | } | ||
68 | |||
69 | //! Specifies the kind of boundary condition at a boundary position. | ||
70 | ✗ | BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const | |
71 | { | ||
72 |
3/4✓ Branch 0 taken 400 times.
✓ Branch 1 taken 192 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 96 times.
|
688 | BoundaryTypes values; |
73 |
3/4✓ Branch 0 taken 400 times.
✓ Branch 1 taken 192 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 96 times.
|
688 | values.setAllNeumann(); |
74 | ✗ | return values; | |
75 | } | ||
76 | |||
77 | /*! | ||
78 | * \brief Specifies which kind of interior boundary condition should be | ||
79 | * used for which equation on a given sub-control volume face | ||
80 | * that couples to a facet element. | ||
81 | * | ||
82 | * \param element The finite element the scvf is embedded in | ||
83 | * \param scvf The sub-control volume face | ||
84 | */ | ||
85 | ✗ | BoundaryTypes interiorBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const | |
86 | { | ||
87 |
3/4✓ Branch 0 taken 2449 times.
✓ Branch 1 taken 4479 times.
✓ Branch 2 taken 800 times.
✗ Branch 3 not taken.
|
7728 | BoundaryTypes values; |
88 |
3/4✓ Branch 0 taken 2449 times.
✓ Branch 1 taken 4479 times.
✓ Branch 2 taken 800 times.
✗ Branch 3 not taken.
|
7728 | values.setAllNeumann(); |
89 | ✗ | return values; | |
90 | } | ||
91 | |||
92 | /*! | ||
93 | * \brief Evaluates the source term for all phases within a given | ||
94 | * sub-control volume. | ||
95 | */ | ||
96 | 4752 | NumEqVector source(const Element& element, | |
97 | const FVElementGeometry& fvGeometry, | ||
98 | const ElementVolumeVariables& elemVolVars, | ||
99 | const SubControlVolume& scv) const | ||
100 | { | ||
101 | // forward to solution independent, fully-implicit specific interface | ||
102 | 9504 | auto source = couplingManagerPtr_->evalSourcesFromBulk(element, fvGeometry, elemVolVars, scv); | |
103 | 13200 | source /= scv.volume()*elemVolVars[scv].extrusionFactor(); | |
104 | 4752 | return source; | |
105 | } | ||
106 | |||
107 | //! Evaluates the initial conditions. | ||
108 | ✗ | PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const | |
109 | 160 | { return PrimaryVariables(1.0); } | |
110 | |||
111 | //! Returns const reference to the coupling manager. | ||
112 | const CouplingManager& couplingManager() const | ||
113 |
16/16✓ Branch 0 taken 12048 times.
✓ Branch 1 taken 2448 times.
✓ Branch 2 taken 12048 times.
✓ Branch 3 taken 2448 times.
✓ Branch 6 taken 960 times.
✓ Branch 7 taken 2592 times.
✓ Branch 8 taken 960 times.
✓ Branch 9 taken 2592 times.
✓ Branch 10 taken 2592 times.
✓ Branch 11 taken 960 times.
✓ Branch 12 taken 2592 times.
✓ Branch 13 taken 960 times.
✓ Branch 16 taken 960 times.
✓ Branch 17 taken 2784 times.
✓ Branch 18 taken 960 times.
✓ Branch 19 taken 2784 times.
|
75424 | { return *couplingManagerPtr_; } |
114 | |||
115 | private: | ||
116 | std::shared_ptr<CouplingManager> couplingManagerPtr_; | ||
117 | std::string problemName_; | ||
118 | }; | ||
119 | |||
120 | } // end namespace Dumux | ||
121 | |||
122 | #endif | ||
123 |