3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
multidomain/boundary/darcydarcy/1p_1p/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
28#include <limits>
30
31namespace Dumux {
32namespace LensSpatialParams {
40template<class GlobalPosition>
41bool pointInLens(const GlobalPosition& globalPos,
42 const GlobalPosition& lensLowerLeft,
43 const GlobalPosition& lensUpperRight)
44{
45 const auto eps = 1e-8*(lensUpperRight - lensLowerLeft).two_norm();
46 for (int i = 0; i < GlobalPosition::size(); ++i)
47 if (globalPos[i] < lensLowerLeft[i] + eps || globalPos[i] > lensUpperRight[i] - eps)
48 return false;
49
50 return true;
51}
52} // end namespace LensSpatialParams
53
59template<class GridGeometry, class Scalar>
61: public FVSpatialParamsOneP<GridGeometry, Scalar, OnePTestSpatialParams<GridGeometry, Scalar>>
62{
65 using GridView = typename GridGeometry::GridView;
66 using Element = typename GridView::template Codim<0>::Entity;
67 using FVElementGeometry = typename GridGeometry::LocalView;
68 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
69
70 static constexpr int dimWorld = GridView::dimensionworld;
71 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
72
73public:
74 using PermeabilityType = Scalar;
75 OnePTestSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
77 , lensLowerLeft_(std::numeric_limits<Scalar>::max())
78 , lensUpperRight_(std::numeric_limits<Scalar>::lowest())
79 {
80 permeability_ = getParam<Scalar>("SpatialParams.Permeability");
81 permeabilityLens_ = getParam<Scalar>("SpatialParams.PermeabilityLens");
82 }
83
89 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
90 { return isInLens_(globalPos) ? permeabilityLens_ : permeability_; }
91
97 Scalar porosityAtPos(const GlobalPosition& globalPos) const
98 { return 0.4; }
99
103 void setLens(const GlobalPosition& lowerLeft, const GlobalPosition& upperRight)
104 { lensLowerLeft_ = lowerLeft; lensUpperRight_ = upperRight; }
105
106private:
107 bool isInLens_(const GlobalPosition &globalPos) const
108 { return LensSpatialParams::pointInLens(globalPos, lensLowerLeft_, lensUpperRight_); }
109
110 GlobalPosition lensLowerLeft_, lensUpperRight_;
111 Scalar permeability_, permeabilityLens_;
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
constexpr double eps
epsilon for checking direction of scvf normals
Definition: test_tpfafvgeometry_nonconforming.cc:44
bool pointInLens(const GlobalPosition &globalPos, const GlobalPosition &lensLowerLeft, const GlobalPosition &lensUpperRight)
Returns if a point is in a lens with a given bounding box.
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:41
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
The spatial parameters class for the test problem using the incompressible 1p model.
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:62
Scalar PermeabilityType
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:74
void setLens(const GlobalPosition &lowerLeft, const GlobalPosition &upperRight)
Optionally set a lens.
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:103
PermeabilityType permeabilityAtPos(const GlobalPosition &globalPos) const
Function for defining the (intrinsic) permeability .
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:89
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity .
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:97
OnePTestSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:75