From b37141932a5fbd400f076c3b94ccc05ed93deec9 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 3 Mar 2022 15:54:32 +0000 Subject: [PATCH] functionObjects::timeControl: Corrected initialisation of executionIndex_ needed by the adjustableRunTime option for restarted cases. --- .../db/functionObjects/timeControl/timeControl.C | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C b/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C index 5c4c55bff4..48fe91ff35 100644 --- a/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C +++ b/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C @@ -126,6 +126,19 @@ void Foam::timeControl::read(const dictionary& dict) case timeControls::adjustableRunTime: { interval_ = time_.userTimeToTime(dict.lookup(intervalName)); + + if (timeControl_ == timeControls::adjustableRunTime) + { + executionIndex_ = label + ( + ( + (time_.value() - time_.beginTime().value()) + + 0.5*time_.deltaTValue() + ) + /interval_ + ); + } + break; }