version 3.10-dev
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// 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_UPDATE_SOLID_VOLUME_FRACTION_HH
13#define DUMUX_UPDATE_SOLID_VOLUME_FRACTION_HH
14
15namespace Dumux {
16
23template<class ElemSol, class Problem, class Element, class Scv, class SolidState>
24void updateSolidVolumeFractions(const ElemSol& elemSol,
25 const Problem& problem,
26 const Element& element,
27 const Scv& scv,
28 SolidState& solidState,
29 const int solidVolFracOffset)
30{
31 for (int sCompIdx = solidState.numComponents-solidState.numInertComponents; sCompIdx < solidState.numComponents; ++sCompIdx)
32 {
33 const auto& sp = problem.spatialParams();
34 using SolidSystem = typename SolidState::SolidSystem;
35 const auto inertVolumeFraction = sp.template inertVolumeFraction<SolidSystem>(element, scv, elemSol, sCompIdx);
36 solidState.setVolumeFraction(sCompIdx, inertVolumeFraction);
37 }
38
39 if (!(solidState.isInert()))
40 {
41 auto&& priVars = elemSol[scv.localDofIndex()];
42 for (int sCompIdx = 0; sCompIdx < solidState.numComponents- solidState.numInertComponents; ++sCompIdx)
43 solidState.setVolumeFraction(sCompIdx, priVars[solidVolFracOffset + sCompIdx]);
44 }
45}
46
47} // end namespace Dumux
48
49#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:24
Definition: adapt.hh:17