3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/2p2c/implicit/mpnccomparison/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_MPNC_COMPARISON_SPATIAL_PARAMS_HH
26#define DUMUX_MPNC_COMPARISON_SPATIAL_PARAMS_HH
27
32
34
35namespace Dumux {
36
41template<class GridGeometry, class Scalar>
43: public FVSpatialParams<GridGeometry, Scalar,
44 TwoPTwoCComparisonSpatialParams<GridGeometry, Scalar>>
45{
46 using GridView = typename GridGeometry::GridView;
47 using FVElementGeometry = typename GridGeometry::LocalView;
48 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
49
50 using Element = typename GridView::template Codim<0>::Entity;
51 using ParentType = FVSpatialParams<GridGeometry, Scalar,
53
54 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
55
56 enum {dimWorld=GridView::dimensionworld};
57
59
60public:
62 using PermeabilityType = Scalar;
66
67
69 {
70 // intrinsic permeabilities
71 coarseK_ = 1e-12;
72 fineK_ = 1e-15;
73
74 // the porosity
75 porosity_ = 0.3;
76
77 // residual saturations
78 fineMaterialParams_.setSwr(0.2);
79 fineMaterialParams_.setSnr(0.0);
80 coarseMaterialParams_.setSwr(0.2);
81 coarseMaterialParams_.setSnr(0.0);
82
83 // parameters for the Brooks-Corey law
84 fineMaterialParams_.setPe(1e4);
85 coarseMaterialParams_.setPe(1e4);
86 fineMaterialParams_.setLambda(2.0);
87 coarseMaterialParams_.setLambda(2.0);
88 }
89
90 template<class ElementSolution>
91 PermeabilityType permeability(const Element& element,
92 const SubControlVolume& scv,
93 const ElementSolution& elemSol) const
94 {
95 if (isFineMaterial_(scv.dofPosition()))
96 return fineK_;
97 else
98 return coarseK_;
99 }
100
107 Scalar porosityAtPos(const GlobalPosition& globalPos) const
108 {
109 return porosity_;
110 }
111
118 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
119 {
120 if (isFineMaterial_(globalPos))
121 return fineMaterialParams_;
122 else
123 return coarseMaterialParams_;
124 }
125
132 template<class FluidSystem>
133 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
134 { return FluidSystem::H2OIdx; }
135
136private:
142 static bool isFineMaterial_(const GlobalPosition &pos)
143 {
144 return
145 30 - eps_ <= pos[0] && pos[0] <= 50 + eps_ &&
146 20 - eps_ <= pos[1] && pos[1] <= 40 + eps_;
147 }
148
149 Scalar coarseK_;
150 Scalar fineK_;
151 Scalar porosity_;
152 MaterialLawParams fineMaterialParams_;
153 MaterialLawParams coarseMaterialParams_;
154 static constexpr Scalar eps_ = 1e-6;
155};
156
157} // end namespace Dumux
158
159#endif
Implementation of a regularized version of the Brooks-Corey capillary pressure / relative permeabilit...
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
Implementation of the regularized Brooks-Corey capillary pressure / relative permeability <-> saturat...
Definition: regularizedbrookscorey.hh:62
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 2p2c mpnc comparison problem.
Definition: porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh:45
TwoPTwoCComparisonSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh:68
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw,...
Definition: porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh:118
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh:65
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh:133
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Definition: porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh:91
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity of the soil.
Definition: porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh:107
Scalar PermeabilityType
Export permeability type.
Definition: porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh:62
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...