From 4fdf57db047f2ff4e968b2b4d9cb26157e216fb0 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Mon, 5 Dec 2016 12:14:28 +0100 Subject: [PATCH] Consider the timestep converged only when number of iteration > minIter --- opm/autodiff/BlackoilModelEbos.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index ac115c153..621c6b5d0 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -283,11 +283,11 @@ namespace Opm { std::vector residual_norms; perfTimer.reset(); perfTimer.start(); - report.converged = getConvergence(timer, iteration,residual_norms); + // the step is not considered converged until at least minIter iterations is done + report.converged = getConvergence(timer, iteration,residual_norms) && iteration > nonlinear_solver.minIter(); report.update_time += perfTimer.stop(); residual_norms_history_.push_back(residual_norms); - bool must_solve = iteration < nonlinear_solver.minIter() || !report.converged; - if (must_solve) { + if (!report.converged) { perfTimer.reset(); perfTimer.start(); report.total_newton_iterations = 1; @@ -1475,7 +1475,7 @@ namespace Opm { } // if the last time step failed we need to update the solution varables in ebos // and recalculate the IntesiveQuantities. - if ( timer.hasLastStepFailed() && iterationIdx == 0 ) { + if ( timer.lastStepFailed() && iterationIdx == 0 ) { convertInput( iterationIdx, reservoirState, ebosSimulator_ ); ebosSimulator_.model().invalidateIntensiveQuantitiesCache(/*timeIdx=*/0); }