From 10fa193c5e650d14cad578c7400a55b5a9075f45 Mon Sep 17 00:00:00 2001 From: Katharina Heck <katharina.heck@iws.uni-stuttgart.de> Date: Fri, 2 Feb 2018 16:00:05 +0100 Subject: [PATCH] [cleanup] deprecate fluidsystemconstraintsolver and unused stuff in h2o2kineticfluidsystem --- .../fluidsystemconstraintsolver.hh | 47 ++----------------- dumux/material/fluidsystems/h2on2kinetic.hh | 3 ++ 2 files changed, 6 insertions(+), 44 deletions(-) diff --git a/dumux/material/constraintsolvers/fluidsystemconstraintsolver.hh b/dumux/material/constraintsolvers/fluidsystemconstraintsolver.hh index f699676556..29e5375275 100644 --- a/dumux/material/constraintsolvers/fluidsystemconstraintsolver.hh +++ b/dumux/material/constraintsolvers/fluidsystemconstraintsolver.hh @@ -32,6 +32,7 @@ #include <dumux/common/exceptions.hh> #include <dumux/common/valgrind.hh> +#include <dumux/material/constraintsolvers/misciblemultiphasecomposition.hh> namespace Dumux { /*! @@ -58,49 +59,7 @@ namespace Dumux { * - if the setEnthalpy parameter is true, also specific enthalpies of *all* phases */ template <class Scalar, class FluidSystem> -class FluidSystemConstraintSolver -{ - static constexpr int numPhases = FluidSystem::numPhases; - -public: - /*! - * \brief @copybrief Dumux::FluidSystemConstraintSolver - * - * \param fluidState A container with the current (physical) state of the fluid - * \param paramCache A container for iterative calculation of fluid composition - * \param setViscosity Should the viscosity be set in the fluidstate? - * \param setEnthalpy Should the enthalpy be set in the fluidstate? - */ - template <class FluidState, class ParameterCache> - static void solve(FluidState & fluidState, - ParameterCache & paramCache, - const bool setViscosity, - const bool setEnthalpy) - { - - // In this function the actual work is done. - // Either tables for solubility or functional relations are used therein. - // One way or the other, this function needs to set all the mole fractions - // in the fluidstate. - FluidSystem::calculateEquilibriumMoleFractions(fluidState, paramCache); - - for (int phaseIdx=0; phaseIdx<numPhases; phaseIdx++){ - Scalar value = FluidSystem::density(fluidState, paramCache, phaseIdx); - fluidState.setDensity(phaseIdx, value); - - if (setViscosity) { - value = FluidSystem::viscosity(fluidState, paramCache, phaseIdx); - fluidState.setViscosity(phaseIdx, value); - } - - if (setEnthalpy) { - value = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx); - fluidState.setEnthalpy(phaseIdx, value); - } - } - } -}; - +using FluidSystemConstraintSolver DUNE_DEPRECATED_MSG("Use MiscibleMultiPhaseComposition from dumux/material/constraintsolvers/misciblemultiphasecomposition.hh") += MiscibleMultiPhaseComposition<Scalar, FluidSystem>; } // end namespace Dumux - #endif diff --git a/dumux/material/fluidsystems/h2on2kinetic.hh b/dumux/material/fluidsystems/h2on2kinetic.hh index 20f84ce8fa..a84dd2100a 100644 --- a/dumux/material/fluidsystems/h2on2kinetic.hh +++ b/dumux/material/fluidsystems/h2on2kinetic.hh @@ -129,7 +129,9 @@ public: * \param calcCompIdx The component for which the composition in the other phase is to be * calculated. */ + template <class FluidState> + DUNE_DEPRECATED_MSG("FluidSystems should not compute equilibrium mole fractionos. Please use a constraintsolver e.g. the MiscibleMultiPhaseComposition instead") static void calculateEquilibriumMoleFractionOtherPhase(FluidState & fluidState, const ParameterCache & paramCache, const unsigned int referencePhaseIdx, @@ -259,6 +261,7 @@ public: * \param paramCache A container for iterative calculation of fluid composition */ template <class FluidState> + DUNE_DEPRECATED_MSG("FluidSystems should not compute equilibrium mole fractionos. Please use a constraintsolver e.g. the MiscibleMultiPhaseComposition instead") static void calculateEquilibriumMoleFractions(FluidState & fluidState, const ParameterCache & paramCache) { -- GitLab