3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/2pncmin/implicit/nonisothermal/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_SALINIZATION_SPATIAL_PARAMETERS_HH
27#define DUMUX_SALINIZATION_SPATIAL_PARAMETERS_HH
28
37
38namespace Dumux {
39
45template<class FVGridGeometry, class Scalar>
47: public FVSpatialParams<FVGridGeometry, Scalar,
48 SalinizationSpatialParams<FVGridGeometry, Scalar>>
49{
50 using GridView = typename FVGridGeometry::GridView;
51 using FVElementGeometry = typename FVGridGeometry::LocalView;
52 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
53 using Element = typename GridView::template Codim<0>::Entity;
54
55 using ParentType = FVSpatialParams<FVGridGeometry, Scalar,
57
59
60 using GlobalPosition = typename SubControlVolume::GlobalPosition;
61
62public:
63 // type used for the permeability (i.e. tensor or scalar)
64 using PermeabilityType = Scalar;
68
69 SalinizationSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
71 {
72 solubilityLimit_ = getParam<Scalar>("SpatialParams.SolubilityLimit", 0.26);
73 referencePorosity_ = getParam<Scalar>("SpatialParams.referencePorosity", 0.11);
74 referencePermeability_ = getParam<Scalar>("SpatialParams.referencePermeability", 2.23e-14);
75 irreducibleLiqSat_ = getParam<Scalar>("SpatialParams.IrreducibleLiqSat", 0.2);
76 irreducibleGasSat_ = getParam<Scalar>("SpatialParams.IrreducibleGasSat", 1e-3);
77 vgAlpha_ = getParam<Scalar>("SpatialParams.VGAlpha", 1.5);
78 vgn_ = getParam<Scalar>("SpatialParams.VGn", 4.0);
79
80 plotFluidMatrixInteractions_ = getParam<bool>("Output.PlotFluidMatrixInteractions");
81
82 //Van Genuchen parameters
83 // residual saturations
84 materialParams_.setSwr(irreducibleLiqSat_);
85 materialParams_.setSnr(irreducibleGasSat_);
86
87 //Van Genuchen parameters
88 materialParams_.setVgAlpha(vgAlpha_ );
89 materialParams_.setVgn(vgn_);
90 }
91
98 Scalar minimalPorosity(const Element& element, const SubControlVolume &scv) const
99 { return 1e-5; }
100
107 template<class SolidSystem>
108 Scalar inertVolumeFractionAtPos(const GlobalPosition& globalPos, int compIdx) const
109 { return 1.0-referencePorosity_; }
110
120 Scalar referencePorosity(const Element& element, const SubControlVolume &scv) const
121 { return referencePorosity_; }
122
132 template<class ElementSolution>
133 PermeabilityType permeability(const Element& element,
134 const SubControlVolume& scv,
135 const ElementSolution& elemSol) const
136 {
137 auto priVars = evalSolution(element, element.geometry(), elemSol, scv.center(), /*ignoreState=*/true);
138
139 Scalar sumPrecipitates = priVars[/*numComp*/3];
140
141 using std::max;
142 const auto poro = max(/*minPoro*/1e-5, referencePorosity_ - sumPrecipitates);
143 return permLaw_.evaluatePermeability(referencePermeability_, referencePorosity_, poro);
144 }
145
146 // the solubility limit of NaCl
147 Scalar solubilityLimit() const
148 { return solubilityLimit_; }
149
150 Scalar theta(const SubControlVolume &scv) const
151 { return 10.0; }
152
153 // return the brooks-corey context depending on the position
154 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
155 { return materialParams_; }
156
157 // define which phase is to be considered as the wetting phase
158 template<class FluidSystem>
159 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
160 { return FluidSystem::H2OIdx; }
161
162private:
163
164 MaterialLawParams materialParams_;
165
167
168 Scalar solubilityLimit_;
169 Scalar referencePorosity_;
170 PermeabilityType referencePermeability_ = 0.0;
171 Scalar irreducibleLiqSat_;
172 Scalar irreducibleGasSat_;
173 Scalar vgAlpha_;
174 Scalar vgn_ ;
175
176 bool plotFluidMatrixInteractions_;
177};
178
179} // end namespace Dumux
180
181#endif
Interface for passing data sets to a file and plotting them, if gnuplot is installed.
Interface for plotting the two-phase fluid-matrix-interaction laws.
Linear capillary pressure and relative permeability <-> saturation relations.
Implementation of the regularized version of the van Genuchten's capillary pressure / relative permea...
The Kozeny-Carman relationship for the calculation of a porosity-dependent permeability.
Class for the evaluation of the porosity subject to precipitation.
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
PrimaryVariables evalSolution(const Element &element, const typename Element::Geometry &geometry, const typename FVElementGeometry::GridGeometry &gridGeometry, const BoxElementSolution< FVElementGeometry, PrimaryVariables > &elemSol, const typename Element::Geometry::GlobalCoordinate &globalPos, bool ignoreState=false)
Interpolates a given box element solution at a given global position. Uses the finite element cache o...
Definition: evalsolution.hh:95
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 van Genuchten's capillary pressure / relative permeability <-> satu...
Definition: regularizedvangenuchten.hh:71
The Kozeny-Carman relationship for the calculation of a porosity-dependent permeability....
Definition: permeabilitykozenycarman.hh:42
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
Definition: fv.hh:57
const FVGridGeometry & fvGridGeometry() const
The finite volume grid geometry.
Definition: fv1p.hh:330
Spatial parameters for the salinization problem, where evaporation from a porous medium saturated wit...
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:49
Scalar theta(const SubControlVolume &scv) const
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:150
Scalar referencePorosity(const Element &element, const SubControlVolume &scv) const
Defines the reference porosity distribution.
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:120
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:154
Scalar minimalPorosity(const Element &element, const SubControlVolume &scv) const
Defines the minimum porosity distribution.
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:98
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:67
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:133
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:159
Scalar PermeabilityType
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:64
SalinizationSpatialParams(std::shared_ptr< const FVGridGeometry > fvGridGeometry)
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:69
Scalar inertVolumeFractionAtPos(const GlobalPosition &globalPos, int compIdx) const
Defines the volume fraction of the inert component.
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:108
Scalar solubilityLimit() const
Definition: porousmediumflow/2pncmin/implicit/nonisothermal/spatialparams.hh:147
This material law takes a material law defined for effective saturations and converts it to a materia...