functionObjects::timeControl: Updated to use beginTime

for consistency with the handling of restarts in Time.  See

commit 7aca9bfa78
Author: Henry Weller <http://cfd.direct>
Date:   Fri Dec 11 13:37:16 2020 +0000

    Time: Added beginTime used to rationalise the write times when restarting

    Now if a case is restarted from an arbitrary time, for example one generated at
    a premature stop condition, or with an increased writeInterval, the subsequent
    time directories written are referenced to the original start time of the case
    rather than the restart time.
This commit is contained in:
Henry Weller
2021-05-21 11:50:40 +01:00
parent 4064161331
commit 562df25d13
2 changed files with 3 additions and 3 deletions

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-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -168,7 +168,7 @@ bool Foam::timeControl::execute()
label executionIndex = label
(
(
(time_.value() - time_.startTime().value())
(time_.value() - time_.beginTime().value())
+ 0.5*time_.deltaTValue()
)
/interval_

View File

@ -165,7 +165,7 @@ Foam::scalar Foam::functionObjects::timeControl::timeToNextWrite()
(
0.0,
(writeTimeIndex + 1)*writeInterval
- (time_.value() - time_.startTime().value())
- (time_.value() - time_.beginTime().value())
);
}