version 3.10.0
Loading...
Searching...
No Matches
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//
12#ifndef DUMUX_POROMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
13#define DUMUX_POROMECHANICS_POROELASTIC_FV_SPATIAL_PARAMS_HH
14
15#include <memory>
16#include <utility>
17
20
21#include "spatialparamstraits_.hh"
22
23namespace Dumux {
24
29template<class GridGeometry, class Scalar, class Implementation>
31: public FVPorousMediumSpatialParams<GridGeometry, Scalar, Implementation>
32{
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;
39
40public:
42 FVPoroElasticSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
43 : ParentType(gridGeometry)
44 {}
45
53 Scalar effectiveFluidDensity(const Element& element,
54 const SubControlVolume& scv) const
55 {
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");
63
64 return this->asImp_().effectiveFluidDensityAtPos(scv.center());
65 }
66
80 template<class ElemVolVars, class FluxVarsCache>
81 Scalar effectivePorePressure(const Element& element,
82 const FVElementGeometry& fvGeometry,
83 const ElemVolVars& elemVolVars,
84 const FluxVarsCache& fluxVarsCache) const
85 {
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");
95
96 return this->asImp_().effectivePorePressureAtPos(element.geometry().center());
97 }
98
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 >
119 Scalar reactiveVolumeFraction(const Element& element,
120 const SubControlVolume& scv,
121 const ElementSolution& elemSol,
122 int compIdx) const
123 { return 0.0; }
124
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 >
130 Scalar reactiveVolumeFraction(const Element& element,
131 const SubControlVolume& scv,
132 const ElementSolution& elemSol,
133 int compIdx) const
134 {
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");
145
146 return this->asImp_().template reactiveVolumeFractionAtPos<SolidSystem>(scv.center(), compIdx);
147 }
148
162 template<class ElemVolVars, class FluxVarsCache>
163 decltype(auto) lameParams(const Element& element,
164 const FVElementGeometry& fvGeometry,
165 const ElemVolVars& elemVolVars,
166 const FluxVarsCache& fluxVarsCache) const
167 {
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");
177
178 return this->asImp_().lameParamsAtPos(fluxVarsCache.ipGlobal());
179 }
180
194 template<class ElemVolVars, class FluxVarsCache>
195 Scalar biotCoefficient(const Element& element,
196 const FVElementGeometry& fvGeometry,
197 const ElemVolVars& elemVolVars,
198 const FluxVarsCache& fluxVarsCache) const
199 {
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");
209
210 return this->asImp_().biotCoefficientAtPos(fluxVarsCache.ipGlobal());
211 }
212};
213
214} // end namespace Dumux
215
216#endif
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.
Definition adapt.hh:17