3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/mpnc/implicit/kinetic/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_EVAPORATION_ATMOSPHERE_SPATIALPARAMS_HH
27#define DUMUX_EVAPORATION_ATMOSPHERE_SPATIALPARAMS_HH
28
37
38// material laws for interfacial area
43
44namespace Dumux {
45
49template<class GridGeometry, class Scalar>
51: public FVNonEquilibriumSpatialParams<GridGeometry, Scalar,
52 EvaporationAtmosphereSpatialParams<GridGeometry, Scalar>>
53{
54 using GridView = typename GridGeometry::GridView;
55 using FVElementGeometry = typename GridGeometry::LocalView;
56 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
57 using Element = typename GridView::template Codim<0>::Entity;
60
61 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
62
63 static constexpr auto dimWorld = GridView::dimensionworld;
64public:
66 using PermeabilityType = Scalar;
71
79
83
84 EvaporationAtmosphereSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
86 {
87 heightPM_ = getParam<std::vector<Scalar>>("Grid.Positions1")[1];
88 heightDomain_ = getParam<std::vector<Scalar>>("Grid.Positions1")[2];
89
90 porosityPM_ = getParam<Scalar>("SpatialParams.PorousMedium.porosity");
91 intrinsicPermeabilityPM_ = getParam<Scalar>("SpatialParams.PorousMedium.permeability");
92
93 porosityFF_ = getParam<Scalar>("SpatialParams.FreeFlow.porosity");
94 intrinsicPermeabilityFF_ = getParam<Scalar>("SpatialParams.FreeFlow.permeability");
95
96 aWettingNonWettingA1_ = getParam<Scalar>("SpatialParams.soil.aWettingNonWettingA1");
97 aWettingNonWettingA2_ = getParam<Scalar>("SpatialParams.soil.aWettingNonWettingA2");
98 aWettingNonWettingA3_ = getParam<Scalar>("SpatialParams.soil.aWettingNonWettingA3");
99
100 aNonWettingSolidA1_ = getParam<Scalar>("SpatialParams.soil.aNonWettingSolidA1");
101 aNonWettingSolidA2_ = getParam<Scalar>("SpatialParams.soil.aNonWettingSolidA2");
102 aNonWettingSolidA3_ = getParam<Scalar>("SpatialParams.soil.aNonWettingSolidA3");
103
104 BCPd_ = getParam<Scalar>("SpatialParams.soil.BCPd");
105 BClambda_ = getParam<Scalar>("SpatialParams.soil.BClambda");
106 Swr_ = getParam<Scalar>("SpatialParams.soil.Swr");
107 Snr_ = getParam<Scalar>("SpatialParams.soil.Snr");
108
109 characteristicLengthFF_ = getParam<Scalar>("SpatialParams.FreeFlow.meanPoreSize");
110 characteristicLengthPM_ = getParam<Scalar>("SpatialParams.PorousMedium.meanPoreSize");
111
112 factorEnergyTransfer_ = getParam<Scalar>("SpatialParams.PorousMedium.factorEnergyTransfer");
113 factorMassTransfer_ = getParam<Scalar>("SpatialParams.PorousMedium.factorMassTransfer");
114
115 // residual saturations
116 materialParamsFF_.setSwr(0.0);
117 materialParamsFF_.setSnr(0.00);
118
119 materialParamsPM_.setSwr(Swr_);
120 materialParamsPM_.setSnr(Snr_);
121
122 // pc / kr parameters
123 materialParamsPM_.setLambda(BClambda_);
124 materialParamsPM_.setPe(BCPd_);
125
126 // for making pc == 0 in the FF
127 materialParamsFF_.setLambda(42.);
128 materialParamsFF_.setPe(0.);
129
130 // determine maximum capillary pressure for wetting-nonwetting surface
131 /* Of course physically there is no such thing as a maximum capillary pressure.
132 * The parametrization (VG/BC) goes to infinity and physically there is only one pressure
133 * for single phase conditions.
134 * Here, this is used for fitting the interfacial area surface: the capillary pressure,
135 * where the interfacial area is zero.
136 * Technically this value is obtained as the capillary pressure of saturation zero.
137 * This value of course only exists for the case of a regularized pc-Sw relation.
138 */
140 const auto pcMax = TwoPLaw::pc(materialParamsPM_, /*sw = */0.0);
141 aWettingNonWettingSurfaceParams_.setPcMax(pcMax);
142
143 // wetting-non wetting: surface which goes to zero on the edges, but is a polynomial
144 aWettingNonWettingSurfaceParams_.setA1(aWettingNonWettingA1_);
145 aWettingNonWettingSurfaceParams_.setA2(aWettingNonWettingA2_);
146 aWettingNonWettingSurfaceParams_.setA3(aWettingNonWettingA3_);
147
148 // non-wetting-solid
149 aNonWettingSolidSurfaceParams_.setA1(aNonWettingSolidA1_);
150 aNonWettingSolidSurfaceParams_.setA2(aNonWettingSolidA2_);
151 aNonWettingSolidSurfaceParams_.setA3(aNonWettingSolidA3_);
152
153 // dummys for free flow: no interface where there is only one phase
154 aWettingNonWettingSurfaceParamsFreeFlow_.setA1(0.);
155 aWettingNonWettingSurfaceParamsFreeFlow_.setA2(0.);
156 aWettingNonWettingSurfaceParamsFreeFlow_.setA3(0.);
157 aWettingNonWettingSurfaceParamsFreeFlow_.setPcMax(42.); // not needed because it is anyways zero; silencing valgrind
158
159 // dummys for free flow: no interface where there is only one phase
160 aNonWettingSolidSurfaceParamsFreeFlow_.setA1(0.);
161 aNonWettingSolidSurfaceParamsFreeFlow_.setA2(0.);
162 aNonWettingSolidSurfaceParamsFreeFlow_.setA3(0.);
163 }
164
165 template<class ElementSolution>
166 PermeabilityType permeability(const Element& element,
167 const SubControlVolume& scv,
168 const ElementSolution& elemSol) const
169 {
170 const auto & globalPos = scv.dofPosition();
171 if (inFF_(globalPos))
172 return intrinsicPermeabilityFF_ ;
173 else if (inPM_(globalPos))
174 return intrinsicPermeabilityPM_ ;
175 else
176 DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
177 }
178
188 template<class ElementSolution>
189 Scalar porosity(const Element& element,
190 const SubControlVolume& scv,
191 const ElementSolution& elemSol) const
192 {
193 const auto& globalPos = scv.dofPosition();
194
195 if (inFF_(globalPos))
196 return porosityFF_ ;
197 else if (inPM_(globalPos))
198 return porosityPM_ ;
199 else
200 DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
201 }
202
203 template<class ElementSolution>
204 const MaterialLawParams& materialLawParams(const Element& element,
205 const SubControlVolume& scv,
206 const ElementSolution& elemSol) const
207 { return materialLawParamsAtPos(scv.dofPosition()); }
208
209 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
210 {
211 if (inFF_(globalPos))
212 return materialParamsFF_;
213 else if (inPM_(globalPos))
214 return materialParamsPM_;
215 else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
216 }
217
228 template<class ElementSolution>
230 const SubControlVolume &scv,
231 const ElementSolution &elemSol) const
232 {
233 const auto& globalPos = scv.dofPosition();
234 if (inFF_(globalPos) )
235 return aWettingNonWettingSurfaceParamsFreeFlow_ ;
236 else if (inPM_(globalPos))
237 return aWettingNonWettingSurfaceParams_ ;
238 else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
239 }
240
250 template<class ElementSolution>
251 const AnsSurfaceParams& aNonWettingSolidSurfaceParams(const Element &element,
252 const SubControlVolume &scv,
253 const ElementSolution &elemSol) const
254 {
255 const auto& globalPos = scv.dofPosition();
256 if (inFF_(globalPos) )
257 return aNonWettingSolidSurfaceParamsFreeFlow_ ;
258 else if (inPM_(globalPos))
259 return aNonWettingSolidSurfaceParams_ ;
260 else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
261 }
262
272 template<class ElementSolution>
273 const AwsSurfaceParams& aWettingSolidSurfaceParams(const Element &element,
274 const SubControlVolume &scv,
275 const ElementSolution &elemSol) const
276 {
277 DUNE_THROW(Dune::NotImplemented, "wetting-solid-interface surface params");
278 }
279
284 const Scalar characteristicLengthAtPos(const GlobalPosition & globalPos) const
285 {
286 if (inFF_(globalPos) )
287 return characteristicLengthFF_ ;
288 else if (inPM_(globalPos))
289 return characteristicLengthPM_ ;
290 else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
291 }
292
297 const Scalar factorEnergyTransferAtPos(const GlobalPosition & globalPos) const
298 {
299 if (inFF_(globalPos) )
300 return factorEnergyTransfer_ ;
301 else if (inPM_(globalPos))
302 return factorEnergyTransfer_ ;
303 else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
304 }
305
310 const Scalar factorMassTransferAtPos(const GlobalPosition & globalPos) const
311 {
312 if (inFF_(globalPos) )
313 return factorMassTransfer_ ;
314 else if (inPM_(globalPos))
315 return factorMassTransfer_ ;
316 else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
317 }
318
325 template<class FluidSystem>
326 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
327 {
328 return FluidSystem::phase0Idx;
329 }
330
344 bool inPM_(const GlobalPosition & globalPos) const
345 { return ( (globalPos[dimWorld-1] > 0. - eps_) and (globalPos[dimWorld-1] < (heightPM_ + eps_) ) ); }
346
360 bool inFF_(const GlobalPosition & globalPos) const
361 { return ( (globalPos[dimWorld-1] < heightDomain_ + eps_) and (globalPos[dimWorld-1] > (heightPM_ + eps_) ) ); }
362
364 const Scalar heightPM() const
365 { return heightPM_; }
366
367private:
368 static constexpr Scalar eps_ = 1e-6;
369 Scalar heightDomain_ ;
370
371 AwnSurfaceParams aWettingNonWettingSurfaceParams_;
372 AnsSurfaceParams aNonWettingSolidSurfaceParams_ ;
373 AwnSurfaceParams aWettingNonWettingSurfaceParamsFreeFlow_;
374 AnsSurfaceParams aNonWettingSolidSurfaceParamsFreeFlow_ ;
375
376 // Porous Medium Domain
377 Scalar intrinsicPermeabilityPM_ ;
378 Scalar porosityPM_ ;
379 Scalar heightPM_ ;
380 Scalar factorEnergyTransfer_ ;
381 Scalar factorMassTransfer_ ;
382 Scalar characteristicLengthPM_ ;
383 MaterialLawParams materialParamsPM_ ;
384
385 // Free Flow Domain
386 Scalar porosityFF_ ;
387 Scalar intrinsicPermeabilityFF_ ;
388 Scalar characteristicLengthFF_ ;
389 MaterialLawParams materialParamsFF_ ;
390
391 // interfacial area parameters
392 Scalar aWettingNonWettingA1_ ;
393 Scalar aWettingNonWettingA2_ ;
394 Scalar aWettingNonWettingA3_ ;
395
396 Scalar aNonWettingSolidA1_;
397 Scalar aNonWettingSolidA2_;
398 Scalar aNonWettingSolidA3_;
399
400 // capillary pressures parameters
401 Scalar BCPd_ ;
402 Scalar BClambda_ ;
403 Scalar Swr_ ;
404 Scalar Snr_ ;
405 std::vector<Scalar> gridVector_;
406};
407
408} // end namespace Dumux
409
410#endif // GUARDIAN
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Linear capillary pressure and relative permeability <-> saturation relations.
Implementation of a regularized version of the Brooks-Corey capillary pressure / relative permeabilit...
Implementation of the regularized version of the van Genuchten's capillary pressure / relative permea...
Implementation of the regularized version of the van Genuchten's capillary pressure / relative permea...
Specification of a function relating volume specific interfacial area to capillary pressure and satur...
Specification of a function relating volume specific interfacial area to capillary pressure and satur...
Specification of a function relating volume specific interfacial area to capillary pressure and satur...
This material law takes a material law (interfacial area surface) defined for effective saturations a...
Base class for spatial parameters dealing with thermal and chemical non-equilibrium.
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 a exponential function relating specific interfacial area to wetting phase saturati...
Definition: awnsurfaceexpswpcto3.hh:43
Implementation of an interfacial area surface.
Definition: awnsurfacepcmaxfct.hh:44
Implementation of the polynomial of second order relating specific interfacial area to wetting phase ...
Definition: awnsurfacepolynomial2ndorder.hh:43
This material law takes a material law (interfacial area surface) defined for effective saturations a...
Definition: efftoabslawia.hh:63
InterfacialAreaAbsParamsT Params
Definition: efftoabslawia.hh:68
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fv1p.hh:334
Definition of the spatial parameters for non-equilibrium.
Definition: fvnonequilibrium.hh:39
Definition of the spatial parameters for the evaporation atmosphere Problem (using a "poor man's coup...
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:53
bool inFF_(const GlobalPosition &globalPos) const
Returns whether the tested position is above PM / "free flow" in the domain.
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:360
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:326
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:209
const Scalar heightPM() const
access function for the depth / height of the porous medium
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:364
const AwnSurfaceParams & aWettingNonWettingSurfaceParams(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Returns a reference to the container object for the parametrization of the surface between wetting an...
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:229
const Scalar factorMassTransferAtPos(const GlobalPosition &globalPos) const
Return the pre factor the the mass transfer.
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:310
const MaterialLawParams & materialLawParams(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:204
typename AwsSurface::Params AwsSurfaceParams
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:81
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:166
EvaporationAtmosphereSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:84
const AnsSurfaceParams & aNonWettingSolidSurfaceParams(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Returns a reference to the container object for the parametrization of the surface between non-Wettin...
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:251
const AwsSurfaceParams & aWettingSolidSurfaceParams(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Returns a reference to the container object for the parametrization of the surface between wetting an...
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:273
const Scalar characteristicLengthAtPos(const GlobalPosition &globalPos) const
Returns the characteristic length for the mass transfer.
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:284
typename AwnSurface::Params AwnSurfaceParams
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:80
const Scalar factorEnergyTransferAtPos(const GlobalPosition &globalPos) const
Return the pre factor the the energy transfer.
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:297
Scalar PermeabilityType
Export the type used for the permeability.
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:66
bool inPM_(const GlobalPosition &globalPos) const
Returns whether the tested position is in the porous medium part of the domain.
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:344
Scalar porosity(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the porosity. That is possibly solution dependent.
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:189
typename MaterialLaw::Params MaterialLawParams
Convenience aliases of the law parameters.
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:70
typename AnsSurface::Params AnsSurfaceParams
Definition: porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh:82
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...