3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
el2p/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 *****************************************************************************/
24#ifndef DUMUX_POROELASTIC_SUBPROBLEM_HH
25#define DUMUX_POROELASTIC_SUBPROBLEM_HH
26
27#include <dune/grid/yaspgrid.hh>
28#include <dune/common/fmatrix.hh>
29
33
35
37#include "co2tables_el2p.hh"
38
39namespace Dumux {
40
41// forward declaration of the problem class
42template <class TypeTag>
43class PoroElasticSubProblem;
44
45namespace Properties {
46
47// Create new type tags
48namespace TTag {
49struct PoroElasticSub { using InheritsFrom = std::tuple<PoroElastic, BoxModel>; };
50} // end namespace TTag
51// Set the grid type
52template<class TypeTag>
53struct Grid<TypeTag, TTag::PoroElasticSub> { using type = Dune::YaspGrid<3>; };
54// Set the problem property
55template<class TypeTag>
56struct Problem<TypeTag, TTag::PoroElasticSub> { using type = Dumux::PoroElasticSubProblem<TypeTag>; };
57
58// Set the fluid system for TwoPSubProblem
59template<class TypeTag>
60struct FluidSystem<TypeTag, TTag::PoroElasticSub>
61{
64};
65
66// The spatial parameters property
67template<class TypeTag>
68struct SpatialParams<TypeTag, TTag::PoroElasticSub>
69{
72};
73} // end namespace Properties
74
79template<class TypeTag>
81{
83
90 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
91
93 using FVElementGeometry = typename GridGeometry::LocalView;
94 using SubControlVolume = typename GridGeometry::SubControlVolume;
95
97 using Element = typename GridView::template Codim<0>::Entity;
98 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
99
100 static constexpr int dim = GridView::dimension;
101 static constexpr int dimWorld = GridView::dimensionworld;
102 using GradU = Dune::FieldMatrix<Scalar, dim, dimWorld>;
103
104public:
105 PoroElasticSubProblem(std::shared_ptr<const GridGeometry> gridGeometry,
106 std::shared_ptr<CouplingManager> couplingManagerPtr,
107 const std::string& paramGroup = "PoroElastic")
109 , couplingManagerPtr_(couplingManagerPtr)
110 {
111 problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
112 }
113
117 const std::string& name() const
118 {
119 return problemName_;
120 }
121
123 static constexpr Scalar temperature()
124 { return 273.15; }
125
127 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
128 { return PrimaryVariables(0.0); }
129
131 PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const
132 { return PrimaryVariables(0.0); }
133
135 PrimaryVariables neumannAtPos(const GlobalPosition& globalPos) const
136 { return PrimaryVariables(0.0); }
137
141 Scalar effectiveFluidDensity(const Element& element, const SubControlVolume& scv) const
142 {
143 // get porous medium flow volume variables from coupling manager
144 const auto pmFlowVolVars = couplingManager().getPMFlowVolVars(element);
145
146 Scalar wPhaseDensity = pmFlowVolVars.density(FluidSystem::phase0Idx);
147 Scalar nPhaseDensity = pmFlowVolVars.density(FluidSystem::phase1Idx);
148 Scalar Sw = pmFlowVolVars.saturation(FluidSystem::phase0Idx);
149 Scalar Sn = pmFlowVolVars.saturation(FluidSystem::phase1Idx);
150 return (wPhaseDensity * Sw + nPhaseDensity * Sn);
151 }
152
156 template< class FluxVarsCache >
157 Scalar effectivePorePressure(const Element& element,
158 const FVElementGeometry& fvGeometry,
159 const ElementVolumeVariables& elemVolVars,
160 const FluxVarsCache& fluxVarsCache) const
161 {
162 // get porous medium flow volume variables from coupling manager
163 const auto pmFlowVolVars = couplingManager().getPMFlowVolVars(element);
164
165 Scalar pw = pmFlowVolVars.pressure(FluidSystem::phase0Idx);
166 Scalar pn = pmFlowVolVars.pressure(FluidSystem::phase1Idx);
167 Scalar Sw = pmFlowVolVars.saturation(FluidSystem::phase0Idx);
168 Scalar Sn = pmFlowVolVars.saturation(FluidSystem::phase1Idx);
169 return (pw * Sw + pn * Sn);
170 }
171
178 BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const
179 {
180 BoundaryTypes values;
181 values.setAllDirichlet();
182 return values;
183 }
184
189 PrimaryVariables source(const Element& element,
190 const FVElementGeometry& fvGeometry,
191 const ElementVolumeVariables& elemVolVars,
192 const SubControlVolume& scv) const
193 { return PrimaryVariables(0.0); }
194
196 const CouplingManager& couplingManager() const
197 { return *couplingManagerPtr_; }
198
199private:
200 std::shared_ptr<const CouplingManager> couplingManagerPtr_;
201 static constexpr Scalar eps_ = 3e-6;
202 std::string problemName_;
203};
204
205} // end namespace Dumux
206
207#endif
Defines a type tag and some properties for models using the box scheme.
A compositional fluid with brine (H2O & NaCl) and carbon dioxide as components in both the liquid and...
Provides the class with the tabulated values of CO2.
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
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 liquid phase consisting of a single component.
Definition: 1pliquid.hh:46
A compositional fluid with brine (H2O & NaCl) and carbon dioxide as components in both the liquid and...
Definition: brineco2.hh:119
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: el2p/problem_poroelastic.hh:123
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: el2p/problem_poroelastic.hh:127
PrimaryVariables neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: el2p/problem_poroelastic.hh:135
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: el2p/problem_poroelastic.hh:189
PoroElasticSubProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManagerPtr, const std::string &paramGroup="PoroElastic")
Definition: el2p/problem_poroelastic.hh:105
Scalar effectivePorePressure(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Returns the effective pore pressure.
Definition: el2p/problem_poroelastic.hh:157
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: el2p/problem_poroelastic.hh:131
const std::string & name() const
The problem name.
Definition: el2p/problem_poroelastic.hh:117
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: el2p/problem_poroelastic.hh:178
Scalar effectiveFluidDensity(const Element &element, const SubControlVolume &scv) const
Returns the effective fluid density.
Definition: el2p/problem_poroelastic.hh:141
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
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: el2p/problem_poroelastic.hh:62
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.