25#ifndef DUMUX_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
26#define DUMUX_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
38template<
class Gr
idGeometry,
class Scalar>
39class OnePTestSpatialParams
40:
public FVSpatialParamsOneP<GridGeometry, Scalar,
41 OnePTestSpatialParams<GridGeometry, Scalar>>
43 using GridView =
typename GridGeometry::GridView;
44 using FVElementGeometry =
typename GridGeometry::LocalView;
45 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
46 using Element =
typename GridView::template Codim<0>::Entity;
48 OnePTestSpatialParams<GridGeometry, Scalar>>;
50 static constexpr int dimWorld = GridView::dimensionworld;
51 using GlobalPosition =
typename SubControlVolume::GlobalPosition;
58 permeability_ = getParam<Scalar>(
"SpatialParams.Permeability");
59 permeabilityLens_ = getParam<Scalar>(
"SpatialParams.PermeabilityLens");
61 lensLowerLeft_ = getParam<GlobalPosition>(
"SpatialParams.LensLowerLeft");
62 lensUpperRight_ =getParam<GlobalPosition>(
"SpatialParams.LensUpperRight");
66 std::lognormal_distribution<Scalar> K(std::log(permeability_), std::log(permeability_)*0.1);
67 std::lognormal_distribution<Scalar> KLens(std::log(permeabilityLens_), std::log(permeabilityLens_)*0.1);
68 for (
const auto& element : elements(
gridGeometry->gridView()))
70 const auto eIdx =
gridGeometry->elementMapper().index(element);
71 const auto globalPos = element.geometry().center();
72 K_[eIdx] = isInLens_(globalPos) ? KLens(rand) : K(rand);
84 template<
class ElementSolution>
86 const SubControlVolume& scv,
87 const ElementSolution& elemSol)
const
89 return K_[scv.dofIndex()];
110 bool isInLens_(
const GlobalPosition &globalPos)
const
112 for (
int i = 0; i < dimWorld; ++i) {
113 if (globalPos[i] < lensLowerLeft_[i] + eps_ || globalPos[i] > lensUpperRight_[i] - eps_)
119 GlobalPosition lensLowerLeft_;
120 GlobalPosition lensUpperRight_;
122 Scalar permeability_, permeabilityLens_;
124 std::vector<Scalar> K_;
126 static constexpr Scalar eps_ = 1.5e-7;
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
const PermeabilityType & permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the (intrinsic) permeability .
Definition: porousmediumflow/tracer/1ptracer/spatialparams_1p.hh:85
const std::vector< Scalar > & getKField() const
Reference to the k field.
Definition: porousmediumflow/tracer/1ptracer/spatialparams_1p.hh:106
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Function for defining the porosity which is possibly solution dependent.
Definition: porousmediumflow/tracer/1ptracer/spatialparams_1p.hh:102
OnePTestSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/tracer/1ptracer/spatialparams_1p.hh:55
Defines a type tag and some properties for models using the box scheme.