Time: Maintain the endTime value if present even if not needed

This commit is contained in:
Henry Weller
2024-02-13 21:23:49 +00:00
parent fb6136f5e8
commit fd18d7e528

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -128,7 +128,7 @@ void Foam::Time::readDict()
{
stopAt_ = stopAtControlNames.read(controlDict_.lookup("stopAt"));
if (stopAt_ == stopAtControl::endTime)
if (stopAt_ == stopAtControl::endTime || controlDict_.found("endTime"))
{
endTime_ = userTimeToTime(controlDict_.lookup<scalar>("endTime"));
}