26#ifndef DUMUX_1P_TEST_SPATIALPARAMS_HH
27#define DUMUX_1P_TEST_SPATIALPARAMS_HH
40template<
class Gr
idGeometry,
class Scalar>
41class OnePTestSpatialParams
42:
public FVSpatialParamsOneP<GridGeometry, Scalar,
43 OnePTestSpatialParams<GridGeometry, Scalar>>
45 using GridView =
typename GridGeometry::GridView;
46 using FVElementGeometry =
typename GridGeometry::LocalView;
47 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
48 using IndexSet =
typename GridView::IndexSet;
50 OnePTestSpatialParams<GridGeometry, Scalar>>;
53 dim=GridView::dimension,
54 dimWorld=GridView::dimensionworld
57 using Element =
typename GridView::template Codim<0>::Entity;
58 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
66 randomPermeability_(
gridGeometry->gridView().size(dim), 0.0),
69 randomField_ = getParam<bool>(
"SpatialParams.RandomField",
false);
70 permeability_ = getParam<Scalar>(
"SpatialParams.Permeability");
72 permeabilityLens_ = getParam<Scalar>(
"SpatialParams.PermeabilityLens");
76 lensLowerLeft_ = getParam<GlobalPosition>(
"SpatialParams.LensLowerLeft");
77 lensUpperRight_ = getParam<GlobalPosition>(
"SpatialParams.LensUpperRight");
88 template<
class ElementSolution>
90 const SubControlVolume& scv,
91 const ElementSolution& elemSol)
const
93 if (isInLens_(scv.dofPosition()))
96 return randomPermeability_[indexSet_.index(element)];
98 return permeabilityLens_;
101 return permeability_;
118 const auto& gridView = gg.gridView();
119 const auto& elementMapper = gg.elementMapper();
120 const auto gStatControlFile = getParam<std::string>(
"Gstat.ControlFile");
121 const auto gStatInputFile = getParam<std::string>(
"Gstat.InputFile");
122 const auto outputFilePrefix = getParam<std::string>(
"Gstat.OutputFilePrefix");
126 RandomField randomPermeabilityField(gridView, elementMapper);
127 randomPermeabilityField.create(gStatControlFile,
129 outputFilePrefix +
".dat",
130 RandomField::FieldType::log10,
132 randomPermeability_.resize(gridView.size(dim), 0.0);
135 randomPermeability_ = randomPermeabilityField.data();
140 {
return randomPermeability_; }
143 bool isInLens_(
const GlobalPosition &globalPos)
const
145 for (
int i = 0; i < dimWorld; ++i) {
146 if (globalPos[i] < lensLowerLeft_[i] + eps_ || globalPos[i] > lensUpperRight_[i] - eps_)
153 GlobalPosition lensLowerLeft_;
154 GlobalPosition lensUpperRight_;
156 Scalar permeability_, permeabilityLens_;
157 std::vector<Scalar> randomPermeability_;
159 const IndexSet& indexSet_;
160 static constexpr Scalar eps_ = 1.5e-7;
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
Creating random fields using gstat.
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
Creating random fields using gstat.
Definition: gstatrandomfield.hh:49
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/isothermal/spatialparams.hh:89
const std::vector< Scalar > & getPermField() const
get the permeability field for output
Definition: porousmediumflow/1p/implicit/isothermal/spatialparams.hh:139
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity in [-].
Definition: porousmediumflow/1p/implicit/isothermal/spatialparams.hh:108
OnePTestSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/1p/implicit/isothermal/spatialparams.hh:64
void initRandomField(const GridGeometry &gg)
This method allows the generation of a statistical field using gstat.
Definition: porousmediumflow/1p/implicit/isothermal/spatialparams.hh:116
Defines a type tag and some properties for models using the box scheme.