3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/mpnc/implicit/obstacle/spatialparams.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_OBSTACLE_SPATIAL_PARAMS_HH
26#define DUMUX_OBSTACLE_SPATIAL_PARAMS_HH
27
32
33namespace Dumux {
34
40template<class GridGeometry, class Scalar>
42: public FVSpatialParams<GridGeometry, Scalar,
43 ObstacleSpatialParams<GridGeometry, Scalar>>
44{
45 using GridView = typename GridGeometry::GridView;
46 using FVElementGeometry = typename GridGeometry::LocalView;
47 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
48 using Element = typename GridView::template Codim<0>::Entity;
49 using ParentType = FVSpatialParams<GridGeometry, Scalar,
51
52 enum {dimWorld=GridView::dimensionworld};
53 using GlobalPosition = typename SubControlVolume::GlobalPosition;
55
56public:
58 using PermeabilityType = Scalar;
62
63 ObstacleSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry) : ParentType(gridGeometry)
64 {
65 // intrinsic permeabilities
66 coarseK_ = 1e-12;
67 fineK_ = 1e-15;
68
69 // the porosity
70 porosity_ = 0.3;
71
72 // residual saturations
73 fineMaterialParams_.setSwr(0.0);
74 fineMaterialParams_.setSnr(0.0);
75 coarseMaterialParams_.setSwr(0.0);
76 coarseMaterialParams_.setSnr(0.0);
77
78 // parameters for the linear law, i.e. minimum and maximum
79 // pressures
80 fineMaterialParams_.setEntryPc(0.0);
81 coarseMaterialParams_.setEntryPc(0.0);
82 fineMaterialParams_.setMaxPc(0.0);
83 coarseMaterialParams_.setMaxPc(0.0);
84 }
85
86 template<class ElementSolution>
87 PermeabilityType permeability(const Element& element,
88 const SubControlVolume& scv,
89 const ElementSolution& elemSol) const
90 {
91 if (isFineMaterial_(scv.dofPosition()))
92 return fineK_;
93 else
94 return coarseK_;
95 }
96
102 Scalar porosityAtPos(const GlobalPosition& globalPos) const
103 { return porosity_; }
104
111 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
112 {
113 if (isFineMaterial_(globalPos))
114 return fineMaterialParams_;
115 else
116 return coarseMaterialParams_;
117 }
118
125 template<class FluidSystem>
126 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
127 {
128 return FluidSystem::phase0Idx;
129 }
130
131private:
136 static bool isFineMaterial_(const GlobalPosition &pos)
137 {
138 return
139 10 - eps_ <= pos[0] && pos[0] <= 20 + eps_ &&
140 0 - eps_ <= pos[1] && pos[1] <= 35 + eps_;
141 }
142
143 Scalar coarseK_;
144 Scalar fineK_;
145 Scalar porosity_;
146 MaterialLawParams fineMaterialParams_;
147 MaterialLawParams coarseMaterialParams_;
148 static constexpr Scalar eps_ = 1e-6;
149};
150
151} // end namespace Dumux
152
153#endif
Regularized linear capillary pressure and relative permeability <-> saturation relations.
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
This material law takes a material law defined for effective saturations and converts it to a materia...
Definition: 2p/efftoabslaw.hh:60
AbsParamsT Params
Definition: 2p/efftoabslaw.hh:64
Implements a linear saturation-capillary pressure relation.
Definition: regularizedlinearmaterial.hh:58
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
Definition: fv.hh:57
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fv1p.hh:334
Definition of the spatial params properties for the obstacle problem.
Definition: porousmediumflow/mpnc/implicit/obstacle/spatialparams.hh:44
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity of the soil.
Definition: porousmediumflow/mpnc/implicit/obstacle/spatialparams.hh:102
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw,...
Definition: porousmediumflow/mpnc/implicit/obstacle/spatialparams.hh:111
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Definition: porousmediumflow/mpnc/implicit/obstacle/spatialparams.hh:87
Scalar PermeabilityType
Export the type used for the permeability.
Definition: porousmediumflow/mpnc/implicit/obstacle/spatialparams.hh:58
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/mpnc/implicit/obstacle/spatialparams.hh:61
ObstacleSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/mpnc/implicit/obstacle/spatialparams.hh:63
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: porousmediumflow/mpnc/implicit/obstacle/spatialparams.hh:126
Defines a type tag and some properties for models using the box scheme.
This material law takes a material law defined for effective saturations and converts it to a materia...