functionObjects::timeControl: Corrected initialisation of executionIndex_

needed by the adjustableRunTime option for restarted cases.
This commit is contained in:
Henry Weller
2022-03-03 15:54:32 +00:00
parent aa02cd4d25
commit b37141932a

View File

@ -126,6 +126,19 @@ void Foam::timeControl::read(const dictionary& dict)
case timeControls::adjustableRunTime:
{
interval_ = time_.userTimeToTime(dict.lookup<scalar>(intervalName));
if (timeControl_ == timeControls::adjustableRunTime)
{
executionIndex_ = label
(
(
(time_.value() - time_.beginTime().value())
+ 0.5*time_.deltaTValue()
)
/interval_
);
}
break;
}