setDeltaT: Reinstate effect of deltaT setting in controlDict

The time step adjustment now starts from the minimum of the deltaT
calculated from Courant condition (and other physical limits), and the
deltaT specified in the system/controlDict.

This means that a small deltaT setting in system/controlDict results in
a gradual increase up to the Courant number limited value. This can be
useful in maintaining stability at the start of a simulation.

This functionality is an accidental side-effect at best. It is being
reinstated as existing cases are reliant upon it. If additional control
of the time step in the initial stages of a simulation is needed, then
that should be achieved with a more explicit user control.
This commit is contained in:
Will Bainbridge
2022-08-09 10:29:22 +01:00
parent 995b9165d1
commit 557c472f07
3 changed files with 10 additions and 3 deletions

View File

@ -47,7 +47,7 @@ void Foam::setDeltaT(Time& runTime, const PtrList<solver>& solvers)
if (deltaT != great)
{
runTime.setDeltaT(deltaT);
runTime.setDeltaT(min(runTime.deltaTValue(), deltaT));
}
}
}

View File

@ -36,7 +36,7 @@ void Foam::setDeltaT(Time& runTime, const solver& solver)
&& runTime.controlDict().lookupOrDefault("adjustTimeStep", false)
)
{
runTime.setDeltaT(solver.maxDeltaT());
runTime.setDeltaT(min(runTime.deltaTValue(), solver.maxDeltaT()));
}
}

View File

@ -34,7 +34,14 @@ if (adjustTimeStep)
{
if ((runTime.timeIndex() == 0) && (CoNum > small))
{
runTime.setDeltaT(min(maxCo*runTime.deltaTValue()/CoNum, maxDeltaT));
runTime.setDeltaT
(
min
(
maxCo*runTime.deltaTValue()/CoNum,
min(runTime.deltaTValue(), maxDeltaT)
)
);
}
}