3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
test/porousmediumflow/1p/implicit/fracture2d3d/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 *****************************************************************************/
27#ifndef DUMUX_ONEP_FRACTURE_TEST_PROBLEM_HH
28#define DUMUX_ONEP_FRACTURE_TEST_PROBLEM_HH
29
30#if HAVE_DUNE_FOAMGRID
31#include <dune/foamgrid/foamgrid.hh>
32#endif
33
41
42#include "spatialparams.hh"
43
44namespace Dumux {
45
46template <class TypeTag>
47class FractureProblem;
48
49namespace Properties {
50// Create new type tags
51namespace TTag {
52struct Fracture { using InheritsFrom = std::tuple<OneP>; };
53struct FractureBox { using InheritsFrom = std::tuple<Fracture, BoxModel>; };
54struct FractureCCTpfa { using InheritsFrom = std::tuple<Fracture, CCTpfaModel>; };
55struct FractureCCMpfa { using InheritsFrom = std::tuple<Fracture, CCMpfaModel>; };
56} // end namespace TTag
57
59template<class TypeTag>
60struct EnableGridGeometryCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; };
61template<class TypeTag>
62struct EnableGridVolumeVariablesCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; };
63template<class TypeTag>
64struct EnableGridFluxVariablesCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; };
65
67#if HAVE_DUNE_FOAMGRID
68template<class TypeTag>
69struct Grid<TypeTag, TTag::Fracture> { using type = Dune::FoamGrid<2, 3>; };
70#endif
71
72// Set the problem property
73template<class TypeTag>
74struct Problem<TypeTag, TTag::Fracture> { using type = Dumux::FractureProblem<TypeTag>; };
75
76// the fluid system
77template<class TypeTag>
78struct FluidSystem<TypeTag, TTag::Fracture>
79{
82};
83// Set the spatial parameters
84template<class TypeTag>
85struct SpatialParams<TypeTag, TTag::Fracture>
86{
90};
91
92} // end namespace Properties
93
101template <class TypeTag>
102class FractureProblem : public PorousMediumFlowProblem<TypeTag>
103{
104 using ParentType = PorousMediumFlowProblem<TypeTag>;
107
108 enum { dimWorld = GridView::dimensionworld };
109
110 enum {
111 // index of the primary variable
112 pressureIdx = Indices::pressureIdx
113 };
114
115 using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
116 using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>;
117 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
118 using Element = typename GridView::template Codim<0>::Entity;
119 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
120 using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
121
122public:
123 FractureProblem(std::shared_ptr<const GridGeometry> gridGeometry)
125 {
126 name_ = getParam<std::string>("Problem.Name");
127 }
128
132 // \{
133
139 const std::string& name() const
140 {
141 return name_;
142 }
143
149 Scalar temperature() const
150 { return 273.15 + 20; }
151
152 // \}
153
157 // \{
158
165 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
166 {
167 BoundaryTypes values;
168
169 values.setAllNeumann();
170 const auto& gg = this->gridGeometry();
171 if (globalPos[0] > gg.bBoxMax()[0] - eps_ || globalPos[0] < gg.bBoxMin()[0] + eps_)
172 values.setAllDirichlet();
173
174 return values;
175 }
176
183 PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
184 {
185 return initialAtPos(globalPos);
186 }
187
188 // \}
189
193 // \{
194
195
201 PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
202 {
203 PrimaryVariables values(0.0);
204 const auto& gg = this->gridGeometry();
205 values[pressureIdx] = 1.0e5*(globalPos[0] - gg.bBoxMin()[0])/(gg.bBoxMax()[0] - gg.bBoxMin()[0]) + 1.0e5;
206 return values;
207 }
208 // \}
209
210private:
211 static constexpr Scalar eps_ = 1.5e-7;
212 std::string name_;
213};
214
215} // end namespace Dumux
216
217#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 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 GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
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
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
Exact solution 1D-3D.
Definition: test/porousmediumflow/2p/implicit/fracture/problem.hh:109
FractureProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:123
Scalar temperature() const
Returns the temperature .
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:149
const std::string & name() const
Returns the problem name.
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:139
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh:183
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/1p/implicit/fracture2d3d/problem.hh:165
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: problem_fracture.hh:272
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
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.