From e567d0923ea41da395621eb41e0a4a7937db9f20 Mon Sep 17 00:00:00 2001
From: Lena Walter <lena.mahl@gmx.de>
Date: Fri, 21 Sep 2012 09:44:13 +0000
Subject: [PATCH] Uncomment dispersive flux for use of molefractions and add
 dispersive flux calculation for use of massfraction (reviewed by Alex)

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9107 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/boxmodels/1p2c/1p2clocalresidual.hh | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/dumux/boxmodels/1p2c/1p2clocalresidual.hh b/dumux/boxmodels/1p2c/1p2clocalresidual.hh
index 39273fd70b..6d34e380d7 100644
--- a/dumux/boxmodels/1p2c/1p2clocalresidual.hh
+++ b/dumux/boxmodels/1p2c/1p2clocalresidual.hh
@@ -58,6 +58,9 @@ protected:
     typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
     typedef typename GridView::IntersectionIterator IntersectionIterator;
 
+    enum { dim = GridView::dimension };
+    typedef Dune::FieldVector<Scalar, dim> DimVector;
+
     typedef typename GET_PROP_TYPE(TypeTag, VolumeVariables) VolumeVariables;
     typedef typename GET_PROP_TYPE(TypeTag, FluxVariables) FluxVariables;
     typedef typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables) ElementVolumeVariables;
@@ -239,6 +242,13 @@ public:
             // diffusive flux of the second component - massfraction
             tmp = -(fluxVars.moleFractionGrad(transportCompIdx)*fluxVars.face().normal);
             tmp *= fluxVars.porousDiffCoeff() * fluxVars.molarDensity();
+
+            // dispersive flux of second component - massfraction
+                       DimVector normalDisp;
+                       fluxVars.dispersionTensor().mv(fluxVars.face().normal, normalDisp);
+                       tmp -= fluxVars.molarDensity()*
+                       (normalDisp * fluxVars.moleFractionGrad(transportCompIdx));
+
             // convert it to a mass flux and add it
             flux[transportEqIdx] += tmp * FluidSystem::molarMass(transportCompIdx);
         }
@@ -249,10 +259,10 @@ public:
             tmp *= fluxVars.porousDiffCoeff() * fluxVars.molarDensity();
 
             // dispersive flux of second component - molefraction
-            //            Vector normalDisp;
-            //            fluxVars.dispersionTensor().mv(fluxVars.face().normal, normalDisp);
-            //            tmp -= fluxVars.molarDensity()*
-            //                (normalDisp * fluxVars.moleFractionGrad(transportCompIdx));
+                        DimVector normalDisp;
+                        fluxVars.dispersionTensor().mv(fluxVars.face().normal, normalDisp);
+                        tmp -= fluxVars.molarDensity()*
+                            (normalDisp * fluxVars.moleFractionGrad(transportCompIdx));
 
             flux[transportEqIdx] += tmp;
         }
-- 
GitLab