24#ifndef DUMUX_GEOMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
25#define DUMUX_GEOMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
27#warning "This file is deprecated, use FVPoroElasticSpatialParams from dumux/geomechanics/poroelastic/fvspatialparams.hh instead!"
40template<
class GlobalPosition>
41struct hasLameParamsAtPos
43 template<
class SpatialParams>
44 auto operator()(
const SpatialParams& a)
45 ->
decltype(a.lameParamsAtPos(std::declval<GlobalPosition>()))
50template<
class GlobalPosition,
class Sol
idSystem>
51struct hasReactiveVolumeFractionAtPos
53 template<
class SpatialParams>
54 auto operator()(
const SpatialParams& a)
55 ->
decltype(a.template reactiveVolumeFractionAtPos<SolidSystem>(std::declval<GlobalPosition>(), 0))
60template<
class GlobalPosition>
61struct hasBiotCoeffAtPos
63 template<
class SpatialParams>
64 auto operator()(
const SpatialParams& a)
65 ->
decltype(a.biotCoefficientAtPos(std::declval<GlobalPosition>()))
76template<
class Scalar,
class Gr
idGeometry,
class Implementation>
78[[deprecated(
"Use FVPoroElasticSpatialParams from dumux/geomechanics/poroelastic/fvspatialparams.hh instead. This class will be removed after 3.5.")]]
81 using FVElementGeometry =
typename GridGeometry::LocalView;
82 using SubControlVolume =
typename GridGeometry::SubControlVolume;
83 using GridView =
typename GridGeometry::GridView;
84 using Element =
typename GridView::template Codim<0>::Entity;
85 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
87 enum { dimWorld = GridView::dimensionworld };
92 : gridGeometry_(gridGeometry)
95 const bool enableGravity = getParam<bool>(
"Problem.EnableGravity");
97 gravity_[dimWorld-1] = -9.81;
110 const GlobalPosition&
gravity(
const GlobalPosition &pos)
const
123 template<
class ElementSolution>
125 const SubControlVolume& scv,
126 const ElementSolution& elemSol)
const
128 static_assert(
decltype(
isValid(Detail::hasPorosityAtPos<GlobalPosition>())(this->asImp_()))::value,
" \n\n"
129 " Your spatial params class has to either implement\n\n"
130 " Scalar porosityAtPos(const GlobalPosition& globalPos) const\n\n"
131 " or overload this function\n\n"
132 " template<class ElementSolution>\n"
133 " Scalar porosity(const Element& element,\n"
134 " const SubControlVolume& scv,\n"
135 " const ElementSolution& elemSol) const\n\n");
137 return asImp_().porosityAtPos(scv.center());
156 template<
class SolidSystem,
class ElementSolution,
157 typename std::enable_if_t<SolidSystem::isInert()
158 && SolidSystem::numInertComponents == 1
159 && !
decltype(
isValid(Detail::hasInertVolumeFractionAtPos<GlobalPosition, SolidSystem>())
160 (std::declval<Implementation>()))::value,
int> = 0>
162 const SubControlVolume& scv,
163 const ElementSolution& elemSol,
165 {
return 1.0 - asImp_().porosity(element, scv, elemSol); }
168 template<
class Sol
idSystem,
class ElementSolution,
typename std::enable_if_t<Sol
idSystem::numInertComponents == 0,
int> = 0>
170 const SubControlVolume& scv,
171 const ElementSolution& elemSol,
176 template<
class SolidSystem,
class ElementSolution,
177 typename std::enable_if_t<(SolidSystem::numInertComponents > 1) ||
179 (SolidSystem::numInertComponents > 0) &&
181 !SolidSystem::isInert()
182 ||
decltype(
isValid(Detail::hasInertVolumeFractionAtPos<GlobalPosition, SolidSystem>())
183 (std::declval<Implementation>()))::value
187 const SubControlVolume& scv,
188 const ElementSolution& elemSol,
191 static_assert(
decltype(
isValid(Detail::hasInertVolumeFractionAtPos<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 asImp_().template inertVolumeFractionAtPos<SolidSystem>(scv.center(), compIdx);
219 template<
class SolidSystem,
class ElementSolution,
220 std::enable_if_t< SolidSystem::isInert() &&
221 !
decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())
222 (std::declval<Implementation>()))::value,
int > = 0 >
224 const SubControlVolume& scv,
225 const ElementSolution& elemSol,
230 template<
class SolidSystem,
class ElementSolution,
231 std::enable_if_t< !SolidSystem::isInert() ||
232 decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())
233 (std::declval<Implementation>()))::value,
int > = 0 >
235 const SubControlVolume& scv,
236 const ElementSolution& elemSol,
239 static_assert(
decltype(
isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())(this->asImp_()))::value,
" \n\n"
240 " Your spatial params class has to either implement\n\n"
241 " template<class SolidSystem>\n"
242 " Scalar inertVolumeFractionAtPos(const GlobalPosition& globalPos, int compIdx) const\n\n"
243 " or overload this function\n\n"
244 " template<class SolidSystem, class ElementSolution>\n"
245 " Scalar inertVolumeFraction(const Element& element,\n"
246 " const SubControlVolume& scv,\n"
247 " const ElementSolution& elemSol,\n"
248 " int compIdx) const\n\n");
250 return asImp_().template reactiveVolumeFractionAtPos<SolidSystem>(scv.center(), compIdx);
266 template<
class ElemVolVars,
class FluxVarsCache>
268 const FVElementGeometry& fvGeometry,
269 const ElemVolVars& elemVolVars,
270 const FluxVarsCache& fluxVarsCache)
const
272 static_assert(
decltype(
isValid(Detail::hasLameParamsAtPos<GlobalPosition>())(this->asImp_()))::value,
" \n\n"
273 " Your spatial params class has to either implement\n\n"
274 " const LameParams& lameParamsAtPos(const GlobalPosition& globalPos) const\n\n"
275 " or overload this function\n\n"
276 " template<class ElementSolution>\n"
277 " const LameParams& lameParams(const Element& element,\n"
278 " const FVElementGeometry& fvGeometry,\n"
279 " const ElemVolVars& elemVolVars,\n"
280 " const FluxVarsCache& fluxVarsCache) const\n\n");
282 return asImp_().lameParamsAtPos(fluxVarsCache.ipGlobal());
298 template<
class ElemVolVars,
class FluxVarsCache>
300 const FVElementGeometry& fvGeometry,
301 const ElemVolVars& elemVolVars,
302 const FluxVarsCache& fluxVarsCache)
const
304 static_assert(
decltype(
isValid(Detail::hasBiotCoeffAtPos<GlobalPosition>())(this->asImp_()))::value,
" \n\n"
305 " Your spatial params class has to either implement\n\n"
306 " const LameParams& biotCoefficientAtPos(const GlobalPosition& globalPos) const\n\n"
307 " or overload this function\n\n"
308 " template<class ElementSolution>\n"
309 " const LameParams& biotCoefficient(const Element& element,\n"
310 " const FVElementGeometry& fvGeometry,\n"
311 " const ElemVolVars& elemVolVars,\n"
312 " const FluxVarsCache& fluxVarsCache) const\n\n");
314 return asImp_().biotCoefficientAtPos(fluxVarsCache.ipGlobal());
319 {
return *gridGeometry_; }
323 {
return *
static_cast<Implementation*
>(
this); }
326 {
return *
static_cast<const Implementation*
>(
this); }
329 std::shared_ptr<const GridGeometry> gridGeometry_;
330 GlobalPosition gravity_;
A helper function for class member function introspection.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
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
The base class for spatial parameters of poro-elastic geomechanical problems.
Definition: fvporoelastic.hh:80
const GlobalPosition & gravity(const GlobalPosition &pos) const
Returns the acceleration due to gravity .
Definition: fvporoelastic.hh:110
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fvporoelastic.hh:318
const Implementation & asImp_() const
Definition: fvporoelastic.hh:325
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: fvporoelastic.hh:223
Scalar inertVolumeFraction(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol, int compIdx) const
Function for defining the solid volume fraction. That is possibly solution dependent.
Definition: fvporoelastic.hh:161
decltype(auto) lameParams(const Element &element, const FVElementGeometry &fvGeometry, const ElemVolVars &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Define the Lame parameters.
Definition: fvporoelastic.hh:267
Scalar porosity(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the porosity. That is possibly solution dependent.
Definition: fvporoelastic.hh:124
Scalar biotCoefficient(const Element &element, const FVElementGeometry &fvGeometry, const ElemVolVars &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Returns the Biot coefficient in an element.
Definition: fvporoelastic.hh:299
Implementation & asImp_()
Definition: fvporoelastic.hh:322
FVSpatialParamsPoroElastic(std::shared_ptr< const GridGeometry > gridGeometry)
The constructor.
Definition: fvporoelastic.hh:91