12#ifndef DUMUX_POROSITY_PRECIPITATION_HH
13#define DUMUX_POROSITY_PRECIPITATION_HH
27template<
class Scalar,
int numComp,
int numSol
idPhases>
39 template<
class Element,
class SubControlVolume,
class ElemSol>
41 const SubControlVolume& scv,
42 const ElemSol& elemSol,
44 Scalar minPoro = 0.0)
const
46 auto priVars =
evalSolution(element, element.geometry(), elemSol, scv.center());
48 Scalar sumPrecipitates = 0.0;
49 for (
unsigned int solidPhaseIdx = 0; solidPhaseIdx < numSolidPhases; ++solidPhaseIdx)
50 sumPrecipitates += priVars[numComp + solidPhaseIdx];
53 return max(minPoro, refPoro - sumPrecipitates);
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