OpenFOAM/Time: updated the setting of deltaT on restart

Use the deltaT in the controlDict if "adjustTimeStep" is not present or set
otherwise use that in the "uniform/time" file
This commit is contained in:
Henry
2012-01-30 16:03:04 +00:00
parent 9c8e2fa709
commit 8691b18271

View File

@ -203,10 +203,15 @@ void Foam::Time::setControls()
) )
); );
if (timeDict.readIfPresent("deltaT", deltaT_)) // Read and set the deltaT only if time-step adjustment is active
// otherwise use the deltaT from the controlDict
if (controlDict_.lookupOrDefault<Switch>("adjustTimeStep", false))
{ {
deltaTSave_ = deltaT_; if (timeDict.readIfPresent("deltaT", deltaT_))
deltaT0_ = deltaT_; {
deltaTSave_ = deltaT_;
deltaT0_ = deltaT_;
}
} }
timeDict.readIfPresent("deltaT0", deltaT0_); timeDict.readIfPresent("deltaT0", deltaT0_);