From cbbe5ba6a10ff874b86f350758bb22e282443c49 Mon Sep 17 00:00:00 2001 From: Simon Scholz <simon.scholz@iws.uni-stuttgart.de> Date: Thu, 7 Dec 2017 15:24:29 +0100 Subject: [PATCH] [min] delete/cleanup of deprecated 2pncmin files + localresidualmin.hh --- .../2pncmin/implicit/CMakeLists.txt | 6 - .../2pncmin/implicit/localresidual.hh | 95 --------- .../2pncmin/implicit/properties.hh | 87 -------- .../2pncmin/implicit/volumevariables.hh | 200 ------------------ .../2pncmin/implicit/vtkoutputfields.hh | 61 ------ .../compositional/localresidualmin.hh | 127 ----------- 6 files changed, 576 deletions(-) delete mode 100644 dumux/porousmediumflow/2pncmin/implicit/localresidual.hh delete mode 100644 dumux/porousmediumflow/2pncmin/implicit/properties.hh delete mode 100644 dumux/porousmediumflow/2pncmin/implicit/volumevariables.hh delete mode 100644 dumux/porousmediumflow/2pncmin/implicit/vtkoutputfields.hh delete mode 100644 dumux/porousmediumflow/compositional/localresidualmin.hh diff --git a/dumux/porousmediumflow/2pncmin/implicit/CMakeLists.txt b/dumux/porousmediumflow/2pncmin/implicit/CMakeLists.txt index cab7236a26..46ffae2a1d 100644 --- a/dumux/porousmediumflow/2pncmin/implicit/CMakeLists.txt +++ b/dumux/porousmediumflow/2pncmin/implicit/CMakeLists.txt @@ -1,11 +1,5 @@ #install headers install(FILES -fluxvariables.hh -indices.hh -localresidual.hh model.hh -properties.hh -propertydefaults.hh -volumevariables.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/porousmediumflow/2pncmin/implicit) diff --git a/dumux/porousmediumflow/2pncmin/implicit/localresidual.hh b/dumux/porousmediumflow/2pncmin/implicit/localresidual.hh deleted file mode 100644 index 01dce822d5..0000000000 --- a/dumux/porousmediumflow/2pncmin/implicit/localresidual.hh +++ /dev/null @@ -1,95 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * - * \brief Element-wise calculation of the local residual for problems - * using the two-phase n-component mineralisation box model. - */ - -#ifndef DUMUX_2PNCMIN_LOCAL_RESIDUAL_HH -#define DUMUX_2PNCMIN_LOCAL_RESIDUAL_HH - -#include "properties.hh" -#include <dumux/porousmediumflow/compositional/localresidual.hh> - -namespace Dumux -{ -/*! - * \ingroup TwoPNCMinModel - * \ingroup ImplicitLocalResidual - * \brief Element-wise calculation of the local residual for problems - * using the two-phase n-component mineralization fully implicit model. - * - * This class is used to fill the gaps in ImplicitLocalResidual for the two-phase n-component flow. - */ -template<class TypeTag> -class TwoPNCMinLocalResidual : public CompositionalLocalResidual<TypeTag> -{ - using ParentType = CompositionalLocalResidual<TypeTag>; - using ThisType = TwoPNCMinLocalResidual<TypeTag>; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - - enum - { - numPhases = GET_PROP_VALUE(TypeTag, NumPhases), - numSPhases = GET_PROP_VALUE(TypeTag, NumSPhases), - numComponents = GET_PROP_VALUE(TypeTag, NumComponents), - - conti0EqIdx = Indices::conti0EqIdx - }; - -public: - using ParentType::ParentType; - /*! - * \brief Evaluate the amount all conservation quantities - * (e.g. phase mass) within a sub-control volume. - * - * The result should be averaged over the volume (e.g. phase mass - * inside a sub control volume divided by the volume). - * In contrast to the 2pnc model, here, the storage of solid phases is included too. - * - * \param scv the SCV (sub-control-volume) - * \param volVars The volume variables of the right time step - */ - PrimaryVariables computeStorage(const Problem& problem, - const SubControlVolume& scv, - const VolumeVariables& volVars) const - { - // call parenttype function - auto storage = ParentType::computeStorage(problem, scv, volVars); - - // Compute storage term of all solid (precipitated) phases (excluding the non-reactive matrix) - for (int phaseIdx = numPhases; phaseIdx < numPhases + numSPhases; ++phaseIdx) - { - auto eqIdx = conti0EqIdx + numComponents-numPhases + phaseIdx; - storage[eqIdx] += volVars.precipitateVolumeFraction(phaseIdx)*volVars.molarDensity(phaseIdx); - } - - return storage; - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/2pncmin/implicit/properties.hh b/dumux/porousmediumflow/2pncmin/implicit/properties.hh deleted file mode 100644 index 49ebff63c3..0000000000 --- a/dumux/porousmediumflow/2pncmin/implicit/properties.hh +++ /dev/null @@ -1,87 +0,0 @@ -// -**- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \ingroup Properties - * \ingroup ImplicitProperties - * \ingroup TwoPNCMinModel - * - * \file - * - * \brief Defines the properties required for the two-phase n-component mineralization - * fully implicit model. - */ -#ifndef DUMUX_2PNCMIN_PROPERTIES_HH -#define DUMUX_2PNCMIN_PROPERTIES_HH - -#include <dumux/porousmediumflow/2pnc/implicit/properties.hh> - -#include "volumevariables.hh" -#include "vtkoutputfields.hh" -#include "localresidual.hh" - -namespace Dumux -{ - -namespace Properties -{ -////////////////////////////////////////////////////////////////// -// Type tags -////////////////////////////////////////////////////////////////// -NEW_TYPE_TAG(TwoPNCMin, INHERITS_FROM(TwoPNC)); -NEW_TYPE_TAG(TwoPNCMinNI, INHERITS_FROM(TwoPNCMin, TwoPNCNI, NonIsothermal)); - -////////////////////////////////////////////////////////////////// -// Property tags for the isothermal 2pncmin model -////////////////////////////////////////////////////////////////// - -SET_TYPE_PROP(TwoPNCMin, VolumeVariables, TwoPNCMinVolumeVariables<TypeTag>); //! the VolumeVariables property -SET_TYPE_PROP(TwoPNCMin, VtkOutputFields, TwoPNCMinVtkOutputFields<TypeTag>); //! Set the vtk output fields specific to the TwoPNCMin model -SET_TYPE_PROP(TwoPNCMin, LocalResidual, TwoPNCMinLocalResidual<TypeTag>); //! Use the compositional local residual - -//! Set the property for the number of solid phases, excluding the non-reactive matrix. -SET_PROP(TwoPNCMin, NumSPhases) -{ -private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)); - -public: - static const int value = FluidSystem::numSPhases; -}; - -//! Set the property for the number of equations. For each component and each -//precipitated mineral/solid phase one equation has to be solved. - -SET_PROP(TwoPNCMin, NumEq) -{ -private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)); - -public: - static const int value = FluidSystem::numComponents + FluidSystem::numSPhases; -}; -///////////////////////////////////////////////// -// Properties for the non-isothermal 2pncmin model -///////////////////////////////////////////////// -SET_TYPE_PROP(TwoPNCMinNI, IsothermalVolumeVariables, TwoPNCMinVolumeVariables<TypeTag>); //! set isothermal VolumeVariables -SET_TYPE_PROP(TwoPNCMinNI, IsothermalVtkOutputFields, TwoPNCMinVtkOutputFields<TypeTag>); //! set isothermal output fields - -} -} - -#endif diff --git a/dumux/porousmediumflow/2pncmin/implicit/volumevariables.hh b/dumux/porousmediumflow/2pncmin/implicit/volumevariables.hh deleted file mode 100644 index 2a6bc33a3a..0000000000 --- a/dumux/porousmediumflow/2pncmin/implicit/volumevariables.hh +++ /dev/null @@ -1,200 +0,0 @@ -// -**- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * - * \brief Contains the quantities which are constant within a - * finite volume in the two-phase, n-component mineralization model. - */ -#ifndef DUMUX_2PNCMIN_VOLUME_VARIABLES_HH -#define DUMUX_2PNCMIN_VOLUME_VARIABLES_HH - -#include <dumux/common/math.hh> - -#include <dumux/material/fluidstates/compositional.hh> -#include <dumux/discretization/volumevariables.hh> -#include <dumux/porousmediumflow/2pnc/implicit/volumevariables.hh> - -#include "properties.hh" - -namespace Dumux -{ - -/*! - * \ingroup TwoPNCMinModel - * \ingroup ImplicitVolumeVariables - * \brief Contains the quantities which are are constant within a - * finite volume in the two-phase, n-component model. - */ -template <class TypeTag> -class TwoPNCMinVolumeVariables : public TwoPNCVolumeVariables<TypeTag> -{ - // base type is used for energy related quantities - using BaseType = ImplicitVolumeVariables<TypeTag>; - - using ParentType = TwoPNCVolumeVariables<TypeTag>; - using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Grid = typename GET_PROP_TYPE(TypeTag, Grid); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); - using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); - using ElementSolutionVector = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw); - using MaterialLawParams = typename GET_PROP_TYPE(TypeTag, MaterialLaw)::Params; - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - - enum - { - dim = GridView::dimension, - dimWorld=GridView::dimensionworld, - - numPhases = GET_PROP_VALUE(TypeTag, NumPhases), - numSPhases = GET_PROP_VALUE(TypeTag, NumSPhases), - numComponents = GET_PROP_VALUE(TypeTag, NumComponents), - numMajorComponents = GET_PROP_VALUE(TypeTag, NumMajorComponents), - - // formulations - formulation = GET_PROP_VALUE(TypeTag, Formulation), - pwsn = TwoPNCFormulation::pwsn, - pnsw = TwoPNCFormulation::pnsw, - - // phase indices - wPhaseIdx = FluidSystem::wPhaseIdx, - nPhaseIdx = FluidSystem::nPhaseIdx, - - // component indices - wCompIdx = FluidSystem::wCompIdx, - nCompIdx = FluidSystem::nCompIdx, - - // phase presence enums - nPhaseOnly = Indices::nPhaseOnly, - wPhaseOnly = Indices::wPhaseOnly, - bothPhases = Indices::bothPhases, - - // primary variable indices - pressureIdx = Indices::pressureIdx, - switchIdx = Indices::switchIdx, - - }; - - using Element = typename GridView::template Codim<0>::Entity; - using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; - using CoordScalar = typename Grid::ctype; - using Miscible2pNCComposition = Dumux::Miscible2pNCComposition<Scalar, FluidSystem>; - using ComputeFromReferencePhase = Dumux::ComputeFromReferencePhase<Scalar, FluidSystem>; - -public: - - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); - - /*! - * \copydoc ImplicitVolumeVariables::update - */ - void update(const ElementSolutionVector &elemSol, - const Problem &problem, - const Element &element, - const SubControlVolume& scv) - { - // Update parent type (also completes the fluid state) - ParentType::update(elemSol, problem, element, scv); - - ///////////// - // calculate the remaining quantities - ///////////// - auto&& priVars = elemSol[scv.indexInElement()]; - - sumPrecipitates_ = 0.0; - for(int sPhaseIdx = 0; sPhaseIdx < numSPhases; ++sPhaseIdx) - { - precipitateVolumeFraction_[sPhaseIdx] = priVars[numComponents + sPhaseIdx]; - sumPrecipitates_+= precipitateVolumeFraction_[sPhaseIdx]; - } - } - - /*! - * \brief Returns the volume fraction of the precipitate (solid phase) - * for the given phaseIdx - * - * \param phaseIdx the index of the solid phase - */ - Scalar precipitateVolumeFraction(int phaseIdx) const - { return precipitateVolumeFraction_[phaseIdx - numPhases]; } - - /*! - * \brief Returns the density of the phase for all fluid and solid phases - * - * \param phaseIdx the index of the fluid phase - */ - Scalar density(int phaseIdx) const - { - if (phaseIdx < numPhases) - return this->fluidState_.density(phaseIdx); - else - return FluidSystem::precipitateDensity(phaseIdx); - } - /*! - * \brief Returns the mass density of a given phase within the - * control volume. - * - * \param phaseIdx The phase index - */ - Scalar molarDensity(int phaseIdx) const - { - if (phaseIdx < numPhases) - return this->fluidState_.molarDensity(phaseIdx); - else - return FluidSystem::precipitateMolarDensity(phaseIdx); - } - - /*! - * \brief Returns the molality of a component in the phase - * - * \param phaseIdx the index of the fluid phase - * \param compIdx the index of the component - * \f$\mathrm{molality}=\frac{n_\mathrm{component}}{m_\mathrm{solvent}} - * =\frac{n_\mathrm{component}}{n_\mathrm{solvent}*M_\mathrm{solvent}}\f$ - * compIdx of the main component (solvent) in the - * phase is equal to the phaseIdx - */ - Scalar molality(int phaseIdx, int compIdx) const // [moles/Kg] - { - return this->fluidState_.moleFraction(phaseIdx, compIdx) - /(this->fluidState_.moleFraction(phaseIdx, phaseIdx) - * FluidSystem::molarMass(phaseIdx)); - } - -protected: - - Scalar precipitateVolumeFraction_[numSPhases]; - Scalar sumPrecipitates_; - -private: - Implementation &asImp_() - { return *static_cast<Implementation*>(this); } - - const Implementation &asImp_() const - { return *static_cast<const Implementation*>(this); } -}; - -} // end namespace - -#endif diff --git a/dumux/porousmediumflow/2pncmin/implicit/vtkoutputfields.hh b/dumux/porousmediumflow/2pncmin/implicit/vtkoutputfields.hh deleted file mode 100644 index c0f7e9ba4f..0000000000 --- a/dumux/porousmediumflow/2pncmin/implicit/vtkoutputfields.hh +++ /dev/null @@ -1,61 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \brief Adds vtk output fields specific to the twop-nc-min model - */ -#ifndef DUMUX_TWOP_NC_MIN_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TWOP_NC_MIN_VTK_OUTPUT_FIELDS_HH - -#include <dumux/porousmediumflow/2pnc/implicit/vtkoutputfields.hh> - -namespace Dumux -{ - -/*! - * \ingroup TwoPNCMin, InputOutput - * \brief Adds vtk output fields specific to the TwoPNCMin model - */ -template<class TypeTag> -class TwoPNCMinVtkOutputFields -{ - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - - static constexpr int numPhases = GET_PROP_VALUE(TypeTag, NumPhases); - static constexpr int numSPhases = GET_PROP_VALUE(TypeTag, NumSPhases); - -public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - // use default fields from the 2pnc model - TwoPNCVtkOutputFields<TypeTag>::init(vtk); - - //output additional to TwoPNC output: - for (int i = 0; i < numSPhases; ++i) - { - vtk.addVolumeVariable([i](const VolumeVariables& v){ return v.precipitateVolumeFraction(numPhases + i); },"precipVolFrac_"+ FluidSystem::phaseName(numPhases + i)); - } - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/compositional/localresidualmin.hh b/dumux/porousmediumflow/compositional/localresidualmin.hh deleted file mode 100644 index 000241d26f..0000000000 --- a/dumux/porousmediumflow/compositional/localresidualmin.hh +++ /dev/null @@ -1,127 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * - * \brief Element-wise calculation of the local residual for problems - * using compositional fully implicit model that also considers solid phases. - */ -#ifndef DUMUX_COMPOSITIONAL_LOCAL_RESIDUAL_MINERAL_HH -#define DUMUX_COMPOSITIONAL_LOCAL_RESIDUAL_MINERAL_HH - -namespace Dumux -{ - -namespace Properties -{ -NEW_PROP_TAG(ReplaceCompEqIdx); -} // end namespace Properties - -/*! - * \ingroup Implicit - * \ingroup ImplicitLocalResidual - * \brief Element-wise calculation of the local residual for problems - * using compositional fully implicit model. - * - */ -template<class TypeTag> -class CompositionalMinLocalResidual: public GET_PROP_TYPE(TypeTag, CompositionalLocalResidual) -{ - using ParentType = typename GET_PROP_TYPE(TypeTag, CompositionalLocalResidual); - using Implementation = typename GET_PROP_TYPE(TypeTag, LocalResidual); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); - using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ResidualVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache); - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using MolecularDiffusionType = typename GET_PROP_TYPE(TypeTag, MolecularDiffusionType); - - static constexpr int numPhases = GET_PROP_VALUE(TypeTag, NumPhases); - static constexpr int numSPhases = GET_PROP_VALUE(TypeTag, NumSPhases); - static constexpr int numComponents = GET_PROP_VALUE(TypeTag, NumComponents); - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - - enum { conti0EqIdx = Indices::conti0EqIdx }; - - //! The index of the component balance equation that gets replaced with the total mass balance - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); - static constexpr bool useTotalMoleOrMassBalance = replaceCompEqIdx < numComponents; - -public: - using ParentType::ParentType; - - /*! - * \brief Evaluate the amount of all conservation quantities - * (e.g. phase mass) within a sub-control volume. - * - * The result should be averaged over the volume (e.g. phase mass - * inside a sub control volume divided by the volume) - * - * \param storage The mass of the component within the sub-control volume - * \param scvIdx The SCV (sub-control-volume) index - * \param usePrevSol Evaluate function with solution of current or previous time step - */ - ResidualVector computeStorage(const Problem& problem, - const SubControlVolume& scv, - const VolumeVariables& volVars) const - { - ResidualVector storage(0.0); - - const auto massOrMoleDensity = [](const auto& volVars, const int phaseIdx) - { return useMoles ? volVars.molarDensity(phaseIdx) : volVars.density(phaseIdx); }; - - const auto massOrMoleFraction= [](const auto& volVars, const int phaseIdx, const int compIdx) - { return useMoles ? volVars.moleFraction(phaseIdx, compIdx) : volVars.massFraction(phaseIdx, compIdx); }; - - // compute storage term of all components within all fluid phases - - ParentType::computeStorage(problem, scv, volVars); - for (int phaseIdx = numPhases; phaseIdx < numPhases + numSPhases; ++phaseIdx) - { - auto eqIdx = conti0EqIdx + numComponents-numPhases + phaseIdx; - storage[eqIdx] += volVars.precipitateVolumeFraction(phaseIdx) - * massOrMoleDensity(volVars, phaseIdx); - } - - return storage; - } - -protected: - Implementation *asImp_() - { return static_cast<Implementation *> (this); } - - const Implementation *asImp_() const - { return static_cast<const Implementation *> (this); } -}; - -} // end namespace Dumux - -#endif -- GitLab