From e3d0bbc144f541bcc5911076f5406f03861e0c73 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Tue, 13 Jun 2017 15:55:19 +0200 Subject: [PATCH] specify the number of iterations where we use a "strict" Newton convergence criterion using a separate parameter that parameter is called "max_strict_iter". This increases the flexibility of this slightly and it avoids screwing up the default value for the "max_iter" parameter in the future. The credits for this patch go to [at]atgeirr for proposing it. --- opm/autodiff/BlackoilModelEbos.hpp | 2 +- opm/autodiff/BlackoilModelParameters.cpp | 2 +- opm/autodiff/BlackoilModelParameters.hpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index 6b115a9a9..6f2b9350c 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -979,7 +979,7 @@ namespace Opm { // do not care about the cell based residual in the last two Newton // iterations - if (iteration < param_.max_iter_ - 2) + if (iteration < param_.max_strict_iter_) converged = converged && converged_CNV; if ( terminal_output_ ) diff --git a/opm/autodiff/BlackoilModelParameters.cpp b/opm/autodiff/BlackoilModelParameters.cpp index 4376a2a52..9808556a7 100644 --- a/opm/autodiff/BlackoilModelParameters.cpp +++ b/opm/autodiff/BlackoilModelParameters.cpp @@ -52,7 +52,7 @@ namespace Opm tolerance_well_control_ = param.getDefault("tolerance_well_control", tolerance_well_control_); maxSinglePrecisionTimeStep_ = unit::convert::from( param.getDefault("max_single_precision_days", unit::convert::to( maxSinglePrecisionTimeStep_, unit::day) ), unit::day ); - max_iter_ = param.getDefault("max_iter",10); + max_strict_iter_ = param.getDefault("max_strict_iter",8); solve_welleq_initially_ = param.getDefault("solve_welleq_initially",solve_welleq_initially_); update_equations_scaling_ = param.getDefault("update_equations_scaling", update_equations_scaling_); use_update_stabilization_ = param.getDefault("use_update_stabilization", use_update_stabilization_); diff --git a/opm/autodiff/BlackoilModelParameters.hpp b/opm/autodiff/BlackoilModelParameters.hpp index 12260472a..cfb36728b 100644 --- a/opm/autodiff/BlackoilModelParameters.hpp +++ b/opm/autodiff/BlackoilModelParameters.hpp @@ -56,8 +56,8 @@ namespace Opm /// for solving for the Jacobian double maxSinglePrecisionTimeStep_; - /// Maximum number of Newton iterations before we give up - int max_iter_; + /// Maximum number of Newton iterations before we give up on the CNV convergence criterion + int max_strict_iter_; /// Solve well equation initially bool solve_welleq_initially_;