12#ifndef DUMUX_POROMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
13#define DUMUX_POROMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
21#include "spatialparamstraits_.hh"
29template<
class Gr
idGeometry,
class Scalar,
class Implementation>
34 using FVElementGeometry =
typename GridGeometry::LocalView;
35 using SubControlVolume =
typename GridGeometry::SubControlVolume;
36 using GridView =
typename GridGeometry::GridView;
37 using Element =
typename GridView::template Codim<0>::Entity;
38 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
54 const SubControlVolume& scv)
const
56 static_assert(
decltype(
isValid(Detail::hasEffFluidDensityAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
57 " Your problem class has to either implement\n\n"
58 " Scalar effectiveFluidDensityAtPos(const GlobalPosition& globalPos) const\n\n"
59 " or overload this function\n\n"
60 " template<class ElementSolution>\n"
61 " Scalar effectiveFluidDensity(const Element& element,\n\
62 const SubControlVolume& scv) const\n\n");
64 return this->
asImp_().effectiveFluidDensityAtPos(scv.center());
80 template<
class ElemVolVars,
class FluxVarsCache>
82 const FVElementGeometry& fvGeometry,
83 const ElemVolVars& elemVolVars,
84 const FluxVarsCache& fluxVarsCache)
const
86 static_assert(
decltype(
isValid(Detail::hasEffPorePressureAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
87 " Your problem class has to either implement\n\n"
88 " Scalar effectivePorePressureAtPos(const GlobalPosition& globalPos) const\n\n"
89 " or overload this function\n\n"
90 " template<class ElementSolution>\n"
91 " Scalar effectivePorePressure(const Element& element,\n"
92 " const FVElementGeometry& fvGeometry,\n"
93 " const ElemVolVars& elemVolVars,\n"
94 " const FluxVarsCache& fluxVarsCache) const\n\n");
96 return this->
asImp_().effectivePorePressureAtPos(element.geometry().center());
115 template<
class SolidSystem,
class ElementSolution,
116 std::enable_if_t< SolidSystem::isInert() &&
117 !
decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())
118 (std::declval<Implementation>()))::value,
int > = 0 >
120 const SubControlVolume& scv,
121 const ElementSolution& elemSol,
126 template<
class SolidSystem,
class ElementSolution,
127 std::enable_if_t< !SolidSystem::isInert() ||
128 decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())
129 (std::declval<Implementation>()))::value,
int > = 0 >
131 const SubControlVolume& scv,
132 const ElementSolution& elemSol,
135 static_assert(
decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())(this->
asImp_()))::value,
" \n\n"
136 " Your spatial params class has to either implement\n\n"
137 " template<class SolidSystem>\n"
138 " Scalar inertVolumeFractionAtPos(const GlobalPosition& globalPos, int compIdx) const\n\n"
139 " or overload this function\n\n"
140 " template<class SolidSystem, class ElementSolution>\n"
141 " Scalar inertVolumeFraction(const Element& element,\n"
142 " const SubControlVolume& scv,\n"
143 " const ElementSolution& elemSol,\n"
144 " int compIdx) const\n\n");
146 return this->
asImp_().template reactiveVolumeFractionAtPos<SolidSystem>(scv.center(), compIdx);
162 template<
class ElemVolVars,
class FluxVarsCache>
164 const FVElementGeometry& fvGeometry,
165 const ElemVolVars& elemVolVars,
166 const FluxVarsCache& fluxVarsCache)
const
168 static_assert(
decltype(
isValid(Detail::hasLameParamsAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
169 " Your spatial params class has to either implement\n\n"
170 " const LameParams& lameParamsAtPos(const GlobalPosition& globalPos) const\n\n"
171 " or overload this function\n\n"
172 " template<class ElementSolution>\n"
173 " const LameParams& lameParams(const Element& element,\n"
174 " const FVElementGeometry& fvGeometry,\n"
175 " const ElemVolVars& elemVolVars,\n"
176 " const FluxVarsCache& fluxVarsCache) const\n\n");
178 return this->
asImp_().lameParamsAtPos(fluxVarsCache.ipGlobal());
194 template<
class ElemVolVars,
class FluxVarsCache>
196 const FVElementGeometry& fvGeometry,
197 const ElemVolVars& elemVolVars,
198 const FluxVarsCache& fluxVarsCache)
const
200 static_assert(
decltype(
isValid(Detail::hasBiotCoeffAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
201 " Your spatial params class has to either implement\n\n"
202 " const LameParams& biotCoefficientAtPos(const GlobalPosition& globalPos) const\n\n"
203 " or overload this function\n\n"
204 " template<class ElementSolution>\n"
205 " const LameParams& biotCoefficient(const Element& element,\n"
206 " const FVElementGeometry& fvGeometry,\n"
207 " const ElemVolVars& elemVolVars,\n"
208 " const FluxVarsCache& fluxVarsCache) const\n\n");
210 return this->
asImp_().biotCoefficientAtPos(fluxVarsCache.ipGlobal());
decltype(auto) lameParams(const Element &element, const FVElementGeometry &fvGeometry, const ElemVolVars &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Define the Lame parameters.
Definition poromechanics/poroelastic/fvspatialparams.hh:163
Scalar effectiveFluidDensity(const Element &element, const SubControlVolume &scv) const
Returns the effective fluid density within an scv.
Definition poromechanics/poroelastic/fvspatialparams.hh:53
Scalar reactiveVolumeFraction(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol, int compIdx) const
Function for defining the solid volume fraction of a solid component that takes part in some sort of ...
Definition poromechanics/poroelastic/fvspatialparams.hh:119
Scalar biotCoefficient(const Element &element, const FVElementGeometry &fvGeometry, const ElemVolVars &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Returns the Biot coefficient in an element.
Definition poromechanics/poroelastic/fvspatialparams.hh:195
FVPoroElasticSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
The constructor.
Definition poromechanics/poroelastic/fvspatialparams.hh:42
Scalar effectivePorePressure(const Element &element, const FVElementGeometry &fvGeometry, const ElemVolVars &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Returns the effective pore pressure.
Definition poromechanics/poroelastic/fvspatialparams.hh:81
FVPorousMediumSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition fvporousmediumspatialparams.hh:60
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
The base class for spatial parameters in porous medium problems.
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.