Mailing List picongpu-users@hzdr.de Message #255
From: Axel Huebl <a.huebl@hzdr.de>
Subject: A note on the CFL
Date: Thu, 16 Nov 2017 16:39:05 +0100
To: <picongpu-users@hzdr.de>
Dear PIConGPU Users,

just a note on the CFL criteria in PIConGPU.

The CFL criteria [1] is the maximum size of a time step in relation to
the grid size. mathematically, it's a necessary condition for the
convergence of a solver of a PDE, physically (roughly) speaking it
ensures information is not traveling faster than the speed of light. It
is set in grid.param

    Note: dt has a maxium allowed value depending on dx, dy, dz!

Besides the maxium allowed dt value for a given spatial resolution,
there is more to it. Physically, secondary observables such as group and
phace velocity will depend on your choice (see [2]). Simply put: the
closer you get to CFL the better (for the first order of these effects).

    Note: the closer dt gets to the maximum allowed value, the better.

We do enforce the CFL criteria for the various field solvers at compile
time, as some of you have already noted. It is still important to note
that this might not catch all corner-cases that can appear regarding
numerical precision.

    Note: dt can get *too close* to the maximum allowed value!

During the last days, I have done a simulation with CFL ratio:

    Courant c*dt <= 1.00003 ? 1

which blew up in my face (non-physical fields develop with NaNs, etc. -
basically, the CFL was violated).

Going a bit less close to the maximum allowed value by choosing a
slightly smaller time step helps:

    Courant c*dt <= 1.00055 ? 1

Long story short: stay close to the CFL critera but go not for more than
the 4th significant digit. The reason lies in since single precision
floating point numbers which are roughly 5-6 digits precise.

(If you like, we can also enforce this epsilon via compile time asserts.)


All the best,
Axel


[1]
https://en.wikipedia.org/wiki/Courant%E2%80%93Friedrichs%E2%80%93Lewy_condition
[2] https://doi.org/10.5281/zenodo.15924
    Section 2.3.1 "Solving Maxwells Equations", Figure 2.10
--

Axel Huebl
Phone +49 351 260 3582
https://www.hzdr.de/crp
Computational Radiation Physics
Laser Particle Acceleration Division
Helmholtz-Zentrum Dresden - Rossendorf e.V.

Bautzner Landstrasse 400, 01328 Dresden
POB 510119, D-01314 Dresden
Vorstand: Prof. Dr.Dr.h.c. R. Sauerbrey
          Prof. Dr.Dr.h.c. P. Joehnk
VR 1693 beim Amtsgericht Dresden
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster