3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
test/porousmediumflow/2p/implicit/fracture/problem.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_TWOP_FRACTURE_TEST_PROBLEM_HH
27#define DUMUX_TWOP_FRACTURE_TEST_PROBLEM_HH
28
29#if HAVE_DUNE_FOAMGRID
30#include <dune/foamgrid/foamgrid.hh>
31#endif
32
37
40
44
45#include "spatialparams.hh"
46
47namespace Dumux {
48
49template <class TypeTag>
50class FractureProblem;
51
52namespace Properties {
53// Create new type tags
54namespace TTag {
55struct Fracture { using InheritsFrom = std::tuple<TwoP>; };
56struct FractureBox { using InheritsFrom = std::tuple<Fracture, BoxModel>; };
57struct FractureCCTpfa { using InheritsFrom = std::tuple<Fracture, CCTpfaModel>; };
58struct FractureCCMpfa { using InheritsFrom = std::tuple<Fracture, CCMpfaModel>; };
59} // end namespace TTag
60
61// set the grid property
62#if HAVE_DUNE_FOAMGRID
63template<class TypeTag>
64struct Grid<TypeTag, TTag::Fracture> { using type = Dune::FoamGrid<2, 3>; };
65#endif
66
67// Set the problem property
68template<class TypeTag>
69struct Problem<TypeTag, TTag::Fracture> { using type = Dumux::FractureProblem<TypeTag>; };
70
71// Set the fluid system
72template<class TypeTag>
73struct FluidSystem<TypeTag, TTag::Fracture>
74{
79};
80
81// Set the spatial parameters
82template<class TypeTag>
83struct SpatialParams<TypeTag, TTag::Fracture>
84{
88};
89
90// Use global caching
91template<class TypeTag>
92struct EnableGridGeometryCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; };
93template<class TypeTag>
94struct EnableGridVolumeVariablesCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; };
95template<class TypeTag>
96struct EnableGridFluxVariablesCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; };
97
98// permeablility is solution-independent
99template<class TypeTag>
100struct SolutionDependentAdvection<TypeTag, TTag::Fracture> { static constexpr bool value = false; };
101} // end namespace Properties
102
107template <class TypeTag>
109{
119
120 enum
121 {
122 // primary variable indices
123 pressureIdx = Indices::pressureIdx,
124 saturationIdx = Indices::saturationIdx,
125
126 // equation indices
127 contiTCEEqIdx = Indices::conti0EqIdx + FluidSystem::comp1Idx,
128
129 // world dimension
130 dimWorld = GridView::dimensionworld
131 };
132 using Element = typename GridView::template Codim<0>::Entity;
133 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
134
135public:
136 FractureProblem(std::shared_ptr<const GridGeometry> gridGeometry)
138
142 // \{
143
149 Scalar temperature() const
150 { return 273.15 + 20; }
151
158 Scalar extrusionFactorAtPos(const GlobalPosition &globalPos) const
159 {
160 return 0.1;
161 }
162
163 // \}
164
168 // \{
169
176 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
177 {
178 BoundaryTypes values;
179
180 values.setAllDirichlet();
181 if (onInlet_(globalPos))
182 values.setAllNeumann();
183 if (globalPos[2] > 1.0 - eps_ || globalPos[2] < eps_)
184 values.setAllNeumann();
185
186 return values;
187 }
188
194 PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
195 {
196 const auto depth = this->gridGeometry().bBoxMax()[dimWorld-1] - globalPos[dimWorld-1];
197 const auto g = this->spatialParams().gravity(globalPos)[dimWorld-1];
198
199 PrimaryVariables values;
200 values[pressureIdx] = 1e5 + 1000*g*depth;
201 values[saturationIdx] = 0.0;
202 return values;
203 }
204
213 NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
214 {
215 NumEqVector values(0.0);
216 if (onInlet_(globalPos)) {
217 values[contiTCEEqIdx] = -0.04; // kg / (m * s)
218 }
219 return values;
220 }
221
222 // \}
223
227 // \{
228
229
235 PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
236 { return dirichletAtPos(globalPos); }
237 // \}
238
239private:
240
241 bool onInlet_(const GlobalPosition &globalPos) const
242 { return globalPos[0] < eps_ && globalPos[1] > -0.5 - eps_; }
243
244 static constexpr Scalar eps_ = 1.5e-7;
245 std::string name_;
246};
247
248} // end namespace Dumux
249
250#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.
A much simpler (and thus potentially less buggy) version of pure water.
A simple implementation of Trichloroethene (TCE), a DNAPL.
A liquid phase consisting of a single component.
A fluid system for two-phase models assuming immiscibility and thermodynamic equilibrium.
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 GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
The DUNE grid type.
Definition: common/properties.hh:57
UndefinedProperty type
Definition: common/properties.hh:57
Property to specify the type of a problem which has to be solved.
Definition: common/properties.hh:69
Definition: common/properties.hh:169
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
A fluid system for two-phase models assuming immiscibility and thermodynamic equilibrium.
Definition: 2pimmiscible.hh:59
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
Exact solution 1D-3D.
Definition: test/porousmediumflow/2p/implicit/fracture/problem.hh:109
FractureProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/2p/implicit/fracture/problem.hh:136
Scalar extrusionFactorAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: test/porousmediumflow/2p/implicit/fracture/problem.hh:158
NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: test/porousmediumflow/2p/implicit/fracture/problem.hh:213
Scalar temperature() const
Returns the temperature .
Definition: test/porousmediumflow/2p/implicit/fracture/problem.hh:149
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/2p/implicit/fracture/problem.hh:194
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: test/porousmediumflow/2p/implicit/fracture/problem.hh:176
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial values for a control volume.
Definition: test/porousmediumflow/2p/implicit/fracture/problem.hh:235
Definition: problem_fracture.hh:51
std::tuple< OneP, CCTpfaModel > InheritsFrom
Definition: problem_fracture.hh:51
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: problem_fracture.hh:79
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:88
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:87
Definition of the spatial parameters for the matrix and fracture problem.
Definition: multidomain/embedded/2d3d/1p_1p/spatialparams.hh:39
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:53
std::tuple< Fracture, BoxModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:53
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:54
std::tuple< Fracture, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:54
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:55
std::tuple< Fracture, CCMpfaModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:55
The spatial parameters for the LensProblem which uses the two-phase fully implicit model.
Definition: porousmediumflow/1p/implicit/fracture2d3d/spatialparams.hh:43
Adaption of the fully implicit scheme to the two-phase flow model.
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.