3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
gravity/problem_lowdim.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 *****************************************************************************/
24#ifndef DUMUX_TEST_TPFAFACETCOUPLING_ONEP_LOWDIMPROBLEM_HH
25#define DUMUX_TEST_TPFAFACETCOUPLING_ONEP_LOWDIMPROBLEM_HH
26
27#include <dune/foamgrid/foamgrid.hh>
28
31
34
37
38#include "spatialparams.hh"
39
40// default for the grid type
41#ifndef LOWDIMGRIDTYPE
42#define LOWDIMGRIDTYPE Dune::FoamGrid<1, 2>
43#endif
44
45namespace Dumux {
46// forward declarations
47template<class TypeTag> class OnePLowDimProblem;
48
49namespace Properties {
50
51// create the type tag nodes
52namespace TTag {
53struct OnePLowDim { using InheritsFrom = std::tuple<OneP>; };
54struct OnePLowDimTpfa { using InheritsFrom = std::tuple<OnePLowDim, CCTpfaModel>; };
55
56// we need an additional type tag for the test using mpfa in the bulk domain
57struct OnePLowDimMpfa { using InheritsFrom = std::tuple<OnePLowDim, CCTpfaModel>; };
58} // end namespace TTag
59
60// Set the grid type
61template<class TypeTag>
62struct Grid<TypeTag, TTag::OnePLowDim> { using type = LOWDIMGRIDTYPE; };
63// Set the problem type
64template<class TypeTag>
65struct Problem<TypeTag, TTag::OnePLowDim> { using type = OnePLowDimProblem<TypeTag>; };
66// set the spatial params
67template<class TypeTag>
68struct SpatialParams<TypeTag, TTag::OnePLowDim>
69{
72};
73
74// the fluid system
75template<class TypeTag>
76struct FluidSystem<TypeTag, TTag::OnePLowDim>
77{
78private:
80public:
82};
83} // end namespace Properties
84
90template<class TypeTag>
91class OnePLowDimProblem : public PorousMediumFlowProblem<TypeTag>
92{
93 using ParentType = PorousMediumFlowProblem<TypeTag>;
94
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 GridView = typename GridGeometry::GridView;
104 using Element = typename GridView::template Codim<0>::Entity;
105 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
106
110
111 static constexpr int dimWorld = GridView::dimensionworld;
112
113public:
114 OnePLowDimProblem(std::shared_ptr<const GridGeometry> gridGeometry,
115 std::shared_ptr<typename ParentType::SpatialParams> spatialParams,
116 std::shared_ptr<CouplingManager> couplingManager,
117 const std::string& paramGroup = "")
119 , couplingManagerPtr_(couplingManager)
120 , aperture_(getParam<Scalar>("Problem.FractureAperture"))
121 {
122 problemName_ = getParam<std::string>("Vtk.OutputName") + "_" +
123 getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
124 }
125
127 const std::string& name() const
128 { return problemName_; }
129
131 BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const
132 {
133 BoundaryTypes values;
134 values.setAllNeumann();
135 return values;
136 }
137
139 NumEqVector source(const Element& element,
140 const FVElementGeometry& fvGeometry,
141 const ElementVolumeVariables& elemVolVars,
142 const SubControlVolume& scv) const
143 {
144 // evaluate sources from bulk domain
145 auto source = couplingManagerPtr_->evalSourcesFromBulk(element, fvGeometry, elemVolVars, scv);
146 source /= scv.volume()*elemVolVars[scv].extrusionFactor();
147 return source;
148 }
149
151 PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const
152 { return initialAtPos(globalPos); }
153
155 Scalar extrusionFactorAtPos(const GlobalPosition& globalPos) const
156 { return aperture_; }
157
159 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
160 {
161 const auto g = this->spatialParams().gravity(globalPos)[dimWorld-1];
162 const auto h = 1.0 - (3.0-globalPos[dimWorld-1])*g;
163 return PrimaryVariables(h);
164 }
165
167 Scalar temperature() const
168 { return 283.15; /*10°*/ }
169
171 const CouplingManager& couplingManager() const
172 { return *couplingManagerPtr_; }
173
174private:
175 std::shared_ptr<CouplingManager> couplingManagerPtr_;
176 Scalar aperture_;
177 std::string problemName_;
178};
179
180} // end namespace Dumux
181
182#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 TPFA.
Setting constant fluid properties via the input file.
A liquid phase consisting of a single component.
T getParam(Args &&... args)
A free function to get a parameter from the parameter tree singleton.
Definition: parameters.hh:428
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
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
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
Property to specify the type of scalar values.
Definition: common/properties.hh:53
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
Definition: multidomain/couplingmanager.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 lower-dimensional test problem for the incompressible one-phase model with coupling across the bu...
Definition: problem_1p_lowdim.hh:88
const CouplingManager & couplingManager() const
Returns reference to the coupling manager.
Definition: analytical/problem_lowdim.hh:174
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the Dirichlet boundary condition for a given position.
Definition: gravity/problem_lowdim.hh:151
const std::string & name() const
The problem name.
Definition: gravity/problem_lowdim.hh:127
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies the type of boundary condition at a given position.
Definition: gravity/problem_lowdim.hh:131
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluates the source term at a given position.
Definition: gravity/problem_lowdim.hh:139
Scalar temperature() const
Returns the temperature in in the domain.
Definition: gravity/problem_lowdim.hh:167
OnePLowDimProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< typename ParentType::SpatialParams > spatialParams, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
Definition: gravity/problem_lowdim.hh:114
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial conditions.
Definition: analytical/problem_lowdim.hh:166
Scalar extrusionFactorAtPos(const GlobalPosition &globalPos) const
Sets the aperture as extrusion factor.
Definition: gravity/problem_lowdim.hh:155
Definition: analytical/problem_lowdim.hh:49
std::tuple< OneP > InheritsFrom
Definition: analytical/problem_lowdim.hh:49
Definition: analytical/problem_lowdim.hh:50
std::tuple< OnePLowDim, CCTpfaModel > InheritsFrom
Definition: analytical/problem_lowdim.hh:50
Dune::FoamGrid< 1, 2 > type
Definition: analytical/problem_lowdim.hh:56
Definition: gravity/problem_lowdim.hh:57
std::tuple< OnePLowDim, CCTpfaModel > InheritsFrom
Definition: gravity/problem_lowdim.hh:57
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.
#define LOWDIMGRIDTYPE
Definition: gravity/problem_lowdim.hh:42