3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
problem_edge.hh
Go to the documentation of this file.
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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
26#ifndef DUMUX_TEST_FACETCOUPLING_THREEDOMAIN_ONEP_EDGEPROBLEM_HH
27#define DUMUX_TEST_FACETCOUPLING_THREEDOMAIN_ONEP_EDGEPROBLEM_HH
28
29#include <dune/foamgrid/foamgrid.hh>
30
33
37
40
41#include "spatialparams.hh"
42
43namespace Dumux {
44// forward declarations
45template<class TypeTag> class OnePEdgeProblem;
46
47namespace Properties {
48// create the type tag nodes
49// Create new type tags
50namespace TTag {
51struct OnePEdge { using InheritsFrom = std::tuple<OneP>; };
52struct OnePEdgeTpfa { using InheritsFrom = std::tuple<OnePEdge, CCTpfaModel>; };
53struct OnePEdgeMpfa { using InheritsFrom = std::tuple<OnePEdge, CCTpfaModel>; };
54struct OnePEdgeBox { using InheritsFrom = std::tuple<OnePEdge, BoxModel>; };
55} // end namespace TTag
56
57// Set the grid type
58template<class TypeTag>
59struct Grid<TypeTag, TTag::OnePEdge> { using type = Dune::FoamGrid<1, 3>; };
60// Set the problem type
61template<class TypeTag>
62struct Problem<TypeTag, TTag::OnePEdge> { using type = OnePEdgeProblem<TypeTag>; };
63// set the spatial params
64template<class TypeTag>
65struct SpatialParams<TypeTag, TTag::OnePEdge>
66{
70};
71
72// the fluid system
73template<class TypeTag>
74struct FluidSystem<TypeTag, TTag::OnePEdge>
75{
76private:
78public:
80};
81
82} // end namespace Properties
83
89template<class TypeTag>
91{
93
96 using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView;
97 using PrimaryVariables = typename GridVariables::PrimaryVariables;
98 using Scalar = typename GridVariables::Scalar;
99
100 using GridGeometry = typename GridVariables::GridGeometry;
101 using FVElementGeometry = typename GridGeometry::LocalView;
102 using SubControlVolume = typename GridGeometry::SubControlVolume;
103 using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
104 using GridView = typename GridGeometry::GridView;
105 using Element = typename GridView::template Codim<0>::Entity;
106 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
107
110
111public:
112 OnePEdgeProblem(std::shared_ptr<const GridGeometry> gridGeometry,
113 std::shared_ptr<typename ParentType::SpatialParams> spatialParams,
114 std::shared_ptr<CouplingManager> couplingManagerPtr,
115 const std::string& paramGroup = "Edge")
117 , couplingManagerPtr_(couplingManagerPtr)
118 {
119 const auto a = getParam<Scalar>("Extrusion.Aperture");
120 exFactor_ = a*a;
121 problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
122 }
123
127 const std::string& name() const
128 {
129 return problemName_;
130 }
131
133 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
134 {
135 BoundaryTypes values;
136 values.setAllNeumann();
137 return values;
138 }
139
144 NumEqVector source(const Element& element,
145 const FVElementGeometry& fvGeometry,
146 const ElementVolumeVariables& elemVolVars,
147 const SubControlVolume& scv) const
148 {
149 // forward to solution independent, fully-implicit specific interface
150 auto source = couplingManagerPtr_->evalSourcesFromBulk(element, fvGeometry, elemVolVars, scv);
151 source /= scv.volume()*elemVolVars[scv].extrusionFactor();
152 return source;
153 }
154
156 Scalar extrusionFactorAtPos(const GlobalPosition& globalPos) const
157 { return exFactor_; }
158
160 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
161 { return PrimaryVariables(1.0); }
162
164 Scalar temperature() const
165 { return 283.15; /*10°*/ }
166
168 const CouplingManager& couplingManager() const
169 { return *couplingManagerPtr_; }
170
171private:
172 std::shared_ptr<CouplingManager> couplingManagerPtr_;
173 std::string problemName_;
174 Scalar exFactor_;
175};
176
177} // end namespace Dumux
178
179#endif
Defines a type tag and some properties for models using the box scheme.
Properties for all models using cell-centered finite volume scheme with mpfa.
Properties for all models using cell-centered finite volume scheme with TPFA.
Setting constant fluid properties via the input file.
A liquid phase consisting of a single component.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:50
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition: common/fvproblem.hh:592
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
The DUNE grid type.
Definition: common/properties.hh:57
Property to specify the type of a problem which has to be solved.
Definition: common/properties.hh:69
The type of the spatial parameters object.
Definition: common/properties.hh:221
The type of the fluid system to use.
Definition: common/properties.hh:223
A liquid phase consisting of a single component.
Definition: 1pliquid.hh:46
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
SpatialParams & spatialParams()
Returns the spatial parameters object.
Definition: dumux/porousmediumflow/problem.hh:146
The spatial parameters class for the test problem using the 1p cc model.
Definition: multidomain/boundary/stokesdarcy/1p2c_1p2c/spatialparams.hh:41
The (d-2)-dimensional test problem for the incompressible one-phase model with coupling across the bu...
Definition: problem_edge.hh:91
const std::string & name() const
The problem name.
Definition: problem_edge.hh:127
Scalar extrusionFactorAtPos(const GlobalPosition &globalPos) const
Sets the aperture squared as extrusion factor.
Definition: problem_edge.hh:156
OnePEdgeProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< typename ParentType::SpatialParams > spatialParams, std::shared_ptr< CouplingManager > couplingManagerPtr, const std::string &paramGroup="Edge")
Definition: problem_edge.hh:112
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial conditions.
Definition: problem_edge.hh:160
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluates the source term for all phases within a given sub-control volume.
Definition: problem_edge.hh:144
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies the type of boundary condition on a boundary position.
Definition: problem_edge.hh:133
Scalar temperature() const
Returns the temperature for an isothermal problem.
Definition: problem_edge.hh:164
const CouplingManager & couplingManager() const
Returns const reference to the coupling manager.
Definition: problem_edge.hh:168
Definition: problem_edge.hh:51
std::tuple< OneP > InheritsFrom
Definition: problem_edge.hh:51
Definition: problem_edge.hh:52
std::tuple< OnePEdge, CCTpfaModel > InheritsFrom
Definition: problem_edge.hh:52
Definition: problem_edge.hh:53
std::tuple< OnePEdge, CCTpfaModel > InheritsFrom
Definition: problem_edge.hh:53
Definition: problem_edge.hh:54
std::tuple< OnePEdge, BoxModel > InheritsFrom
Definition: problem_edge.hh:54
Dune::FoamGrid< 1, 3 > type
Definition: problem_edge.hh:59
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: problem_edge.hh:67
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: problem_edge.hh:68
A single-phase, isothermal flow model using the fully implicit scheme.
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.