I'm experimenting with OpenFOAM. In my simulation of a time-dependent, transitional flow the Courant number remains well below 1 for a certain period but then rises, eventually leading to a floating point exception. In order to avoid it, I reduced the time step, with the consequence of an unacceptable slowdown of the simulation. Is there a possibility of dynamically adjusting the time step in dependence of the Courant number?
-
$\begingroup$ Which solver are you using? And are you using OpenFOAM-2.1? $\endgroup$– akidSep 3, 2012 at 7:57
-
1$\begingroup$ What @akid is saying: there ARE solvers in OpenFOAM that adjust the time-step. But not all $\endgroup$– bgschaidSep 3, 2012 at 8:33
-
$\begingroup$ @akid: I'm using OpenFOAM-2.1 with the PIMPLE solver. Is there any other suitable for my problem (incompressible, transient, time-dependent flow)? $\endgroup$– Igor F.Sep 3, 2012 at 13:36
-
$\begingroup$ @Igor transient and time-dependent is the same thing $\endgroup$– akidSep 3, 2012 at 15:47
-
$\begingroup$ @akid Sorry, I meant "transitional". $\endgroup$– Igor F.Sep 3, 2012 at 20:16
1 Answer
pimpleFoam is the OpenFOAM application designated for transient, incompressible flow which can be either laminar or turbulent. The solver does support dynamic adjustment of the time step based on the Courant number as well as relaxation of the transport equations to improve performance.
You can check if a solver supports adaptive time stepping by having a look at the program code, specifically the main file of a solver. If the line #include "setDeltaT.H" is present within the time loop while (runTime.run()), the solver application is enabled to work with adaptive time stepping (compare e.g. pimpleFoam and pisoFoam).
To see how to use adaptive time stepping, have a look at the tutorials included with OpenFOAM (tutorials/incompressible/pimpleFoam/).
-
$\begingroup$ Thanks, but it doesn't lead to the desired behavior. deltaT rises until the Courant number exceeds the maximum allowed value. Afterwards deltaT decreases to ridiculous levels (1e-24 or so) but the Courant number still remains too high. $\endgroup$– Igor F.Sep 5, 2012 at 21:13
-
$\begingroup$ What is the Courant value you specified? In any case, you can improve stability by also specifying a maxDeltaT. OpenFOAM's dynamic time stepping is not perfect, and it doesn't recompute a time step if the Courant number criterion was exceeded, so it can become unstable. $\endgroup$– akidSep 10, 2012 at 13:02
-
$\begingroup$ I tried 1 and 0.3. Thanks for the maxDeltaT hint. $\endgroup$– Igor F.Sep 10, 2012 at 17:04
-
1$\begingroup$ Side-note from here: "For future reference,
pimpleFoam
can be run essentially aspisoFoam
by settingnOuterCorrectors
to 1. This alleviates any coding problem.pimpleFoam
supports adjustable timestep." $\endgroup$ Feb 18, 2020 at 9:06