version 3.10-dev
porositydeformation.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-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_MATERIAL_POROSITY_DEFORMATION_HH
13#define DUMUX_MATERIAL_POROSITY_DEFORMATION_HH
14
16
17namespace Dumux {
18
25template<class Scalar>
27{
28public:
52 template< class FVGridGeom, class ElemSol >
53 static Scalar evaluatePorosity(const FVGridGeom& gridGeometry,
54 const typename FVGridGeom::GridView::template Codim<0>::Entity& element,
55 const typename FVGridGeom::GridView::template Codim<0>::Entity::Geometry::GlobalCoordinate& globalPos,
56 const ElemSol& elemSol,
57 Scalar refPoro,
58 Scalar minPoro = 0.0,
59 Scalar maxPoro = 1.0)
60 {
61 // compute divergence of displacement at the given position
62 Scalar divU = 0.0;
63 const auto gradU = evalGradients(element, element.geometry(), gridGeometry, elemSol, globalPos);
64 for (int dir = 0; dir < FVGridGeom::GridView::dimension; ++dir)
65 divU += gradU[dir][dir];
66
67 using std::clamp;
68 return clamp((refPoro+divU)/(1.0+divU), minPoro, maxPoro);
69 }
70
85 template< class FVGridGeom, class ElemSol >
86 static Scalar evaluatePorosity(const FVGridGeom& gridGeometry,
87 const typename FVGridGeom::GridView::template Codim<0>::Entity& element,
88 const typename FVGridGeom::SubControlVolume& scv,
89 const ElemSol& elemSol,
90 Scalar refPoro,
91 Scalar minPoro = 0.0)
92 {
93 // evaluate the porosity at the scv center
94 return evaluatePorosity(gridGeometry, element, scv.center(), elemSol, refPoro, minPoro);
95 }
96};
97
98} // namespace Dumux
99
100#endif
A relationship for the porosity of a porous medium under mechanical deformation.
Definition: porositydeformation.hh:27
static Scalar evaluatePorosity(const FVGridGeom &gridGeometry, const typename FVGridGeom::GridView::template Codim< 0 >::Entity &element, const typename FVGridGeom::SubControlVolume &scv, const ElemSol &elemSol, Scalar refPoro, Scalar minPoro=0.0)
Calculates the porosity at a position inside an element.
Definition: porositydeformation.hh:86
static Scalar evaluatePorosity(const FVGridGeom &gridGeometry, const typename FVGridGeom::GridView::template Codim< 0 >::Entity &element, const typename FVGridGeom::GridView::template Codim< 0 >::Entity::Geometry::GlobalCoordinate &globalPos, const ElemSol &elemSol, Scalar refPoro, Scalar minPoro=0.0, Scalar maxPoro=1.0)
Calculates the porosity at a position inside an element.
Definition: porositydeformation.hh:53
free functions for the evaluation of primary variable gradients inside elements.
auto evalGradients(const Element &element, const typename Element::Geometry &geometry, const typename FVElementGeometry::GridGeometry &gridGeometry, const CVFEElementSolution< FVElementGeometry, PrimaryVariables > &elemSol, const typename Element::Geometry::GlobalCoordinate &globalPos, bool ignoreState=false)
Evaluates the gradient of a given CVFE element solution to a given global position.
Definition: evalgradients.hh:110
Definition: adapt.hh:17