3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
updatesolidvolumefractions.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_UPDATE_SOLID_VOLUME_FRACTION_HH
25#define DUMUX_UPDATE_SOLID_VOLUME_FRACTION_HH
26
27namespace Dumux {
28
35template<class ElemSol, class Problem, class Element, class Scv, class SolidState>
36void updateSolidVolumeFractions(const ElemSol& elemSol,
37 const Problem& problem,
38 const Element& element,
39 const Scv& scv,
40 SolidState& solidState,
41 const int solidVolFracOffset)
42{
43 for (int sCompIdx = solidState.numComponents-solidState.numInertComponents; sCompIdx < solidState.numComponents; ++sCompIdx)
44 {
45 const auto& sp = problem.spatialParams();
46 using SolidSystem = typename SolidState::SolidSystem;
47 const auto inertVolumeFraction = sp.template inertVolumeFraction<SolidSystem>(element, scv, elemSol, sCompIdx);
48 solidState.setVolumeFraction(sCompIdx, inertVolumeFraction);
49 }
50
51 if (!(solidState.isInert()))
52 {
53 auto&& priVars = elemSol[scv.localDofIndex()];
54 for (int sCompIdx = 0; sCompIdx < solidState.numComponents- solidState.numInertComponents; ++sCompIdx)
55 solidState.setVolumeFraction(sCompIdx, priVars[solidVolFracOffset + sCompIdx]);
56 }
57}
58
59} // end namespace Dumux
60
61#endif
void updateSolidVolumeFractions(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, SolidState &solidState, const int solidVolFracOffset)
update the solid volume fractions (inert and reacitve) and set them in the solidstate
Definition: updatesolidvolumefractions.hh:36
Definition: adapt.hh:29