3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/1p/implicit/compressible/stationary/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_COMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
26#define DUMUX_COMPRESSIBLE_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
73 template<class ElementSolution>
74 PermeabilityType permeability(const Element& element,
75 const SubControlVolume& scv,
76 const ElementSolution& elemSol) const
77 {
78 if (isInLens_(scv.dofPosition()))
79 return permeabilityLens_;
80 else
81 return permeability_;
82 }
83
89 Scalar porosityAtPos(const GlobalPosition& globalPos) const
90 { return 0.4; }
91
92private:
93 bool isInLens_(const GlobalPosition &globalPos) const
94 {
95 for (int i = 0; i < dimWorld; ++i) {
96 if (globalPos[i] < lensLowerLeft_[i] + eps_ || globalPos[i] > lensUpperRight_[i] - eps_)
97 return false;
98 }
99 return true;
100 }
101
102 GlobalPosition lensLowerLeft_;
103 GlobalPosition lensUpperRight_;
104
105 Scalar permeability_, permeabilityLens_;
106
107 static constexpr Scalar eps_ = 1.5e-7;
108};
109
110} // end namespace Dumux
111
112#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/compressible/stationary/spatialparams.hh:74
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity .
Definition: porousmediumflow/1p/implicit/compressible/stationary/spatialparams.hh:89
OnePTestSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/1p/implicit/compressible/stationary/spatialparams.hh:55
Defines a type tag and some properties for models using the box scheme.