3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/1p/implicit/periodicbc/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_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
25#define DUMUX_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
26
29
30namespace Dumux {
31
37template<class TypeTag>
38class OnePTestSpatialParams
39: public FVSpatialParamsOneP<GetPropType<TypeTag, Properties::GridGeometry>,
40 GetPropType<TypeTag, Properties::Scalar>,
41 OnePTestSpatialParams<TypeTag>>
42{
43 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
44 using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
45 using GridView = typename GridGeometry::GridView;
46 using Element = typename GridView::template Codim<0>::Entity;
47 using FVElementGeometry = typename GridGeometry::LocalView;
48 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
49 using ParentType = FVSpatialParamsOneP<GridGeometry, Scalar, OnePTestSpatialParams<TypeTag>>;
50
51 static constexpr int dimWorld = GridView::dimensionworld;
52 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
53
54public:
55 using PermeabilityType = Scalar;
56 OnePTestSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
58 {
59 permeability_ = getParam<Scalar>("SpatialParams.Permeability");
60 permeabilityLens_ = getParam<Scalar>("SpatialParams.PermeabilityLens");
61
62 lensLowerLeft_ = getParam<GlobalPosition>("SpatialParams.LensLowerLeft");
63 lensUpperRight_ = getParam<GlobalPosition>("SpatialParams.LensUpperRight");
64 }
65
74 template<class ElementSolution>
75 PermeabilityType permeability(const Element& element,
76 const SubControlVolume& scv,
77 const ElementSolution& elemSol) const
78 {
79 if (isInLens_(scv.dofPosition()))
80 return permeabilityLens_;
81 else
82 return permeability_;
83 }
84
90 Scalar porosityAtPos(const GlobalPosition& globalPos) const
91 { return 0.4; }
92
93private:
94 bool isInLens_(const GlobalPosition &globalPos) const
95 {
96 for (int i = 0; i < dimWorld; ++i) {
97 if (globalPos[i] < lensLowerLeft_[i] + eps_ || globalPos[i] > lensUpperRight_[i] - eps_)
98 return false;
99 }
100 return true;
101 }
102
103 GlobalPosition lensLowerLeft_;
104 GlobalPosition lensUpperRight_;
105
106 Scalar permeability_, permeabilityLens_;
107
108 static constexpr Scalar eps_ = 1.5e-7;
109};
110
111} // end namespace Dumux
112
113#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
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/periodicbc/spatialparams.hh:75
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity .
Definition: porousmediumflow/1p/implicit/periodicbc/spatialparams.hh:90
OnePTestSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/1p/implicit/periodicbc/spatialparams.hh:56
Defines a type tag and some properties for models using the box scheme.