3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/mpnc/implicit/2p2ccomparison/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
42template<class GridGeometry, class Scalar>
44: public FVSpatialParams<GridGeometry, Scalar,
45 MPNCComparisonSpatialParams<GridGeometry, Scalar>>
46{
47 using GridView = typename GridGeometry::GridView;
48 using FVElementGeometry = typename GridGeometry::LocalView;
49 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
50
51 using Element = typename GridView::template Codim<0>::Entity;
52 using ParentType = FVSpatialParams<GridGeometry, Scalar,
54
55 using GlobalPosition = typename SubControlVolume::GlobalPosition;
57
58public:
59 using PermeabilityType = Scalar;
62
63 MPNCComparisonSpatialParams(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.2);
74 fineMaterialParams_.setSnr(0.0);
75 coarseMaterialParams_.setSwr(0.2);
76 coarseMaterialParams_.setSnr(0.0);
77
78 // parameters for the Brooks-Corey law
79 fineMaterialParams_.setPe(1e4);
80 coarseMaterialParams_.setPe(1e4);
81 fineMaterialParams_.setLambda(2.0);
82 coarseMaterialParams_.setLambda(2.0);
83 }
84
85 template<class ElementSolution>
86 PermeabilityType permeability(const Element& element,
87 const SubControlVolume& scv,
88 const ElementSolution& elemSol) const
89 {
90 if (isFineMaterial_(scv.dofPosition()))
91 return fineK_;
92 else
93 return coarseK_;
94 }
95
101 Scalar porosityAtPos(const GlobalPosition& globalPos) const
102 {
103 return porosity_;
104 }
105
112 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
113 {
114 if (isFineMaterial_(globalPos))
115 return fineMaterialParams_;
116 else
117 return coarseMaterialParams_;
118 }
119
126 template<class FluidSystem>
127 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
128 {
129 return FluidSystem::phase0Idx;
130 }
131
132private:
137 static bool isFineMaterial_(const GlobalPosition &pos)
138 {
139 return
140 30 - eps_ <= pos[0] && pos[0] <= 50 + eps_ &&
141 20 - eps_ <= pos[1] && pos[1] <= 40 + eps_;
142 }
143
144 Scalar coarseK_;
145 Scalar fineK_;
146 Scalar porosity_;
147 MaterialLawParams fineMaterialParams_;
148 MaterialLawParams coarseMaterialParams_;
149 static constexpr Scalar eps_ = 1e-6;
150};
151
152}
153
154#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
Definition of the spatial params properties for the obstacle problem.
Definition: porousmediumflow/mpnc/implicit/2p2ccomparison/spatialparams.hh:46
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity of the soil.
Definition: porousmediumflow/mpnc/implicit/2p2ccomparison/spatialparams.hh:101
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/mpnc/implicit/2p2ccomparison/spatialparams.hh:61
MPNCComparisonSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/mpnc/implicit/2p2ccomparison/spatialparams.hh:63
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw,...
Definition: porousmediumflow/mpnc/implicit/2p2ccomparison/spatialparams.hh:112
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Definition: porousmediumflow/mpnc/implicit/2p2ccomparison/spatialparams.hh:86
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: porousmediumflow/mpnc/implicit/2p2ccomparison/spatialparams.hh:127
Scalar PermeabilityType
Definition: porousmediumflow/mpnc/implicit/2p2ccomparison/spatialparams.hh:59
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...