zoomy_core.fvm.reconstruction module

zoomy_core.fvm.reconstruction module#

FVM face reconstruction and diffusion operators.

Reconstruction classes#

All reconstruction classes share the same interface: recon(Q) (Q_L, Q_R). The solver calls this once per flux evaluation — no if-clauses in the flux loop.

  • ConstantReconstruction: 1st-order piecewise-constant (identity).

  • MUSCLReconstruction: 2nd-order piecewise-linear with slope limiting (Barth-Jespersen or Venkatakrishnan).

  • FreeSurfaceMUSCL: MUSCL with wet-dry fallback and h-positivity.

Diffusion operators#

  • FaceGradient: corrected face-normal gradient for diffusion.

  • DiffusionOperator: sparse discrete Laplacian (explicit + implicit).

class zoomy_core.fvm.reconstruction.PrimitiveReconstruction(base, forward_fn, inverse_fn)#

Bases: object

Wraps a base ghost-cell-free reconstruction with pre/post transforms to the model’s primitive well-balanced variables.

Pre (per cell): state_cell wb_cell via forward_fn. Limit (per cell): base reconstruction on the WB cell values. Post (per face): wb_face state_face via inverse_fn.

The point of the WB transform is to limit the physically bounded quantities (η = h+b, u = q/h, …) instead of the conservative state, killing momentum overshoot at the wet/dry front (Audusse-Bouchut-Bristeau and follow-ups; see thesis/chapters/30_numerics.md). The smooth-limiter choice (Venkatakrishnan, Van Albada) becomes harmless because overshoots happen on η (nearly flat near LAR) and u (physically bounded), and the recovered q_face = h_face · u_face is positivity-consistent by construction.

forward_fn and inverse_fn are lambdified callables f(Q) wb and g(WB) Q (vectorised across cells / faces by the caller; this class iterates explicitly to keep the interface model-agnostic).