3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/2p/implicit/incompressible/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 *****************************************************************************/
24#ifndef DUMUX_INCOMPRESSIBLE_TWOP_TEST_SPATIAL_PARAMS_HH
25#define DUMUX_INCOMPRESSIBLE_TWOP_TEST_SPATIAL_PARAMS_HH
26
30
32
33namespace Dumux {
34
39template<class GridGeometry, class Scalar>
40class TwoPTestSpatialParams
41: public FVSpatialParams<GridGeometry, Scalar, TwoPTestSpatialParams<GridGeometry, Scalar>>
42{
43 using GridView = typename GridGeometry::GridView;
44 using Element = typename GridView::template Codim<0>::Entity;
45 using FVElementGeometry = typename GridGeometry::LocalView;
46 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
47 using ThisType = TwoPTestSpatialParams<GridGeometry, Scalar>;
48 using ParentType = FVSpatialParams<GridGeometry, Scalar, ThisType>;
49
50 static constexpr int dimWorld = GridView::dimensionworld;
51 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
52
53 using EffectiveLaw = RegularizedVanGenuchten<Scalar>;
54
55public:
58 using PermeabilityType = Scalar;
59
60 TwoPTestSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
62 {
63 lensIsOilWet_ = getParam<bool>("SpatialParams.LensIsOilWet", false);
64
65 lensLowerLeft_ = getParam<GlobalPosition>("SpatialParams.LensLowerLeft");
66 lensUpperRight_ = getParam<GlobalPosition>("SpatialParams.LensUpperRight");
67
68 // residual saturations
69 lensMaterialParams_.setSwr(0.18);
70 lensMaterialParams_.setSnr(0.0);
71 outerMaterialParams_.setSwr(0.05);
72 outerMaterialParams_.setSnr(0.0);
73
74 // parameters for the Van Genuchten law
75 // alpha and n
76 lensMaterialParams_.setVgAlpha(0.00045);
77 lensMaterialParams_.setVgn(7.3);
78 outerMaterialParams_.setVgAlpha(0.0037);
79 outerMaterialParams_.setVgn(4.7);
80
81 lensK_ = getParam<Scalar>("SpatialParams.lensK", 9.05e-12);
82 outerK_ = getParam<Scalar>("SpatialParams.outerK", 4.6e-10);
83 }
84
94 template<class ElementSolution>
95 PermeabilityType permeability(const Element& element,
96 const SubControlVolume& scv,
97 const ElementSolution& elemSol) const
98 {
99
100 // do not use a less permeable lens in the test with inverted wettability
101 if (isInLens_(element.geometry().center()) && !lensIsOilWet_)
102 return lensK_;
103 return outerK_;
104 }
105
111 Scalar porosityAtPos(const GlobalPosition& globalPos) const
112 { return 0.4; }
113
124 template<class ElementSolution>
125 const MaterialLawParams& materialLawParams(const Element& element,
126 const SubControlVolume& scv,
127 const ElementSolution& elemSol) const
128 {
129 // do not use different parameters in the test with inverted wettability
130 if (isInLens_(element.geometry().center()) && !lensIsOilWet_)
131 return lensMaterialParams_;
132 return outerMaterialParams_;
133 }
134
141 template<class FluidSystem>
142 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
143 {
144 if (isInLens_(globalPos) && lensIsOilWet_)
145 return FluidSystem::phase1Idx;
146 return FluidSystem::phase0Idx;
147 }
148
150 template<class SolutionVector>
151 void updateMaterialInterfaceParams(const SolutionVector& x)
152 {
153 if (GridGeometry::discMethod == DiscretizationMethod::box)
154 materialInterfaceParams_.update(this->gridGeometry(), *this, x);
155 }
156
159 { return materialInterfaceParams_; }
160
162 bool lensIsOilWet() const { return lensIsOilWet_; }
163
164private:
165 bool isInLens_(const GlobalPosition &globalPos) const
166 {
167 for (int i = 0; i < dimWorld; ++i) {
168 if (globalPos[i] < lensLowerLeft_[i] + eps_ || globalPos[i] > lensUpperRight_[i] - eps_)
169 return false;
170 }
171 return true;
172 }
173
174 bool lensIsOilWet_;
175 GlobalPosition lensLowerLeft_;
176 GlobalPosition lensUpperRight_;
177
178 Scalar lensK_;
179 Scalar outerK_;
180 MaterialLawParams lensMaterialParams_;
181 MaterialLawParams outerMaterialParams_;
182
183 // Determines the parameters associated with the dofs at material interfaces
184 BoxMaterialInterfaceParams<ThisType> materialInterfaceParams_;
185
186 static constexpr Scalar eps_ = 1.5e-7;
187};
188
189} // end namespace Dumux
190
191#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...
copydoc Dumux::BoxMaterialInterfaceParams
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
Class that determines the material with the lowest capillary pressure (under fully water-saturated co...
Definition: boxmaterialinterfaceparams.hh:47
const BoxMaterialInterfaceParams< ThisType > & materialInterfaceParams() const
Returns the material parameters associated with a nodal dof.
Definition: porousmediumflow/2p/implicit/incompressible/spatialparams.hh:158
Scalar PermeabilityType
Definition: porousmediumflow/2p/implicit/boxdfm/spatialparams.hh:60
bool lensIsOilWet() const
Returns whether or not the lens is oil wet.
Definition: porousmediumflow/2p/implicit/incompressible/spatialparams.hh:162
const MaterialLawParams & materialLawParams(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Returns the parameter object for the Brooks-Corey material law.
Definition: porousmediumflow/2p/implicit/incompressible/spatialparams.hh:125
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the (intrinsic) permeability . In this test, we use element-wise distributed pe...
Definition: porousmediumflow/2p/implicit/incompressible/spatialparams.hh:95
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/2p/implicit/boxdfm/spatialparams.hh:59
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: porousmediumflow/2p/implicit/incompressible/spatialparams.hh:142
TwoPTestSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/2p/implicit/incompressible/spatialparams.hh:60
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Returns the porosity .
Definition: porousmediumflow/2p/implicit/incompressible/spatialparams.hh:111
void updateMaterialInterfaceParams(const SolutionVector &x)
Updates the map of which material parameters are associated with a nodal dof.
Definition: porousmediumflow/2p/implicit/incompressible/spatialparams.hh:151
This material law takes a material law defined for effective saturations and converts it to a materia...