This is a top-down (plan-view) 2D re-implementation of the same Lagrangian connectivity model used by real coral-reef biophysical studies. Every larva obeys the advection–diffusion equation, integrated in the canvas plane with its own independent Euler–Maruyama stepper:
dX/dt = U(X,t) + sqrt(2K)·dW/dt
U = mean current + Σ vortex(x,y)
vortex: v = Γ(−Δy, Δx) / (r² + a²)
The mean current advects every larva at a constant speed and heading. Two mesoscale eddies (rotating vortex fields, strength Γ set by the eddy slider, core radius a) add curl to the flow so larvae can recirculate back toward the source reef instead of just drifting downstream. The sqrt(2K)·dW term is a random-walk step scaled by turbulent diffusivity K — for a 2D isotropic random walk the theoretical mean-squared displacement grows as ⟨r²⟩ = 4Kt (2Kt from each of the two independent coordinates), which is exactly what this engine's own step function was checked against numerically before shipping.
Biology layered on top of the physics — identical rules to the 3D model, computed independently here:
- Pre-competency (age < 2 days): the larva cannot settle even over a reef — broadcast-spawning corals need a minimum development time before their planulae can metamorphose.
- Competency window (2–20 days): once competent, a larva within capture range of a reef patch settles stochastically at a fixed encounter rate.
- Mortality: a constant background hazard removes a fraction of larvae per day, S(t) = e^(−μt); larvae still drifting after the maximum pelagic larval duration (PLD ≈ 20 days) die of exhaustion.
The connectivity panel is the 2D-specific addition: it tallies, live, what fraction of the released cohort has settled at each named reef — the exact quantity (a source-to-sink connectivity matrix row) that reef-network conservation planning is built from.