Skip to content

Commit

Permalink
controlDict: Added optional 'beginTime' entry
Browse files Browse the repository at this point in the history
for cases started or restarted from some arbitrary time without a corresponding
<time>/uniform/time dictionary to set the beginTime to the logical start of the
simulation.  Setting beginTime to 0 for example ensures that write times,
functionObject evaluations and writes etc. occur at intervals starting from 0
rather than the arbitrary startTime.
  • Loading branch information
Henry Weller committed Jun 13, 2023
1 parent aa89c78 commit 0fa46ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/OpenFOAM/db/Time/Time.C
Expand Up @@ -239,7 +239,11 @@ void Foam::Time::setControls()
)
);

if (timeDict.found("beginTime"))
if (controlDict_.found("beginTime"))
{
beginTime_ = userTimeToTime(controlDict_.lookup<scalar>("beginTime"));
}
else if (timeDict.found("beginTime"))
{
beginTime_ = userTimeToTime(timeDict.lookup<scalar>("beginTime"));
}
Expand Down

0 comments on commit 0fa46ef

Please sign in to comment.