3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_POROSITY_PRECIPITATION_HH
25#define DUMUX_POROSITY_PRECIPITATION_HH
26
28
29namespace Dumux {
30
39template<class Scalar, int numComp, int numSolidPhases>
41{
42public:
51 template<class Element, class SubControlVolume, class ElemSol>
52 Scalar evaluatePorosity(const Element& element,
53 const SubControlVolume& scv,
54 const ElemSol& elemSol,
55 Scalar refPoro,
56 Scalar minPoro = 0.0) const
57 {
58 auto priVars = evalSolution(element, element.geometry(), elemSol, scv.center());
59
60 Scalar sumPrecipitates = 0.0;
61 for (unsigned int solidPhaseIdx = 0; solidPhaseIdx < numSolidPhases; ++solidPhaseIdx)
62 sumPrecipitates += priVars[numComp + solidPhaseIdx];
63
64 using std::max;
65 return max(minPoro, refPoro - sumPrecipitates);
66 }
67};
68
69} // namespace Dumux
70
71#endif
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 BoxElementSolution< 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:165
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
Calculates the porosity depending on the volume fractions of precipitated minerals.
Definition: porosityprecipitation.hh:41
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:52