24#ifndef DUMUX_POROUS_MEDIUM_FLOW_FV_SPATIAL_PARAMS_HH
25#define DUMUX_POROUS_MEDIUM_FLOW_FV_SPATIAL_PARAMS_HH
27#include <dune/common/exceptions.hh>
28#include <dune/common/fmatrix.hh>
40template<
class GlobalPosition>
41struct hasPermeabilityAtPos
43 template<
class SpatialParams>
44 auto operator()(
const SpatialParams& a)
45 ->
decltype(a.permeabilityAtPos(std::declval<GlobalPosition>()))
55template<
class Gr
idGeometry,
class Scalar,
class Implementation>
60 using GridView =
typename GridGeometry::GridView;
61 using FVElementGeometry =
typename GridGeometry::LocalView;
62 using SubControlVolume =
typename GridGeometry::SubControlVolume;
63 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
64 using Element =
typename GridView::template Codim<0>::Entity;
66 enum { dim = GridView::dimension };
67 enum { dimWorld = GridView::dimensionworld };
68 using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
70 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
82 forchCoeffDefault_ = getParam<Scalar>(
"SpatialParams.ForchCoeff", 0.55);
94 template<
class ElementSolution>
96 const SubControlVolume& scv,
97 const ElementSolution& elemSol)
const
99 static_assert(
decltype(
isValid(Detail::hasPermeabilityAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
100 " Your spatial params class has to either implement\n\n"
101 " const PermeabilityType& permeabilityAtPos(const GlobalPosition& globalPos) const\n\n"
102 " or overload this function\n\n"
103 " template<class ElementSolution>\n"
104 " const PermeabilityType& permeability(const Element& element,\n"
105 " const SubControlVolume& scv,\n"
106 " const ElementSolution& elemSol) const\n\n");
108 return this->
asImp_().permeabilityAtPos(scv.center());
128 DUNE_THROW(Dune::InvalidStateException,
129 "The spatial parameters do not provide a beaversJosephCoeffAtPos() method.");
140 return forchCoeffDefault_;
144 Scalar forchCoeffDefault_;
A helper function for class member function introspection.
The base class for spatial parameters in porous medium problems.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Define some often used mathematical functions.
constexpr auto isValid(const Expression &t)
A function that creates a test functor to do class member introspection at compile time.
Definition: isvalid.hh:93
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
The base class for spatial parameters of porous-medium problems.
Definition: fvporousmediumspatialparams.hh:63
The base class for spatial parameters used with finite-volume schemes.
Definition: common/fvspatialparams.hh:46
Implementation & asImp_()
Returns the implementation of the spatial parameters (static polymorphism)
Definition: common/fvspatialparams.hh:147
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvspatialparams.hh:142
The base class for spatial parameters of porous-medium-flow problems.
Definition: porousmediumflow/fvspatialparams.hh:58
decltype(auto) permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the (intrinsic) permeability .
Definition: porousmediumflow/fvspatialparams.hh:95
static constexpr bool evaluatePermeabilityAtScvfIP()
If the permeability should be evaluated directly at the scvf integration point (for convergence tests...
Definition: porousmediumflow/fvspatialparams.hh:116
FVPorousMediumFlowSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/fvspatialparams.hh:73
Scalar beaversJosephCoeffAtPos(const GlobalPosition &globalPos) const
Function for defining the Beavers-Joseph coefficient for multidomain problems .
Definition: porousmediumflow/fvspatialparams.hh:126
Scalar forchCoeff(const SubControlVolumeFace &scvf) const
Apply the Forchheimer coefficient for inertial forces calculation.
Definition: porousmediumflow/fvspatialparams.hh:138