version 3.11-dev
poromechanics/poroelastic/fvspatialparams.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_POROMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
14#define DUMUX_POROMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
15
16#include <memory>
17#include <utility>
18
21
22#include "spatialparamstraits_.hh"
23
24namespace Dumux {
25
31template<class GridGeometry, class Scalar, class Implementation>
33: public FVPorousMediumSpatialParams<GridGeometry, Scalar, Implementation>
34{
36 using FVElementGeometry = typename GridGeometry::LocalView;
37 using SubControlVolume = typename GridGeometry::SubControlVolume;
38 using GridView = typename GridGeometry::GridView;
39 using Element = typename GridView::template Codim<0>::Entity;
40 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
41
42public:
44 FVPoroElasticSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
46 {}
47
55 Scalar effectiveFluidDensity(const Element& element,
56 const SubControlVolume& scv) const
57 {
58 static_assert(decltype(isValid(Detail::hasEffFluidDensityAtPos<GlobalPosition>())(this->asImp_()))::value," \n\n"
59 " Your problem class has to either implement\n\n"
60 " Scalar effectiveFluidDensityAtPos(const GlobalPosition& globalPos) const\n\n"
61 " or overload this function\n\n"
62 " template<class ElementSolution>\n"
63 " Scalar effectiveFluidDensity(const Element& element,\n\
64 const SubControlVolume& scv) const\n\n");
65
66 return this->asImp_().effectiveFluidDensityAtPos(scv.center());
67 }
68
82 template<class ElemVolVars, class FluxVarsCache>
83 Scalar effectivePorePressure(const Element& element,
84 const FVElementGeometry& fvGeometry,
85 const ElemVolVars& elemVolVars,
86 const FluxVarsCache& fluxVarsCache) const
87 {
88 static_assert(decltype(isValid(Detail::hasEffPorePressureAtPos<GlobalPosition>())(this->asImp_()))::value," \n\n"
89 " Your problem class has to either implement\n\n"
90 " Scalar effectivePorePressureAtPos(const GlobalPosition& globalPos) const\n\n"
91 " or overload this function\n\n"
92 " template<class ElementSolution>\n"
93 " Scalar effectivePorePressure(const Element& element,\n"
94 " const FVElementGeometry& fvGeometry,\n"
95 " const ElemVolVars& elemVolVars,\n"
96 " const FluxVarsCache& fluxVarsCache) const\n\n");
97
98 return this->asImp_().effectivePorePressureAtPos(element.geometry().center());
99 }
100
117 template<class SolidSystem, class ElementSolution,
118 std::enable_if_t< SolidSystem::isInert() &&
119 !decltype(isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())
120 (std::declval<Implementation>()))::value, int > = 0 >
121 Scalar reactiveVolumeFraction(const Element& element,
122 const SubControlVolume& scv,
123 const ElementSolution& elemSol,
124 int compIdx) const
125 { return 0.0; }
126
128 template<class SolidSystem, class ElementSolution,
129 std::enable_if_t< !SolidSystem::isInert() ||
130 decltype(isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())
131 (std::declval<Implementation>()))::value, int > = 0 >
132 Scalar reactiveVolumeFraction(const Element& element,
133 const SubControlVolume& scv,
134 const ElementSolution& elemSol,
135 int compIdx) const
136 {
137 static_assert(decltype(isValid(Detail::hasReactiveVolumeFractionAtPos<GlobalPosition, SolidSystem>())(this->asImp_()))::value," \n\n"
138 " Your spatial params class has to either implement\n\n"
139 " template<class SolidSystem>\n"
140 " Scalar inertVolumeFractionAtPos(const GlobalPosition& globalPos, int compIdx) const\n\n"
141 " or overload this function\n\n"
142 " template<class SolidSystem, class ElementSolution>\n"
143 " Scalar inertVolumeFraction(const Element& element,\n"
144 " const SubControlVolume& scv,\n"
145 " const ElementSolution& elemSol,\n"
146 " int compIdx) const\n\n");
147
148 return this->asImp_().template reactiveVolumeFractionAtPos<SolidSystem>(scv.center(), compIdx);
149 }
150
164 template<class ElemVolVars, class FluxVarsCache>
165 decltype(auto) lameParams(const Element& element,
166 const FVElementGeometry& fvGeometry,
167 const ElemVolVars& elemVolVars,
168 const FluxVarsCache& fluxVarsCache) const
169 {
170 static_assert(decltype(isValid(Detail::hasLameParamsAtPos<GlobalPosition>())(this->asImp_()))::value," \n\n"
171 " Your spatial params class has to either implement\n\n"
172 " const LameParams& lameParamsAtPos(const GlobalPosition& globalPos) const\n\n"
173 " or overload this function\n\n"
174 " template<class ElementSolution>\n"
175 " const LameParams& lameParams(const Element& element,\n"
176 " const FVElementGeometry& fvGeometry,\n"
177 " const ElemVolVars& elemVolVars,\n"
178 " const FluxVarsCache& fluxVarsCache) const\n\n");
179
180 return this->asImp_().lameParamsAtPos(fluxVarsCache.ipGlobal());
181 }
182
196 template<class ElemVolVars, class FluxVarsCache>
197 Scalar biotCoefficient(const Element& element,
198 const FVElementGeometry& fvGeometry,
199 const ElemVolVars& elemVolVars,
200 const FluxVarsCache& fluxVarsCache) const
201 {
202 static_assert(decltype(isValid(Detail::hasBiotCoeffAtPos<GlobalPosition>())(this->asImp_()))::value," \n\n"
203 " Your spatial params class has to either implement\n\n"
204 " const LameParams& biotCoefficientAtPos(const GlobalPosition& globalPos) const\n\n"
205 " or overload this function\n\n"
206 " template<class ElementSolution>\n"
207 " const LameParams& biotCoefficient(const Element& element,\n"
208 " const FVElementGeometry& fvGeometry,\n"
209 " const ElemVolVars& elemVolVars,\n"
210 " const FluxVarsCache& fluxVarsCache) const\n\n");
211
212 return this->asImp_().biotCoefficientAtPos(fluxVarsCache.ipGlobal());
213 }
214};
215
216} // end namespace Dumux
217
218#endif
The base class for spatial parameters of poro-elastic geomechanical problems.
Definition: poromechanics/poroelastic/fvspatialparams.hh:34
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:165
Scalar effectiveFluidDensity(const Element &element, const SubControlVolume &scv) const
Returns the effective fluid density within an scv.
Definition: poromechanics/poroelastic/fvspatialparams.hh:55
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:121
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:197
FVPoroElasticSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
The constructor.
Definition: poromechanics/poroelastic/fvspatialparams.hh:44
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:83
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:166
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvspatialparams.hh:161
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.
Definition: adapt.hh:17