zoomy_core.symsolver.discretization.reconstruction

zoomy_core.symsolver.discretization.reconstruction#

Face reconstruction of the solver templates: order 1 takes cell values of the reconstruction variables W(Q) to the faces, order 2 a limited LSQ gradient, and the inverse map recovers Q. Nothing is clipped: face positivity is the flux kernel’s, cell positivity MOOD’s.

Module Contents#

Functions#

reconstruct

Face traces (QL, QR) of order 1 (cell values) or 2 (limited LSQ gradient); QR on a boundary face is a placeholder for the BC value.

shore_extension

((eta, h), eps) for the free-surface reconstruction, else (): the stencil of the free-surface row eta (W row eta, the depth’s slot) takes a DRY neighbour’s value as its hydrostatic extension min(eta_k, eta_i); a neighbour is dry when its depth (W row h, the bed’s slot) is at most the model’s wet_dry_eps.

front_demotion

The cells the a-priori front detector (ReconstructionSpec.front_tol) demotes to first order, or None when it is off: the depth h extrapolated with the gradient of h and the limiter factor of the free-surface row eta, i.e. the depth the limited eta and the bed imply.

maps

(W(Q), Q(W)) kernels, or (None, None) when Q itself is reconstructed.

bed_rows

(bed, depth) rows when the reconstruction is the pair (h, eta = b + h) with bed=BedReconstruction.derived, else None.

limited

Limiter factor per row and cell (the NSM’s limiter, per-row overrides, then ties), 1 where no row is limited; shore is shore_extension’s, so the bounds come from the same stencil values as the gradient.

Data#

API#

zoomy_core.symsolver.discretization.reconstruction.LIMITERS#

None

zoomy_core.symsolver.discretization.reconstruction.reconstruct(nsm, Q, Qaux, p, time, order, demote, mesh)#

Face traces (QL, QR) of order 1 (cell values) or 2 (limited LSQ gradient); QR on a boundary face is a placeholder for the BC value.

Args

  • demote: False none, True all cells, or a cell mask; demoted cells are constant in W (MOOD).

References

zoomy_core.symsolver.discretization.reconstruction.shore_extension(nsm, rows)#

((eta, h), eps) for the free-surface reconstruction, else (): the stencil of the free-surface row eta (W row eta, the depth’s slot) takes a DRY neighbour’s value as its hydrostatic extension min(eta_k, eta_i); a neighbour is dry when its depth (W row h, the bed’s slot) is at most the model’s wet_dry_eps.

The order-2 hydrostatic reconstruction is well balanced when the reconstruction maps a lake at rest to a constant free surface in every wet cell (Audusse et al. 2004, Sec. 3). With dry cells that state is eta = const where h > 0 and h = 0, b >= eta elsewhere, and a dry cell’s eta = b is no free surface: a bank above the lake would give the wet shore cell a free-surface slope, which a limiter keeping the face values within the neighbour bounds removes (the shore cell is a local minimum of eta) but a smooth one (Venkatakrishnan) does not, and the slope accelerates water at rest. The hydrostatic reconstruction’s own face state continues the water level of the wet cell to a higher neighbouring bed (h* = max(0, eta_i - max(b_i, b_k))); the same continuation in the stencil, min(eta_k, eta_i), makes the gradient and the limiter bounds of a lake at rest exactly flat for any limiter, and leaves a lower dry neighbour (b_k < eta_i, the flooding front) as it is.

References

zoomy_core.symsolver.discretization.reconstruction.front_demotion(nsm, Q, G, phi, rows, mesh)#

The cells the a-priori front detector (ReconstructionSpec.front_tol) demotes to first order, or None when it is off: the depth h extrapolated with the gradient of h and the limiter factor of the free-surface row eta, i.e. the depth the limited eta and the bed imply.

References

zoomy_core.symsolver.discretization.reconstruction.maps(nsm)#

(W(Q), Q(W)) kernels, or (None, None) when Q itself is reconstructed.

zoomy_core.symsolver.discretization.reconstruction.bed_rows(nsm)#

(bed, depth) rows when the reconstruction is the pair (h, eta = b + h) with bed=BedReconstruction.derived, else None.

References

zoomy_core.symsolver.discretization.reconstruction.limited(nsm, W, Wg, G, mesh, shore=())#

Limiter factor per row and cell (the NSM’s limiter, per-row overrides, then ties), 1 where no row is limited; shore is shore_extension’s, so the bounds come from the same stencil values as the gradient.