24#ifndef DUMUX_GEOMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
25#define DUMUX_GEOMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
31#include <dumux/geomechanics/spatialparamstraits_.hh>
39template<
class GlobalPosition>
40struct hasEffFluidDensityAtPos
42 template<
class Problem>
43 auto operator()(
const Problem& a)
44 ->
decltype(a.effectiveFluidDensityAtPos(std::declval<GlobalPosition>()))
49template<
class GlobalPosition>
50struct hasEffPorePressureAtPos
52 template<
class Problem>
53 auto operator()(
const Problem& a)
54 ->
decltype(a.effectivePorePressureAtPos(std::declval<GlobalPosition>()))
59template<
class GlobalPosition,
class Sol
idSystem>
60struct hasReactiveVolumeFractionAtPos
62 template<
class SpatialParams>
63 auto operator()(
const SpatialParams& a)
64 ->
decltype(a.template reactiveVolumeFractionAtPos<SolidSystem>(std::declval<GlobalPosition>(), 0))
69template<
class GlobalPosition>
70struct hasBiotCoeffAtPos
72 template<
class SpatialParams>
73 auto operator()(
const SpatialParams& a)
74 ->
decltype(a.biotCoefficientAtPos(std::declval<GlobalPosition>()))
85template<
class Gr
idGeometry,
class Scalar,
class Implementation>
90 using FVElementGeometry =
typename GridGeometry::LocalView;
91 using SubControlVolume =
typename GridGeometry::SubControlVolume;
92 using GridView =
typename GridGeometry::GridView;
93 using Element =
typename GridView::template Codim<0>::Entity;
94 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
110 const SubControlVolume& scv)
const
112 static_assert(
decltype(
isValid(Detail::hasEffFluidDensityAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
113 " Your problem class has to either implement\n\n"
114 " Scalar effectiveFluidDensityAtPos(const GlobalPosition& globalPos) const\n\n"
115 " or overload this function\n\n"
116 " template<class ElementSolution>\n"
117 " Scalar effectiveFluidDensity(const Element& element,\n\
118 const SubControlVolume& scv) const\n\n");
120 return this->
asImp_().effectiveFluidDensityAtPos(scv.center());
136 template<
class ElemVolVars,
class FluxVarsCache>
138 const FVElementGeometry& fvGeometry,
139 const ElemVolVars& elemVolVars,
140 const FluxVarsCache& fluxVarsCache)
const
142 static_assert(
decltype(
isValid(Detail::hasEffPorePressureAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
143 " Your problem class has to either implement\n\n"
144 " Scalar effectivePorePressureAtPos(const GlobalPosition& globalPos) const\n\n"
145 " or overload this function\n\n"
146 " template<class ElementSolution>\n"
147 " Scalar effectivePorePressure(const Element& element,\n"
148 " const FVElementGeometry& fvGeometry,\n"
149 " const ElemVolVars& elemVolVars,\n"
150 " const FluxVarsCache& fluxVarsCache) const\n\n");
152 return this->
asImp_().effectivePorePressureAtPos(element.geometry().center());
171 template<
class SolidSystem,
class ElementSolution,
172 std::enable_if_t< SolidSystem::isInert() &&
173 !
decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())
174 (std::declval<Implementation>()))::value,
int > = 0 >
176 const SubControlVolume& scv,
177 const ElementSolution& elemSol,
182 template<
class SolidSystem,
class ElementSolution,
183 std::enable_if_t< !SolidSystem::isInert() ||
184 decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())
185 (std::declval<Implementation>()))::value,
int > = 0 >
187 const SubControlVolume& scv,
188 const ElementSolution& elemSol,
191 static_assert(
decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())(this->
asImp_()))::value,
" \n\n"
192 " Your spatial params class has to either implement\n\n"
193 " template<class SolidSystem>\n"
194 " Scalar inertVolumeFractionAtPos(const GlobalPosition& globalPos, int compIdx) const\n\n"
195 " or overload this function\n\n"
196 " template<class SolidSystem, class ElementSolution>\n"
197 " Scalar inertVolumeFraction(const Element& element,\n"
198 " const SubControlVolume& scv,\n"
199 " const ElementSolution& elemSol,\n"
200 " int compIdx) const\n\n");
202 return this->
asImp_().template reactiveVolumeFractionAtPos<SolidSystem>(scv.center(), compIdx);
218 template<
class ElemVolVars,
class FluxVarsCache>
220 const FVElementGeometry& fvGeometry,
221 const ElemVolVars& elemVolVars,
222 const FluxVarsCache& fluxVarsCache)
const
224 static_assert(
decltype(
isValid(Detail::hasLameParamsAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
225 " Your spatial params class has to either implement\n\n"
226 " const LameParams& lameParamsAtPos(const GlobalPosition& globalPos) const\n\n"
227 " or overload this function\n\n"
228 " template<class ElementSolution>\n"
229 " const LameParams& lameParams(const Element& element,\n"
230 " const FVElementGeometry& fvGeometry,\n"
231 " const ElemVolVars& elemVolVars,\n"
232 " const FluxVarsCache& fluxVarsCache) const\n\n");
234 return this->
asImp_().lameParamsAtPos(fluxVarsCache.ipGlobal());
250 template<
class ElemVolVars,
class FluxVarsCache>
252 const FVElementGeometry& fvGeometry,
253 const ElemVolVars& elemVolVars,
254 const FluxVarsCache& fluxVarsCache)
const
256 static_assert(
decltype(
isValid(Detail::hasBiotCoeffAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
257 " Your spatial params class has to either implement\n\n"
258 " const LameParams& biotCoefficientAtPos(const GlobalPosition& globalPos) const\n\n"
259 " or overload this function\n\n"
260 " template<class ElementSolution>\n"
261 " const LameParams& biotCoefficient(const Element& element,\n"
262 " const FVElementGeometry& fvGeometry,\n"
263 " const ElemVolVars& elemVolVars,\n"
264 " const FluxVarsCache& fluxVarsCache) const\n\n");
266 return this->
asImp_().biotCoefficientAtPos(fluxVarsCache.ipGlobal());
A helper function for class member function introspection.
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: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 poro-elastic geomechanical problems.
Definition: geomechanics/poroelastic/fvspatialparams.hh:88
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:219
Scalar effectiveFluidDensity(const Element &element, const SubControlVolume &scv) const
Returns the effective fluid density within an scv.
Definition: geomechanics/poroelastic/fvspatialparams.hh:109
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:175
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:251
FVPoroElasticSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
The constructor.
Definition: geomechanics/poroelastic/fvspatialparams.hh:98
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:137