3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/richards/implicit/lens/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_RICHARDS_LENS_SPATIAL_PARAMETERS_HH
26#define DUMUX_RICHARDS_LENS_SPATIAL_PARAMETERS_HH
27
31
33
34namespace Dumux {
35
40template<class GridGeometry, class Scalar>
42: public FVSpatialParams<GridGeometry, Scalar, RichardsLensSpatialParams<GridGeometry, Scalar>>
43{
46 using GridView = typename GridGeometry::GridView;
47 using FVElementGeometry = typename GridGeometry::LocalView;
48 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
49 using Element = typename GridView::template Codim<0>::Entity;
50 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
51
52 enum { dimWorld = GridView::dimensionworld };
53
54public:
57 // export permeability type
58 using PermeabilityType = Scalar;
59
60 RichardsLensSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
62 {
63
64 lensLowerLeft_ = {1.0, 2.0};
65 lensUpperRight_ = {4.0, 3.0};
66
67 // residual saturations
68 lensMaterialParams_.setSwr(0.18);
69 lensMaterialParams_.setSnr(0.0);
70 outerMaterialParams_.setSwr(0.05);
71 outerMaterialParams_.setSnr(0.0);
72
73 // parameters for the Van Genuchten law
74 // alpha and n
75 lensMaterialParams_.setVgAlpha(0.00045);
76 lensMaterialParams_.setVgn(7.3);
77 outerMaterialParams_.setVgAlpha(0.0037);
78 outerMaterialParams_.setVgn(4.7);
79
80 lensK_ = 1e-12;
81 outerK_ = 5e-12;
82 }
83
89 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
90 {
91 if (isInLens_(globalPos))
92 return lensK_;
93 return outerK_;
94 }
95
101 Scalar porosityAtPos(const GlobalPosition& globalPos) const
102 { return 0.4; }
103
114 template<class ElementSolution>
115 const MaterialLawParams& materialLawParams(const Element& element,
116 const SubControlVolume& scv,
117 const ElementSolution& elemSol) const
118 {
119 const auto& globalPos = scv.dofPosition();
120
121 return materialLawParamsAtPos(globalPos);
122 }
123
132 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
133 {
134 if (isInLens_(globalPos))
135 return lensMaterialParams_;
136 return outerMaterialParams_;
137 }
138
139private:
140 bool isInLens_(const GlobalPosition &globalPos) const
141 {
142 for (int i = 0; i < dimWorld; ++i)
143 if (globalPos[i] < lensLowerLeft_[i] - eps_ || globalPos[i] > lensUpperRight_[i] + eps_)
144 return false;
145
146 return true;
147 }
148
149 static constexpr Scalar eps_ = 1e-6;
150
151 GlobalPosition lensLowerLeft_;
152 GlobalPosition lensUpperRight_;
153
154 Scalar lensK_;
155 Scalar outerK_;
156 MaterialLawParams lensMaterialParams_;
157 MaterialLawParams outerMaterialParams_;
158};
159
160} // end namespace Dumux
161
162#endif
Implementation of the regularized version of the van Genuchten's capillary pressure / relative permea...
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
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
The spatial parameters for the RichardsLensProblem.
Definition: porousmediumflow/richards/implicit/lens/spatialparams.hh:43
RichardsLensSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/richards/implicit/lens/spatialparams.hh:60
const MaterialLawParams & materialLawParams(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Returns the parameters for the material law for the sub-control volume.
Definition: porousmediumflow/richards/implicit/lens/spatialparams.hh:115
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Returns the porosity [] at a given location.
Definition: porousmediumflow/richards/implicit/lens/spatialparams.hh:101
PermeabilityType permeabilityAtPos(const GlobalPosition &globalPos) const
Returns the intrinsic permeability tensor [m^2] at a given location.
Definition: porousmediumflow/richards/implicit/lens/spatialparams.hh:89
Scalar PermeabilityType
Definition: porousmediumflow/richards/implicit/lens/spatialparams.hh:58
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Returns the parameters for the material law at a given location.
Definition: porousmediumflow/richards/implicit/lens/spatialparams.hh:132
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/richards/implicit/lens/spatialparams.hh:56
This model implements a variant of the Richards' equation for quasi-twophase flow.
This material law takes a material law defined for effective saturations and converts it to a materia...