zoomy_core.fvm.timestepping module

zoomy_core.fvm.timestepping module#

Time-stepping strategies for explicit FVM solvers.

All timestep functions return a compute_dt closure that is compatible with both NumPy and JAX (JIT-safe: no Python float() or min() on traced values).

zoomy_core.fvm.timestepping.constant(dt=0.1)#

Fixed timestep.

zoomy_core.fvm.timestepping.adaptive(CFL=0.9, nu=0.0, dimension=2, degree=0)#

Adaptive CFL-based timestep.

Uses the classical hyperbolic / parabolic limits with the spatial dimension and DG polynomial degree factored into the denominator so the CFL knob is a single safety factor ∈ (0, 1]:

\[\begin{split}\Delta t_\text{conv} &\le \mathrm{CFL} \; \frac{2\,r_\text{in}}{d \, (2k+1) \, |\lambda|_\text{max}}, \\ \Delta t_\text{diff} &\le \mathrm{CFL} \; \frac{(2\,r_\text{in})^2}{2 \, d \, \nu}.\end{split}\]

Here r_in is the cell inradius (so 2·r_in is the conservative “diameter”), d the spatial dimension, k the DG polynomial degree (use 0 for FV). The hyperbolic CFL constant 1/(2k+1) is the SSP-RK(k+1,k+1) stability limit (Cockburn & Shu, 1991); the spatial dimension contributes the 1/d factor in 2D/3D.

Parameters:
  • CFL (float in (0, 1]) – Safety factor on top of the theoretical limit (default 0.9).

  • nu (float) – Scalar viscosity for the parabolic CFL (default 0 → skip).

  • dimension (int) – Spatial dimension of the mesh (default 2).

  • degree (int) – DG polynomial degree (default 0 for FV).