From ce597ff6448c063ad9fef6af9a49a1a2ab620501 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de> Date: Tue, 3 Nov 2015 18:19:18 +0100 Subject: [PATCH] [material] Re-Include partial pressure in immiscible fluidstate The function returning the partial pressure was accidentally removed from the immiscible fluidstate. This caused an compiler error, e.g., when the water-air fluidsystem is used in 2p models. Reviewed by Thomas --- .../material/fluidstates/immisciblefluidstate.hh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dumux/material/fluidstates/immisciblefluidstate.hh b/dumux/material/fluidstates/immisciblefluidstate.hh index 8f02ae5395..f4105240e9 100644 --- a/dumux/material/fluidstates/immisciblefluidstate.hh +++ b/dumux/material/fluidstates/immisciblefluidstate.hh @@ -128,6 +128,21 @@ public: return std::numeric_limits<Scalar>::infinity(); } + /*! + * \brief The partial pressure of a component in a phase \f$\mathrm{[Pa]}\f$ + * + * To avoid numerical issues with code that assumes miscibility, + * we return a partial pressure of 0 for components which do not mix with + * the specified phase. Actually it is undefined. + */ + Scalar partialPressure(int phaseIdx, int compIdx) const + { + if (phaseIdx == compIdx) + return pressure(phaseIdx); + else + return 0; + } + /*! * \brief The molar volume of a fluid phase \f$\mathrm{[m^3/mol]}\f$ * -- GitLab