12#ifndef DUMUX_POROUS_MEDIUM_FLOW_FV_SPATIAL_PARAMS_MP_HH
13#define DUMUX_POROUS_MEDIUM_FLOW_FV_SPATIAL_PARAMS_MP_HH
15#include <dune/common/exceptions.hh>
16#include <dune/common/fmatrix.hh>
31template<
class GlobalPosition>
32struct hasFluidMatrixInteractionAtPos
34 template<
class SpatialParams>
35 auto operator()(
const SpatialParams& a)
36 ->
decltype(a.fluidMatrixInteractionAtPos(std::declval<GlobalPosition>()))
46template<
class Gr
idGeometry,
class Scalar,
class Implementation>
51 using GridView =
typename GridGeometry::GridView;
52 using FVElementGeometry =
typename GridGeometry::LocalView;
53 using SubControlVolume =
typename GridGeometry::SubControlVolume;
54 using Element =
typename GridView::template Codim<0>::Entity;
56 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
70 template<
class ElementSolution>
72 const SubControlVolume& scv,
73 const ElementSolution& elemSol)
const
75 static_assert(
decltype(
isValid(Detail::hasFluidMatrixInteractionAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
76 " Your spatial params class has to either implement\n\n"
77 " auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const\n\n"
78 " or overload this function\n\n"
79 " template<class ElementSolution>\n"
80 " auto fluidMatrixInteraction(const Element& element,\n"
81 " const SubControlVolume& scv,\n"
82 " const ElementSolution& elemSol) const\n\n");
84 return this->
asImp_().fluidMatrixInteractionAtPos(scv.center());
95 template<
class Flu
idSystem,
class ElementSolution>
97 const SubControlVolume& scv,
98 const ElementSolution& elemSol)
const
100 return this->
asImp_().template wettingPhaseAtPos<FluidSystem>(scv.center());
109 template<
class Flu
idSystem>
112 DUNE_THROW(Dune::InvalidStateException,
113 "The spatial parameters do not provide "
114 "a wettingPhaseAtPos() method.");
The base class for spatial parameters of porous-medium-flow problems.
Definition: porousmediumflow/fvspatialparams.hh:46
The base class for spatial parameters of multi-phase problems.
Definition: fvspatialparamsmp.hh:49
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: fvspatialparamsmp.hh:110
FVPorousMediumFlowSpatialParamsMP(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: fvspatialparamsmp.hh:59
decltype(auto) fluidMatrixInteraction(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw,...
Definition: fvspatialparamsmp.hh:71
int wettingPhase(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining which phase is to be considered as the wetting phase.
Definition: fvspatialparamsmp.hh:96
The base class for spatial parameters used with finite-volume schemes.
Definition: common/fvspatialparams.hh:34
Implementation & asImp_()
Returns the implementation of the spatial parameters (static polymorphism)
Definition: common/fvspatialparams.hh:135
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvspatialparams.hh:130
Basic spatial parameters to be used with finite-volume schemes.
constexpr auto isValid(const Expression &t)
A function that creates a test functor to do class member introspection at compile time.
Definition: isvalid.hh:81
A helper function for class member function introspection.
Define some often used mathematical functions.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Basic spatial parameters to be used with finite-volume schemes.