From 76c59978b648f408264766bbe2c8d4632ce99502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Fri, 29 Jan 2021 12:30:34 +0100 Subject: [PATCH] Reset Non-Linear Iteration Count Before 'beginTimeStep' While here, also fix a couple of misprints in a nearby comment. --- opm/simulators/flow/BlackoilModelEbos.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/opm/simulators/flow/BlackoilModelEbos.hpp b/opm/simulators/flow/BlackoilModelEbos.hpp index f075e5988c..856416441a 100644 --- a/opm/simulators/flow/BlackoilModelEbos.hpp +++ b/opm/simulators/flow/BlackoilModelEbos.hpp @@ -238,16 +238,16 @@ namespace Opm { ebosSimulator_.model().advanceTimeLevel(); } - // set the timestep size and episode index for ebos explicitly. ebos needs to - // know the report step/episode index because of timing dependend data - // despide the fact that flow uses its own time stepper. (The length of the - // episode does not matter, though.) + // Set the timestep size, episode index, and non-linear iteration index + // for ebos explicitly. ebos needs to know the report step/episode index + // because of timing dependent data despite the fact that flow uses its + // own time stepper. (The length of the episode does not matter, though.) ebosSimulator_.setTime(timer.simulationTimeElapsed()); ebosSimulator_.setTimeStepSize(timer.currentStepLength()); - ebosSimulator_.problem().beginTimeStep(); - // we also need to reset the iteration count ebosSimulator_.model().newtonMethod().setIterationIndex(0); + ebosSimulator_.problem().beginTimeStep(); + unsigned numDof = ebosSimulator_.model().numGridDof(); wasSwitched_.resize(numDof); std::fill(wasSwitched_.begin(), wasSwitched_.end(), false);