zoomy_core.symsolver.strategies.hyperbolic

zoomy_core.symsolver.strategies.hyperbolic#

The explicit hyperbolic solver, written once for every backend: a finite-volume SSP-RK march with MOOD and IMEX options. A HyperbolicTemplate holds the configuration and its methods are the graphs a backend prints.

Module Contents#

Classes#

CoupledFace

The Riemann problem of a coupled face (preCICE).

HyperbolicTemplate

The configuration of the explicit hyperbolic solver; its methods (step, dt, initial_aux, march) are the graphs a backend prints.

Functions#

check_numerics

Raise at setup on a (model, Riemann class) pair whose scheme would run silently wrong: face terms that do not discretize a live entry of the nonconservative matrix drop that term of the PDE (a conservative Rusanov / HLL / HLLC on a model with a bed slope or a moment coupling; PositiveRusanov / PositiveHLL discretize the bed column only, through the hydrostatic reconstruction); and on a model’s equilibrium_reconstruction the symbolic solvers do not honour (bernoulli, projected_bernoulli: NotImplementedError; audusse without a hydrostatic reconstruction in the Riemann class).

API#

class zoomy_core.symsolver.strategies.hyperbolic.CoupledFace#

Bases: zoomy_core.misc.options.Option

The Riemann problem of a coupled face (preCICE).

Initialization

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

shared#

‘shared’

characteristic#

‘characteristic’

class zoomy_core.symsolver.strategies.hyperbolic.HyperbolicTemplate(nsm, *, cfl, dimension, mood=False, dt_write=None, imex=False, cfl_check_every=10, wave_speed=CflWaveSpeed.faces, dt_constant=None, time_order=None, dt_checkpoint=None)#

The configuration of the explicit hyperbolic solver; its methods (step, dt, initial_aux, march) are the graphs a backend prints.

Initialization

Set the configuration; nsm is the NumericalSystemModel.

Args

  • cfl: CFL number.

  • dimension: mesh dimension, enters the CFL step.

  • mood: a-posteriori MOOD guard of the RK step.

  • dt_write: output interval; None: no output.

  • imex: False (implicit slots inside the RK step), Imex.lie (implicit step after it) or Imex.ssp2 (IMEX-SSP2(2,2,2) stages).

  • cfl_check_every: constant dt: CFL test every N steps (1: each, 0: never).

  • wave_speed: CFL speeds from the first stage’s Riemann problem (CflWaveSpeed.faces) or from the cell states of each face (CflWaveSpeed.cells).

  • dt_constant: constant step, or None for the adaptive CFL step.

  • time_order: SSP-RK order; None: the reconstruction order (2 for Imex.ssp2).

  • dt_checkpoint: interval of io.save_state (landed on); None: at the end only.

property order#

Reconstruction order of the NSM.

step(Q, Qaux, p, time, dt, mesh, *, coupled=None, dt_rule=None)#

One time step (Q, Qaux, dt): the (MOOD-guarded) RK step, then the implicit slots by Lie splitting or inside the stages of IMEX-SSP2 when imex is set.

Args

  • coupled: (mask, flux), the faces carrying a shared answer.

  • dt_rule: the first stage picks dt from its own face wave speeds (ssp2: the cell states’).

dt(Q, Qaux, p, mesh)#

The CFL step from the cell states of each face.

initial_aux(Q, Qaux, p, mesh)#

The aux of the initial state: pointwise formula and derivative aux.

march(Q, Qaux, p, time, time_end, mesh)#

March from time to time_end.

precice_march(Q, Qaux, p, time, mesh, *, side, subcycling=False, face=CoupledFace.shared, frozen_mass_row=False, interface=None)#

The march as one preCICE participant; preCICE ends the loop and the coupled faces carry the interface answer (face).

Args

  • side: 0 if this domain is the low side of the interface (CoupledFace.shared).

  • subcycling: False: one step per window (warns above the CFL step), mass conserved exactly. True: adaptive steps inside the window, mass not exactly conserved.

  • face: CoupledFace.shared: one Riemann problem on (own, peer) that both sides solve alike; CoupledFace.characteristic: the Riemann problem (own, ghost) towards a peer of another model, the own cells’ states and aux exchanged.

  • frozen_mass_row: (characteristic) the depth row of the coupled faces held over the window at its value at the window start, of the Riemann problem (own as the peer reads it, ghost): what the peer charges for the same window, from the same exchanged data.

  • interface: (shared, column exchange) the NumericalSystemModel the Riemann problem of the coupled face is posed in when the peer runs another level of the model (the richer of the two), its kernels printed as interface.<slot>: both participants lift the pair, own as the peer reads it (couple.read_round_trip) and peer (couple.read), into its state (the lower level’s missing moments zero to round-off), solve the same problem and keep the rows of their own state (by name). Its state must contain the own state’s names, its parameters must be the own model’s.

References

zoomy_core.symsolver.strategies.hyperbolic.check_numerics(nsm)#

Raise at setup on a (model, Riemann class) pair whose scheme would run silently wrong: face terms that do not discretize a live entry of the nonconservative matrix drop that term of the PDE (a conservative Rusanov / HLL / HLLC on a model with a bed slope or a moment coupling; PositiveRusanov / PositiveHLL discretize the bed column only, through the hydrostatic reconstruction); and on a model’s equilibrium_reconstruction the symbolic solvers do not honour (bernoulli, projected_bernoulli: NotImplementedError; audusse without a hydrostatic reconstruction in the Riemann class).