fvModels::checkApplied: Check for sub-cycling

so that fvModel usage is not checked within the sub-cycling loop.
This commit is contained in:
Henry Weller
2023-04-05 15:57:52 +01:00
parent becee61eef
commit cb241c5f00

View File

@ -108,7 +108,12 @@ Foam::IOobject Foam::fvModels::createIOobject
void Foam::fvModels::checkApplied() const
{
if (mesh().time().timeIndex() > checkTimeIndex_)
const label timeIndex =
mesh().time().subCycling()
? mesh().time().prevTimeState().timeIndex()
: mesh().time().timeIndex();
if (timeIndex > checkTimeIndex_)
{
const PtrListDictionary<fvModel>& modelList(*this);
@ -128,7 +133,7 @@ void Foam::fvModels::checkApplied() const
}
}
checkTimeIndex_ = mesh().time().timeIndex();
checkTimeIndex_ = timeIndex;
}
}