3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
el1p/problem_poroelastic.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 *****************************************************************************/
25#ifndef DUMUX_POROELASTIC_SUBPROBLEM_HH
26#define DUMUX_POROELASTIC_SUBPROBLEM_HH
27
28#include <dune/grid/yaspgrid.hh>
29#include <dune/common/fmatrix.hh>
30
34
37
39
40namespace Dumux {
41
42// forward declaration of the problem class
43template <class TypeTag>
44class PoroElasticSubProblem;
45
46namespace Properties {
47
48// Create new type tags
49namespace TTag {
50struct PoroElasticSub { using InheritsFrom = std::tuple<PoroElastic, BoxModel>; };
51} // end namespace TTag
52// Set the grid type
53template<class TypeTag>
54struct Grid<TypeTag, TTag::PoroElasticSub> { using type = Dune::YaspGrid<2>; };
55// Set the problem property
56template<class TypeTag>
57struct Problem<TypeTag, TTag::PoroElasticSub> { using type = Dumux::PoroElasticSubProblem<TypeTag>; };
58// The fluid phase consists of one constant component
59template<class TypeTag>
60struct FluidSystem<TypeTag, TTag::PoroElasticSub>
61{
64};
65// The spatial parameters property
66template<class TypeTag>
67struct SpatialParams<TypeTag, TTag::PoroElasticSub>
68{
71};
72} // end namespace Properties
73
78template<class TypeTag>
79class PoroElasticSubProblem : public GeomechanicsFVProblem<TypeTag>
80{
81 using ParentType = GeomechanicsFVProblem<TypeTag>;
82
88 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
89
91 using FVElementGeometry = typename GridGeometry::LocalView;
92 using SubControlVolume = typename GridGeometry::SubControlVolume;
93
95 using Element = typename GridView::template Codim<0>::Entity;
96 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
97
98 static constexpr int dim = GridView::dimension;
99 static constexpr int dimWorld = GridView::dimensionworld;
100 using GradU = Dune::FieldMatrix<Scalar, dim, dimWorld>;
101
102public:
103 PoroElasticSubProblem(std::shared_ptr<const GridGeometry> gridGeometry,
104 std::shared_ptr<CouplingManager> couplingManagerPtr,
105 const std::string& paramGroup = "PoroElastic")
107 , couplingManagerPtr_(couplingManagerPtr)
108 {
109 problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
110 }
111
115 const std::string& name() const
116 {
117 return problemName_;
118 }
119
121 static constexpr Scalar temperature()
122 { return 273.15; }
123
125 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
126 { return PrimaryVariables(0.0); }
127
129 PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const
130 { return PrimaryVariables(0.0); }
131
133 PrimaryVariables neumannAtPos(const GlobalPosition& globalPos) const
134 { return PrimaryVariables(0.0); }
135
139 Scalar effectiveFluidDensity(const Element& element,
140 const SubControlVolume& scv) const
141 {
142 // get porous medium flow volume variables from coupling manager
143 const auto pmFlowVolVars = couplingManager().getPMFlowVolVars(element);
144 return pmFlowVolVars.density();
145 }
146
150 template< class FluxVarsCache >
151 Scalar effectivePorePressure(const Element& element,
152 const FVElementGeometry& fvGeometry,
153 const ElementVolumeVariables& elemVolVars,
154 const FluxVarsCache& fluxVarsCache) const
155 {
156 // get porous medium flow volume variables from coupling manager
157 const auto pmFlowVolVars = couplingManager().getPMFlowVolVars(element);
158 return pmFlowVolVars.pressure();
159 }
160
167 BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const
168 {
169 BoundaryTypes values;
170 values.setAllDirichlet();
171 return values;
172 }
173
178 PrimaryVariables source(const Element& element,
179 const FVElementGeometry& fvGeometry,
180 const ElementVolumeVariables& elemVolVars,
181 const SubControlVolume& scv) const
182 { return PrimaryVariables(0.0); }
183
185 const CouplingManager& couplingManager() const
186 { return *couplingManagerPtr_; }
187
188private:
189 std::shared_ptr<const CouplingManager> couplingManagerPtr_;
190 static constexpr Scalar eps_ = 3e-6;
191 std::string problemName_;
192};
193
194} // end namespace Dumux
195
196#endif
Defines a type tag and some properties for models using the box scheme.
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
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
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
Base class for all geomechanical problems.
Definition: geomechanics/fvproblem.hh:68
A component which returns run time specified values for all fluid properties.
Definition: constant.hh:58
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
Definition of the spatial parameters for the poro-elastic problem.
Definition: geomechanics/poroelastic/spatialparams.hh:42
The poro-elastic sub-problem in the el1p coupled problem.
Definition: el2p/problem_poroelastic.hh:81
static constexpr Scalar temperature()
Returns the temperature in the domain.
Definition: el1p/problem_poroelastic.hh:121
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: el1p/problem_poroelastic.hh:125
PrimaryVariables neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: el1p/problem_poroelastic.hh:133
PrimaryVariables 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: el1p/problem_poroelastic.hh:178
PoroElasticSubProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManagerPtr, const std::string &paramGroup="PoroElastic")
Definition: el1p/problem_poroelastic.hh:103
Scalar effectivePorePressure(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Returns the effective pore pressure.
Definition: el1p/problem_poroelastic.hh:151
const CouplingManager & couplingManager() const
Returns reference to the coupling manager.
Definition: el1p/problem_poroelastic.hh:185
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: el1p/problem_poroelastic.hh:129
const std::string & name() const
The problem name.
Definition: el1p/problem_poroelastic.hh:115
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: el1p/problem_poroelastic.hh:167
Scalar effectiveFluidDensity(const Element &element, const SubControlVolume &scv) const
Returns the effective fluid density.
Definition: el1p/problem_poroelastic.hh:139
Definition: el1p/problem_poroelastic.hh:50
std::tuple< PoroElastic, BoxModel > InheritsFrom
Definition: el1p/problem_poroelastic.hh:50
Dune::YaspGrid< 2 > type
Definition: el1p/problem_poroelastic.hh:54
Base class for all geomechanical problems.
Defines a type tag and some properties for the poroelastic geomechanical model.
Definition of the spatial parameters for the poro-elastic problem.