3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/2p2c/implicit/waterair/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_WATER_AIR_SPATIAL_PARAMS_HH
25#define DUMUX_WATER_AIR_SPATIAL_PARAMS_HH
26
35
36namespace Dumux {
37
42template<class GridGeometry, class Scalar>
44: public FVSpatialParams<GridGeometry, Scalar,
45 WaterAirSpatialParams<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 static constexpr int dimWorld = GridView::dimensionworld;
55
57
58 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
59
60public:
62 using PermeabilityType = Scalar;
66
67 WaterAirSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry) : ParentType(gridGeometry)
68 {
69 layerBottom_ = 22.0;
70
71 // intrinsic permeabilities
72 fineK_ = 1e-13;
73 coarseK_ = 1e-12;
74
75 // porosities
76 finePorosity_ = 0.3;
77 coarsePorosity_ = 0.3;
78
79 // residual saturations
80 fineMaterialParams_.setSwr(0.2);
81 fineMaterialParams_.setSnr(0.0);
82 coarseMaterialParams_.setSwr(0.2);
83 coarseMaterialParams_.setSnr(0.0);
84
85 // parameters for the Brooks-Corey law
86 fineMaterialParams_.setPe(1e4);
87 coarseMaterialParams_.setPe(1e4);
88 fineMaterialParams_.setLambda(2.0);
89 coarseMaterialParams_.setLambda(2.0);
90
91 plotFluidMatrixInteractions_ = getParam<bool>("Output.PlotFluidMatrixInteractions");
92 }
93
99 {
101 GnuplotInterface<Scalar> gnuplot(plotFluidMatrixInteractions_);
102 gnuplot.setOpenPlotWindow(plotFluidMatrixInteractions_);
103 plotMaterialLaw.addpcswcurve(gnuplot, fineMaterialParams_, 0.2, 1.0, "fine", "w lp");
104 plotMaterialLaw.addpcswcurve(gnuplot, coarseMaterialParams_, 0.2, 1.0, "coarse", "w l");
105 gnuplot.setOption("set xrange [0:1]");
106 gnuplot.setOption("set label \"residual\\nsaturation\" at 0.1,100000 center");
107 gnuplot.plot("pc-Sw");
108
109 gnuplot.resetAll();
110 plotMaterialLaw.addkrcurves(gnuplot, fineMaterialParams_, 0.2, 1.0, "fine");
111 plotMaterialLaw.addkrcurves(gnuplot, coarseMaterialParams_, 0.2, 1.0, "coarse");
112 gnuplot.plot("kr");
113 }
114
121 Scalar permeabilityAtPos(const GlobalPosition& globalPos) const
122 {
123 if (isFineMaterial_(globalPos))
124 return fineK_;
125 return coarseK_;
126 }
127
133 Scalar porosityAtPos(const GlobalPosition& globalPos) const
134 {
135 if (isFineMaterial_(globalPos))
136 return finePorosity_;
137 else
138 return coarsePorosity_;
139 }
140
141
148 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
149 {
150 if (isFineMaterial_(globalPos))
151 return fineMaterialParams_;
152 else
153 return coarseMaterialParams_;
154 }
155
162 template<class FluidSystem>
163 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
164 { return FluidSystem::H2OIdx; }
165
166private:
167 bool isFineMaterial_(const GlobalPosition &globalPos) const
168 { return globalPos[dimWorld-1] > layerBottom_; }
169
170 Scalar fineK_;
171 Scalar coarseK_;
172 Scalar layerBottom_;
173
174 Scalar finePorosity_;
175 Scalar coarsePorosity_;
176
177 MaterialLawParams fineMaterialParams_;
178 MaterialLawParams coarseMaterialParams_;
179
180 bool plotFluidMatrixInteractions_;
181};
182
183} // end namespace Dumux
184
185#endif
Interface for passing data sets to a file and plotting them, if gnuplot is installed.
Interface for plotting the multi-component-matrix-interaction laws.
Interface for plotting the two-phase fluid-matrix-interaction laws.
Interface for plotting the non-isothermal two-phase fluid-matrix-interaction laws.
Implementation of a regularized version of the Brooks-Corey capillary pressure / relative permeabilit...
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 setOption(const std::string &option)
Sets additional user-defined options.
Definition: gnuplotinterface.hh:325
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 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 parameters for the water-air problem.
Definition: porousmediumflow/2p2c/implicit/waterair/spatialparams.hh:46
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity of the spatial parameters.
Definition: porousmediumflow/2p2c/implicit/waterair/spatialparams.hh:133
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Returns the parameter object for the Brooks-Corey material law which depends on the position.
Definition: porousmediumflow/2p2c/implicit/waterair/spatialparams.hh:148
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: porousmediumflow/2p2c/implicit/waterair/spatialparams.hh:163
Scalar permeabilityAtPos(const GlobalPosition &globalPos) const
Applies the intrinsic permeability tensor to a pressure potential gradient.
Definition: porousmediumflow/2p2c/implicit/waterair/spatialparams.hh:121
Scalar PermeabilityType
Export the type used for the permeability.
Definition: porousmediumflow/2p2c/implicit/waterair/spatialparams.hh:62
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/2p2c/implicit/waterair/spatialparams.hh:65
void plotMaterialLaw()
This is called from the problem and creates a gnuplot output of e.g the pc-Sw curve.
Definition: porousmediumflow/2p2c/implicit/waterair/spatialparams.hh:98
WaterAirSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/2p2c/implicit/waterair/spatialparams.hh:67
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...