zoomy_core.symsolver.discretization.time

zoomy_core.symsolver.discretization.time#

Time discretization of the solver templates: the SSP-RK stages, the IMEX Runge-Kutta tableaux and the CFL step size.

Module Contents#

Classes#

Imex

How a step treats the SystemModel’s implicit slots: lie splits them off after the SSP-RK step (first order), ssp2 solves them in every stage of IMEX-SSP2(2,2,2).

CflWaveSpeed

Where the CFL step takes its wave speeds.

ImexTableau

Double Butcher tableau: explicit (At, wt, ct) and diagonally implicit (A, w, c).

Functions#

cfl_dt

CFL step cfl * 2 r_f / (d |lambda|_f), min over faces, from the wave speeds of the cell states of each face and capped by dt_max.

cell_wavespeed

Max |eigenvalue| per face over the cell states of its two cells.

face_dt

The CFL step from the face wave speeds speed, capped by dt_max.

step_size

Adaptive CFL step, or a constant step that warns when above it.

landed

The step dt (<= cap, the distance to the next instant), or the whole cap when the leftover cap - dt is at most LANDING_TOL dt: the last step absorbs a floating-point sliver instead of a further step of that size.

face_rule

dt_rule taking the step from the first stage’s face wave speeds, capped by cap and landed on it (residual applies it to the cells’ speeds too where an edge source moves them).

checked

dt, warning once if it exceeds the CFL step dt_cfl(); tested every every steps (1: each step, 0: never).

Data#

API#

zoomy_core.symsolver.discretization.time.SSP_RK#

None

class zoomy_core.symsolver.discretization.time.Imex#

Bases: zoomy_core.misc.options.Option

How a step treats the SystemModel’s implicit slots: lie splits them off after the SSP-RK step (first order), ssp2 solves them in every stage of IMEX-SSP2(2,2,2).

Initialization

Initialize self. See help(type(self)) for accurate signature.

lie#

‘lie’

ssp2#

‘ssp2’

class zoomy_core.symsolver.discretization.time.CflWaveSpeed#

Bases: zoomy_core.misc.options.Option

Where the CFL step takes its wave speeds.

Initialization

Initialize self. See help(type(self)) for accurate signature.

faces#

‘faces’

cells#

‘cells’

class zoomy_core.symsolver.discretization.time.ImexTableau#

Bases: typing.NamedTuple

Double Butcher tableau: explicit (At, wt, ct) and diagonally implicit (A, w, c).

References

At: tuple#

None

wt: tuple#

None

ct: tuple#

None

A: tuple#

None

w: tuple#

None

c: tuple#

None

zoomy_core.symsolver.discretization.time.IMEX_RK#

None

zoomy_core.symsolver.discretization.time.cfl_dt(nsm, Q, Qaux, p, mesh, cfl, dimension)#

CFL step cfl * 2 r_f / (d |lambda|_f), min over faces, from the wave speeds of the cell states of each face and capped by dt_max.

References

zoomy_core.symsolver.discretization.time.cell_wavespeed(nsm, Q, Qaux, p, mesh)#

Max |eigenvalue| per face over the cell states of its two cells.

zoomy_core.symsolver.discretization.time.face_dt(nsm, speed, mesh, cfl, dimension)#

The CFL step from the face wave speeds speed, capped by dt_max.

References

zoomy_core.symsolver.discretization.time.step_size(nsm, Q, Qaux, p, mesh, cfl, dimension, dt_constant, time, check_every=10)#

Adaptive CFL step, or a constant step that warns when above it.

zoomy_core.symsolver.discretization.time.LANDING_TOL#

1e-06

zoomy_core.symsolver.discretization.time.landed(dt, cap)#

The step dt (<= cap, the distance to the next instant), or the whole cap when the leftover cap - dt is at most LANDING_TOL dt: the last step absorbs a floating-point sliver instead of a further step of that size.

zoomy_core.symsolver.discretization.time.face_rule(nsm, mesh, cfl, dimension, dt_constant, time, cap, check_every=10)#

dt_rule taking the step from the first stage’s face wave speeds, capped by cap and landed on it (residual applies it to the cells’ speeds too where an edge source moves them).

zoomy_core.symsolver.discretization.time.checked(dt, time, every, dt_cfl)#

dt, warning once if it exceeds the CFL step dt_cfl(); tested every every steps (1: each step, 0: never).