# GPU momentum upgrade: model register v5

This extends the published three-dimensional tank, not its physical scope. The MAC grid, salinity equation of state, closed walls, pressure correction and conservative salt/pigment transfers remain those in model register v4. The candidate accelerator evaluates only the limited MacCormack momentum transport and explicit viscosity on the GPU using Float32. Density, pressure projection, scalar transport, ledgers and canonical stored fields remain Float64. Converted GPU velocities return to the canonical state before projection. Display interpolation cannot feed back into the calculation.

The GPU implements the same midpoint characteristic traces, forward/reverse correction, eight-source-corner limiter, staggered offsets and viscous ghost conventions as the independent JavaScript and WebAssembly reference. All velocities are m/s; departures are in grid-cell coordinates; dt is seconds, viscosity m²/s; corrections and viscous increments are m/s. Normal wall velocities must be zero. No extra force, dye source, fade, vorticity confinement or geometric amplification is introduced.

Before implementation, acceptance criteria are: random smooth 16³ and 32³ velocity fields must agree with one Float64 momentum step within 5e-7 m/s maximum component error; a centred 22 mm, 36 g/kg drop in 30 g/kg water must agree in dye centroid within 0.25 mm after 1 s on a 32³ cube. Both paths must conserve salt/pigment volume integrals within 1e-12, leave projected RMS divergence below 1e-8 s⁻¹, and keep a stable four-layer stack and neutral drop at rest below 1e-12 m/s. The analytic Taylor–Green energy error must remain below 0.01% after 0.3 s on 32³ and 64×64×32; mixed precision may dominate the refinement trend, so both errors and their Float64 differences must be reported rather than claiming asymptotic convergence. Higher resolution changes the physical grid, not just the drawing resolution.

GPU availability, timing and render cadence will be measured in the actual browser. A device without a usable GPU retains the verified Float64 WebAssembly/JavaScript path. A GPU error must not partially commit a state: rerun that momentum operation from unchanged canonical fields on the reference backend. Device loss disables acceleration for subsequent steps. A larger requested timestep is a separate candidate and must be tested against the existing 0.01 s request before adoption; CFL, buoyancy and diffusion substeps remain mandatory.

This remains a qualitative laminar Boussinesq illustration with fixed temperature and a rigid lid, not DNS, turbulent entrainment or free-surface impact. GPU throughput and display detail do not establish physical validation.

## Delivered implementation

The browser schedules 0.02 s requests, retaining the same mandatory stability substeps. The original 0.01 s and new 0.02 s requests were compared after 1 s: the 32³ drop centroid differed by 0.062 mm. The numerical results report each requested timestep separately. The Float64 reference verification still runs the original grid and timestep fixtures.

Float64 WebAssembly helpers also evaluate the unchanged density-anomaly and pressure-kick loops. Their outputs were compared with independent JavaScript loops at 16³ and 64³, including salinity clamping. If GPU work fails, its uncommitted buffers are discarded and that momentum operation runs again on the reference backend. Presentation blends resolved frames over their observed arrival interval, up to 0.5 s; it cannot extrapolate physical state.

The volume drawing is capped at 1400 × 1050 pixels and reduces its drawing resolution when display cadence falls. This does not change the calculation grid. In local Chromium/Metal tests at a 1440 × 1000 viewport, the default 64 × 32 × 32 grid held 60 display frames/s and advanced 4.42 simulated seconds in 6 wall-clock seconds, versus 1.72 seconds before this upgrade. This is measured performance on one machine, not a device-independent guarantee. The 64³ option resolves more cells and advances more slowly.
