From 95cd33185b9956522723902c443623f70eab6ad2 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Thu, 22 May 2014 20:25:58 +0200 Subject: [PATCH] Correcting the determination of stagnate. --- opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp index 95c9900ed..e8867f1f8 100644 --- a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp +++ b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp @@ -1703,6 +1703,7 @@ namespace { { // The detection of oscillation in two primary variable results in the report of the detection // of oscillation for the solver + // Only the saturations are used in detection for the black oil model. // Stagnate is not used for any treatment here. oscillate = false; @@ -1714,8 +1715,6 @@ namespace { int oscillatePhase = 0; - stagnate = true; - // bool oscillateWater = false; // bool oscillateOil = false; // bool oscillateGas = false; @@ -1741,15 +1740,19 @@ namespace { double relChange3 = std::fabs((residual_history[it - 1][phaseIdx] - residual_history[it - 2][phaseIdx]) / residual_history[it - 2][phaseIdx]); - stagnate = stagnate && (relChange3 > 1.e-3); + stagnate = stagnate || (relChange3 > 1.e-3); std::cout << " relChange1 " << relChange1 << " relChange2 " << relChange2 << " relChange3 " << relChange3 << std::endl; } } + stagnate = !stagnate; + oscillate = (oscillatePhase > 1); + std::cout << " oscillate " << oscillate << " stagnate " << stagnate << std::endl; + std::cin.ignore(); }