25#ifndef DUMUX_ROOT_SPATIALPARAMS_HH
26#define DUMUX_ROOT_SPATIALPARAMS_HH
39template<
class Gr
idGeometry,
class Scalar>
40class RootSpatialParams
41:
public FVSpatialParamsOneP<GridGeometry, Scalar, RootSpatialParams<GridGeometry, Scalar>>
43 using ThisType = RootSpatialParams<GridGeometry, Scalar>;
44 using ParentType = FVSpatialParamsOneP<GridGeometry, Scalar, ThisType>;
45 using Grid =
typename GridGeometry::Grid;
46 using GridView =
typename GridGeometry::GridView;
47 using Element =
typename GridView::template Codim<0>::Entity;
48 using SubControlVolume =
typename GridGeometry::SubControlVolume;
49 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
52 enum DGFParamIndices {
68 porosity_ = getParam<Scalar>(
"Root.SpatialParams.Porosity", 0.4);
69 constantKx_ = getParam<Scalar>(
"SpatialParams.Kx", 5.0968e-17);
70 constantKr_ = getParam<Scalar>(
"SpatialParams.Kr", 2.04e-13);
73 radii_.resize(gv.size(0));
74 for (
const auto& element : elements(gv))
76 const auto eIdx = gv.indexSet().index(element);
77 auto level0element = element;
78 for(
auto levelIdx = element.level(); levelIdx != 0; levelIdx--)
79 level0element = level0element.father();
80 const Scalar rootLength = element.geometry().volume();
81 const Scalar rootSurface = gridData_->parameters(level0element)[DGFParamIndices::surfaceIdx]/(1 << element.level());
82 radii_[eIdx] = rootSurface / rootLength / 2.0 / M_PI;
92 template<
class ElementSolution>
94 const SubControlVolume& scv,
95 const ElementSolution& elemSol)
const
106 Scalar
radius(std::size_t eIdxGlobal)
const
108 return radii_[eIdxGlobal];
116 Scalar
Kr(std::size_t eIdxGlobal)
const
135 std::shared_ptr<const GridData<Grid>> gridData_;
136 Scalar porosity_, constantKx_, constantKr_;
137 std::vector<Scalar> radii_;
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Class for grid data attached to dgf or gmsh grid files.
A much simpler (and thus potentially less buggy) version of pure water.
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
Class for grid data attached to dgf or gmsh grid files.
Definition: griddata.hh:66
A much simpler (and thus potentially less buggy) version of pure water.
Definition: simpleh2o.hh:51
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
const std::vector< Scalar > & getRadii() const
Definition: 1p_richards/spatialparams_root.hh:121
Scalar Kr(std::size_t eIdxGlobal) const
Returns the radial permeability.
Definition: 1p_richards/spatialparams_root.hh:116
Scalar PermeabilityType
Definition: 1p2c_richards2c/spatialparams_root.hh:62
Scalar radius(std::size_t eIdxGlobal) const
Returns the radius of the circular pipe for the current sub-control volume in [m].
Definition: 1p2c_richards2c/spatialparams_root.hh:106
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Returns the porosity .
Definition: 1p_richards/spatialparams_root.hh:129
RootSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< const GridData< Grid > > gridData)
Definition: 1p_richards/spatialparams_root.hh:64
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Returns the intrinsic permeability for the current sub-control volume in [m^2].
Definition: 1p_richards/spatialparams_root.hh:93