From 6ceab6ce919b47ae4853894dc0416207efff0803 Mon Sep 17 00:00:00 2001
From: Andreas Lauser <and@poware.org>
Date: Mon, 2 Jan 2012 13:09:59 +0000
Subject: [PATCH] H2O-N2 fluid system: also normalize the density if the
 complex relations are used

this is required to make sure that the relation

\rho^\kappa_g = X^\kappa_g \rho_g

holds unconditionally. note, that we define the sum of the mass
fractions to be the same as the sum of the mole fractions.

(also note, that this change only affects the case where the gas phase
is not present.)

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7271 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/material/fluidsystems/h2on2fluidsystem.hh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dumux/material/fluidsystems/h2on2fluidsystem.hh b/dumux/material/fluidsystems/h2on2fluidsystem.hh
index 529b92e854..daedcbb77a 100644
--- a/dumux/material/fluidsystems/h2on2fluidsystem.hh
+++ b/dumux/material/fluidsystems/h2on2fluidsystem.hh
@@ -381,7 +381,7 @@ public:
         // other
         Scalar rho_gH2O = H2O::gasDensity(T, p*fluidState.moleFraction(gPhaseIdx, H2OIdx));
         Scalar rho_gN2 = N2::gasDensity(T, p*fluidState.moleFraction(gPhaseIdx, N2Idx));
-        return rho_gH2O + rho_gN2;
+        return (rho_gH2O + rho_gN2) / std::max(1e-5, sumMoleFrac);
     };
 
     /*!
-- 
GitLab