version 3.10-dev
porosityprecipitation.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_POROSITY_PRECIPITATION_HH
13#define DUMUX_POROSITY_PRECIPITATION_HH
14
16
17namespace Dumux {
18
27template<class Scalar, int numComp, int numSolidPhases>
29{
30public:
39 template<class Element, class SubControlVolume, class ElemSol>
40 Scalar evaluatePorosity(const Element& element,
41 const SubControlVolume& scv,
42 const ElemSol& elemSol,
43 Scalar refPoro,
44 Scalar minPoro = 0.0) const
45 {
46 auto priVars = evalSolution(element, element.geometry(), elemSol, scv.center());
47
48 Scalar sumPrecipitates = 0.0;
49 for (unsigned int solidPhaseIdx = 0; solidPhaseIdx < numSolidPhases; ++solidPhaseIdx)
50 sumPrecipitates += priVars[numComp + solidPhaseIdx];
51
52 using std::max;
53 return max(minPoro, refPoro - sumPrecipitates);
54 }
55};
56
57} // namespace Dumux
58
59#endif
Calculates the porosity depending on the volume fractions of precipitated minerals.
Definition: porosityprecipitation.hh:29
Scalar evaluatePorosity(const Element &element, const SubControlVolume &scv, const ElemSol &elemSol, Scalar refPoro, Scalar minPoro=0.0) const
Calculates the porosity in a sub-control volume.
Definition: porosityprecipitation.hh:40
free functions for the evaluation of primary variables inside elements.
PrimaryVariables evalSolution(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)
Interpolates a given box element solution at a given global position. Uses the finite element cache o...
Definition: evalsolution.hh:152
Definition: adapt.hh:17