version 3.11-dev
Loading...
Searching...
No Matches
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-FileCopyrightText: 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
28template<class Scalar>
30{
31public:
55 template< class FVGridGeom, class ElemSol >
56 static Scalar evaluatePorosity(const FVGridGeom& gridGeometry,
57 const typename FVGridGeom::GridView::template Codim<0>::Entity& element,
58 const typename FVGridGeom::GridView::template Codim<0>::Entity::Geometry::GlobalCoordinate& globalPos,
59 const ElemSol& elemSol,
60 Scalar refPoro,
61 Scalar minPoro = 0.0,
62 Scalar maxPoro = 1.0)
63 {
64 // compute divergence of displacement at the given position
65 Scalar divU = 0.0;
66 const auto gradU = evalGradients(element, element.geometry(), gridGeometry, elemSol, globalPos);
67 for (int dir = 0; dir < FVGridGeom::GridView::dimension; ++dir)
68 divU += gradU[dir][dir];
69
70 using std::clamp;
71 return clamp((refPoro+divU)/(1.0+divU), minPoro, maxPoro);
72 }
73
88 template< class FVGridGeom, class ElemSol >
89 static Scalar evaluatePorosity(const FVGridGeom& gridGeometry,
90 const typename FVGridGeom::GridView::template Codim<0>::Entity& element,
91 const typename FVGridGeom::SubControlVolume& scv,
92 const ElemSol& elemSol,
93 Scalar refPoro,
94 Scalar minPoro = 0.0)
95 {
96 // evaluate the porosity at the scv center
97 return evaluatePorosity(gridGeometry, element, scv.center(), elemSol, refPoro, minPoro);
98 }
99};
100
101} // namespace Dumux
102
103#endif
A relationship for the porosity of a porous medium under mechanical deformation.
Definition porositydeformation.hh:30
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:89
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:56
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:128
Definition adapt.hh:17