3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/3p/implicit/infiltration/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 *****************************************************************************/
26#ifndef DUMUX_INFILTRATION_THREEP_SPATIAL_PARAMS_HH
27#define DUMUX_INFILTRATION_THREEP_SPATIAL_PARAMS_HH
28
36
37namespace Dumux {
42template<class GridGeometry, class Scalar>
44: public FVSpatialParams<GridGeometry, Scalar,
45 InfiltrationThreePSpatialParams<GridGeometry, Scalar>>
46{
47 using GridView = typename GridGeometry::GridView;
48 using FVElementGeometry = typename GridGeometry::LocalView;
49 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
50 using Element = typename GridView::template Codim<0>::Entity;
51 using ParentType = FVSpatialParams<GridGeometry, Scalar,
53
54 using GlobalPosition = typename SubControlVolume::GlobalPosition;
55
57
58public:
60 using PermeabilityType = Scalar;
61
65
66 InfiltrationThreePSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
68 {
69 // intrinsic permeabilities
70 fineK_ = getParam<Scalar>("SpatialParams.permeability");
71 coarseK_ = getParam<Scalar>("SpatialParams.permeability");
72
73 // porosities
74 porosity_ = getParam<Scalar>("SpatialParams.porosity");
75 vGAlpha_ = getParam<Scalar>("SpatialParams.vanGenuchtenAlpha");
76 vGN_ = getParam<Scalar>("SpatialParams.vanGenuchtenN");
77 // residual saturations
78 materialParams_.setSwr(0.12);
79 materialParams_.setSnr(0.07);
80 materialParams_.setSgr(0.03);
81
82 // parameters for the 3phase van Genuchten law
83 materialParams_.setVgAlpha(vGAlpha_);
84 materialParams_.setVgn(vGN_);
85 materialParams_.setKrRegardsSnr(false);
86
87 // parameters for adsorption
88 materialParams_.setKdNAPL(0.);
89 materialParams_.setRhoBulk(1500.);
90
91 plotFluidMatrixInteractions_ = getParam<bool>("Output.PlotFluidMatrixInteractions");
92 }
93
99 {
100 GnuplotInterface<Scalar> gnuplot(plotFluidMatrixInteractions_);
101 gnuplot.setOpenPlotWindow(plotFluidMatrixInteractions_);
102 PlotMaterialLaw<Scalar, MaterialLaw> plotMaterialLaw(plotFluidMatrixInteractions_);
103
104 gnuplot.resetAll();
105 plotMaterialLaw.addpc(gnuplot, materialParams_);
106 gnuplot.plot("pc");
107
108 gnuplot.resetAll();
109 plotMaterialLaw.addkr(gnuplot, materialParams_);
110 gnuplot.plot("kr");
111 }
112
121 template<class ElementSolution>
122 PermeabilityType permeability(const Element& element,
123 const SubControlVolume& scv,
124 const ElementSolution& elemSol) const
125 {
126 if (isFineMaterial_(scv.dofPosition()))
127 return fineK_;
128 return coarseK_;
129 }
130
136 Scalar porosityAtPos(const GlobalPosition& globalPos) const
137 {
138 return porosity_;
139 }
140
146 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
147 {
148 return materialParams_;
149 }
150private:
151 bool isFineMaterial_(const GlobalPosition &globalPos) const
152 { return
153 70. - eps_ <= globalPos[0] && globalPos[0] <= 85. + eps_ &&
154 7.0 - eps_ <= globalPos[1] && globalPos[1] <= 7.50 + eps_;
155 }
156
157 Scalar fineK_;
158 Scalar coarseK_;
159
160 Scalar porosity_;
161 Scalar vGN_;
162 Scalar vGAlpha_;
163
164 MaterialLawParams materialParams_;
165
166 bool plotFluidMatrixInteractions_;
167
168 static constexpr Scalar eps_ = 1e-6;
169};
170
171} // end namespace Dumux
172
173#endif
Interface for passing data sets to a file and plotting them, if gnuplot is installed.
Interface for plotting the three-phase fluid-matrix-interaction laws.
Implementation of a regularized version of van Genuchten's capillary pressure-saturation relation for...
Parameters that are necessary for the regularization of the Parker - Van Genuchten capillary pressure...
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
Interface for passing data sets to a file and plotting them, if gnuplot is installed.
Definition: gnuplotinterface.hh:57
void plot(const std::string &filename="")
Plots the files for a specific window number, writes a gnuplot and png file.
Definition: gnuplotinterface.hh:89
void resetAll(const bool persist=true)
Resets all gnuplot parameters.
Definition: gnuplotinterface.hh:164
void setOpenPlotWindow(bool openPlotWindow)
Define whether the gnuplot window should be opened.
Definition: gnuplotinterface.hh:335
Interface for plotting the two-phase fluid-matrix-interaction laws.
Definition: plotmateriallaw.hh:42
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 van Genuchten's capillary pressure <-> saturation relation....
Definition: regularizedparkervangen3p.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 parameters for the infiltration problem.
Definition: porousmediumflow/3p/implicit/infiltration/spatialparams.hh:46
void plotMaterialLaw()
This is called from the problem and creates a gnuplot output of e.g the pc-Sw curve.
Definition: porousmediumflow/3p/implicit/infiltration/spatialparams.hh:98
InfiltrationThreePSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/3p/implicit/infiltration/spatialparams.hh:66
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Returns the porosity .
Definition: porousmediumflow/3p/implicit/infiltration/spatialparams.hh:136
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/3p/implicit/infiltration/spatialparams.hh:64
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the (intrinsic) permeability .
Definition: porousmediumflow/3p/implicit/infiltration/spatialparams.hh:122
Scalar PermeabilityType
Export permeability type.
Definition: porousmediumflow/3p/implicit/infiltration/spatialparams.hh:60
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Returns the parameter object for the Brooks-Corey material law.
Definition: porousmediumflow/3p/implicit/infiltration/spatialparams.hh:146
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...