3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/1p/implicit/incompressible/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_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
26#define DUMUX_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
27
30
31namespace Dumux {
32
38template<class GridGeometry, class Scalar>
39class OnePTestSpatialParams
40: public FVSpatialParamsOneP<GridGeometry, Scalar,
41 OnePTestSpatialParams<GridGeometry, Scalar>>
42{
43 using GridView = typename GridGeometry::GridView;
44 using Element = typename GridView::template Codim<0>::Entity;
45 using FVElementGeometry = typename GridGeometry::LocalView;
46 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
47 using ParentType = FVSpatialParamsOneP<GridGeometry, Scalar,
48 OnePTestSpatialParams<GridGeometry, Scalar>>;
49
50 static constexpr int dimWorld = GridView::dimensionworld;
51 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
52
53public:
54 using PermeabilityType = Scalar;
55 OnePTestSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
57 {
58 permeability_ = getParam<Scalar>("SpatialParams.Permeability");
59 permeabilityLens_ = getParam<Scalar>("SpatialParams.PermeabilityLens");
60
61 lensLowerLeft_ = getParam<GlobalPosition>("SpatialParams.LensLowerLeft");
62 lensUpperRight_ = getParam<GlobalPosition>("SpatialParams.LensUpperRight");
63
64 checkIsConstantVelocity_ = getParam<bool>("Problem.CheckIsConstantVelocity",false);
65 }
66
75 template<class ElementSolution>
76 PermeabilityType permeability(const Element& element,
77 const SubControlVolume& scv,
78 const ElementSolution& elemSol) const
79 {
80 if (isInLens_(scv.dofPosition()) && !checkIsConstantVelocity_)
81 return permeabilityLens_;
82 else
83 return permeability_;
84 }
85
91 Scalar porosityAtPos(const GlobalPosition& globalPos) const
92 { return 0.4; }
93
94private:
95 bool isInLens_(const GlobalPosition &globalPos) const
96 {
97 for (int i = 0; i < dimWorld; ++i) {
98 if (globalPos[i] < lensLowerLeft_[i] + eps_ || globalPos[i] > lensUpperRight_[i] - eps_)
99 return false;
100 }
101 return true;
102 }
103
104 GlobalPosition lensLowerLeft_;
105 GlobalPosition lensUpperRight_;
106
107 Scalar permeability_, permeabilityLens_;
108
109 static constexpr Scalar eps_ = 1.5e-7;
110
111 bool checkIsConstantVelocity_;
112};
113
114} // end namespace Dumux
115
116#endif
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
Definition: fv1p.hh:77
FVSpatialParamsOneP(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: fv1p.hh:91
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fv1p.hh:334
Scalar PermeabilityType
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:74
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the (intrinsic) permeability .
Definition: porousmediumflow/1p/implicit/incompressible/spatialparams.hh:76
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity .
Definition: porousmediumflow/1p/implicit/incompressible/spatialparams.hh:91
OnePTestSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/1p/implicit/incompressible/spatialparams.hh:55
Defines a type tag and some properties for models using the box scheme.