12#ifndef DUMUX_GEOMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
13#define DUMUX_GEOMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
19#include <dumux/geomechanics/spatialparamstraits_.hh>
27template<
class GlobalPosition>
28struct hasEffFluidDensityAtPos
30 template<
class Problem>
31 auto operator()(
const Problem& a)
32 ->
decltype(a.effectiveFluidDensityAtPos(std::declval<GlobalPosition>()))
37template<
class GlobalPosition>
38struct hasEffPorePressureAtPos
40 template<
class Problem>
41 auto operator()(
const Problem& a)
42 ->
decltype(a.effectivePorePressureAtPos(std::declval<GlobalPosition>()))
47template<
class GlobalPosition,
class Sol
idSystem>
48struct hasReactiveVolumeFractionAtPos
50 template<
class SpatialParams>
51 auto operator()(
const SpatialParams& a)
52 ->
decltype(a.template reactiveVolumeFractionAtPos<SolidSystem>(std::declval<GlobalPosition>(), 0))
57template<
class GlobalPosition>
58struct hasBiotCoeffAtPos
60 template<
class SpatialParams>
61 auto operator()(
const SpatialParams& a)
62 ->
decltype(a.biotCoefficientAtPos(std::declval<GlobalPosition>()))
73template<
class Gr
idGeometry,
class Scalar,
class Implementation>
78 using FVElementGeometry =
typename GridGeometry::LocalView;
79 using SubControlVolume =
typename GridGeometry::SubControlVolume;
80 using GridView =
typename GridGeometry::GridView;
81 using Element =
typename GridView::template Codim<0>::Entity;
82 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
98 const SubControlVolume& scv)
const
100 static_assert(
decltype(
isValid(Detail::hasEffFluidDensityAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
101 " Your problem class has to either implement\n\n"
102 " Scalar effectiveFluidDensityAtPos(const GlobalPosition& globalPos) const\n\n"
103 " or overload this function\n\n"
104 " template<class ElementSolution>\n"
105 " Scalar effectiveFluidDensity(const Element& element,\n\
106 const SubControlVolume& scv) const\n\n");
108 return this->
asImp_().effectiveFluidDensityAtPos(scv.center());
124 template<
class ElemVolVars,
class FluxVarsCache>
126 const FVElementGeometry& fvGeometry,
127 const ElemVolVars& elemVolVars,
128 const FluxVarsCache& fluxVarsCache)
const
130 static_assert(
decltype(
isValid(Detail::hasEffPorePressureAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
131 " Your problem class has to either implement\n\n"
132 " Scalar effectivePorePressureAtPos(const GlobalPosition& globalPos) const\n\n"
133 " or overload this function\n\n"
134 " template<class ElementSolution>\n"
135 " Scalar effectivePorePressure(const Element& element,\n"
136 " const FVElementGeometry& fvGeometry,\n"
137 " const ElemVolVars& elemVolVars,\n"
138 " const FluxVarsCache& fluxVarsCache) const\n\n");
140 return this->
asImp_().effectivePorePressureAtPos(element.geometry().center());
159 template<
class SolidSystem,
class ElementSolution,
160 std::enable_if_t< SolidSystem::isInert() &&
161 !
decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())
162 (std::declval<Implementation>()))::value,
int > = 0 >
164 const SubControlVolume& scv,
165 const ElementSolution& elemSol,
170 template<
class SolidSystem,
class ElementSolution,
171 std::enable_if_t< !SolidSystem::isInert() ||
172 decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())
173 (std::declval<Implementation>()))::value,
int > = 0 >
175 const SubControlVolume& scv,
176 const ElementSolution& elemSol,
179 static_assert(
decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())(this->
asImp_()))::value,
" \n\n"
180 " Your spatial params class has to either implement\n\n"
181 " template<class SolidSystem>\n"
182 " Scalar inertVolumeFractionAtPos(const GlobalPosition& globalPos, int compIdx) const\n\n"
183 " or overload this function\n\n"
184 " template<class SolidSystem, class ElementSolution>\n"
185 " Scalar inertVolumeFraction(const Element& element,\n"
186 " const SubControlVolume& scv,\n"
187 " const ElementSolution& elemSol,\n"
188 " int compIdx) const\n\n");
190 return this->
asImp_().template reactiveVolumeFractionAtPos<SolidSystem>(scv.center(), compIdx);
206 template<
class ElemVolVars,
class FluxVarsCache>
208 const FVElementGeometry& fvGeometry,
209 const ElemVolVars& elemVolVars,
210 const FluxVarsCache& fluxVarsCache)
const
212 static_assert(
decltype(
isValid(Detail::hasLameParamsAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
213 " Your spatial params class has to either implement\n\n"
214 " const LameParams& lameParamsAtPos(const GlobalPosition& globalPos) const\n\n"
215 " or overload this function\n\n"
216 " template<class ElementSolution>\n"
217 " const LameParams& lameParams(const Element& element,\n"
218 " const FVElementGeometry& fvGeometry,\n"
219 " const ElemVolVars& elemVolVars,\n"
220 " const FluxVarsCache& fluxVarsCache) const\n\n");
222 return this->
asImp_().lameParamsAtPos(fluxVarsCache.ipGlobal());
238 template<
class ElemVolVars,
class FluxVarsCache>
240 const FVElementGeometry& fvGeometry,
241 const ElemVolVars& elemVolVars,
242 const FluxVarsCache& fluxVarsCache)
const
244 static_assert(
decltype(
isValid(Detail::hasBiotCoeffAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
245 " Your spatial params class has to either implement\n\n"
246 " const LameParams& biotCoefficientAtPos(const GlobalPosition& globalPos) const\n\n"
247 " or overload this function\n\n"
248 " template<class ElementSolution>\n"
249 " const LameParams& biotCoefficient(const Element& element,\n"
250 " const FVElementGeometry& fvGeometry,\n"
251 " const ElemVolVars& elemVolVars,\n"
252 " const FluxVarsCache& fluxVarsCache) const\n\n");
254 return this->
asImp_().biotCoefficientAtPos(fluxVarsCache.ipGlobal());
The base class for spatial parameters of poro-elastic geomechanical problems.
Definition: geomechanics/poroelastic/fvspatialparams.hh:76
decltype(auto) lameParams(const Element &element, const FVElementGeometry &fvGeometry, const ElemVolVars &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Define the Lame parameters.
Definition: geomechanics/poroelastic/fvspatialparams.hh:207
Scalar effectiveFluidDensity(const Element &element, const SubControlVolume &scv) const
Returns the effective fluid density within an scv.
Definition: geomechanics/poroelastic/fvspatialparams.hh:97
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: geomechanics/poroelastic/fvspatialparams.hh:163
Scalar biotCoefficient(const Element &element, const FVElementGeometry &fvGeometry, const ElemVolVars &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Returns the Biot coefficient in an element.
Definition: geomechanics/poroelastic/fvspatialparams.hh:239
FVPoroElasticSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
The constructor.
Definition: geomechanics/poroelastic/fvspatialparams.hh:86
Scalar effectivePorePressure(const Element &element, const FVElementGeometry &fvGeometry, const ElemVolVars &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Returns the effective pore pressure.
Definition: geomechanics/poroelastic/fvspatialparams.hh:125
The base class for spatial parameters of porous-medium problems.
Definition: fvporousmediumspatialparams.hh:51
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
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.