From 15bfc9f5684e1672efe1aa79ac116580ced74caf Mon Sep 17 00:00:00 2001
From: Markus Wolff <markus.wolff@twt-gmbh.de>
Date: Wed, 9 Mar 2011 15:27:11 +0000
Subject: [PATCH] small bugs in time-step calculation of decoupled 2p modell
 fixed

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@5380 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 .../2p/transport/fv/evalcflflux_coats.hh          | 15 ++++++++-------
 .../2p/transport/fv/evalcflflux_default.hh        |  2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/dumux/decoupled/2p/transport/fv/evalcflflux_coats.hh b/dumux/decoupled/2p/transport/fv/evalcflflux_coats.hh
index e4f0950cfd..42e66a8a2f 100644
--- a/dumux/decoupled/2p/transport/fv/evalcflflux_coats.hh
+++ b/dumux/decoupled/2p/transport/fv/evalcflflux_coats.hh
@@ -115,6 +115,7 @@ public:
         Scalar dPcdSI = MaterialLaw::dpC_dSw(problem_.spatialParameters().materialLawParams(globalPos,
                 *(intersection.inside())), satI);
 
+
         const Dune::FieldVector<Scalar, dimWorld>& unitOuterNormal = intersection.centerUnitOuterNormal();
 
         if (intersection.neighbor())
@@ -136,7 +137,7 @@ public:
             potentialW = problem_.variables().potentialWetting(globalIdxI, indexInInside);
             potentialNW = problem_.variables().potentialNonwetting(globalIdxI, indexInInside);
 
-            Scalar satJ = problem_.variables().saturation()[globalIdxI];
+            Scalar satJ = problem_.variables().saturation()[globalIdxJ];
             Scalar lambdaWJ = problem_.variables().mobilityWetting(globalIdxJ);
             Scalar lambdaNWJ = problem_.variables().mobilityNonwetting(globalIdxJ);
 
@@ -438,11 +439,11 @@ public:
             cflFluxFunction_ = 0;
         }
 
-        if (cflFluxDefault > 1)
-            std::cout << "cflFluxDefault = " << cflFluxDefault << "\n";
-
-        if (cflFluxFunction_ > 1)
-            std::cout << "cflFluxFunction_ = " << cflFluxFunction_ << "\n";
+//        if (cflFluxDefault > 1)
+//            std::cout << "cflFluxDefault = " << cflFluxDefault << "\n";
+//
+//        if (cflFluxFunction_ > 1)
+//            std::cout << "cflFluxFunction_ = " << cflFluxFunction_ << "\n";
 
         Scalar returnValue = std::max(cflFluxFunction_, cflFluxDefault);
         reset();
@@ -473,7 +474,7 @@ private:
     static const int pressureType_ = GET_PROP_VALUE(TypeTag, PTAG(PressureFormulation));
     static const int velocityType_ = GET_PROP_VALUE(TypeTag, PTAG(VelocityFormulation));
     static const int saturationType_ = GET_PROP_VALUE(TypeTag, PTAG(SaturationFormulation));
-    static const Scalar eps_ = 1e-2;
+    static const Scalar eps_ = 5e-3;
 };
 
 }
diff --git a/dumux/decoupled/2p/transport/fv/evalcflflux_default.hh b/dumux/decoupled/2p/transport/fv/evalcflflux_default.hh
index 43b5e0a68f..0bab72dade 100644
--- a/dumux/decoupled/2p/transport/fv/evalcflflux_default.hh
+++ b/dumux/decoupled/2p/transport/fv/evalcflflux_default.hh
@@ -227,7 +227,7 @@ typename EvalCflFluxDefault<TypeTag>::Scalar EvalCflFluxDefault<TypeTag>::getCfl
     }
     if (saturationType_ == Sn)
     {
-        volumeCorrectionFactorOutNW = std::max((1 - sat - residualSatNW), 1e-2);
+        volumeCorrectionFactorOutW = std::max((1 - sat - residualSatW), 1e-2);
         volumeCorrectionFactorOutNW = std::max((sat - residualSatNW), 1e-2);
     }
 
-- 
GitLab