From 63bddb98db5de4d32e1a9e510965f89db766fd60 Mon Sep 17 00:00:00 2001 From: Nikola Majksner Date: Mon, 2 Jan 2023 09:29:26 +0100 Subject: [PATCH] fix for getting out of averaging when reached forced convergence --- convergenceDetection.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/convergenceDetection.C b/convergenceDetection.C index 610c89f..a032e9b 100644 --- a/convergenceDetection.C +++ b/convergenceDetection.C @@ -151,7 +151,8 @@ bool Foam::functionObjects::convergenceDetection::execute() !simulationFinished_ && convergenceFound_) { - if (convergenceMaxGradient() >= thresholdConvergence_ && !forcedConvergence_) + if ((convergenceMaxGradient() >= thresholdConvergence_ && !forcedConvergence_) && + (currentIteration_ < iterationMaxConvergence_)) { stopAveraging(); }