A tornado meets a wall — strainedColumn + withBoundary

strainedColumn is an exact stationary solution of the incompressible Navier–Stokes equations: an inward strain u^r = −a·r holds a filament open against viscosity, and the balance closes in closed form — the vorticity is purely axial and Gaussian, ω_z = (εa/ν)·e^(−a r²/2ν), with core radius √(2ν/a). Raise the strain and the column gets thinner and brighter at once, because the peak εa/ν climbs while the width falls. Both numbers are printed, next to the same two quantities measured back out of the sampled field.

withBoundary takes any field's analytic vector potential A, ramps it to zero across a signed-distance surface, and returns ∇×(ramp·A) — expanded exactly as u_b = ramp′·(∇d×A) + ramp·u. It is still a curl, so still exactly divergence-free; it is tangent at the wall because both terms lose their normal part there (ramp(0) = 0 kills the second, and (∇d×A)·∇d = 0 kills the first); and beyond the band it is bit-identical to the untouched field. Every other withBoundary page in this repo hands it a broadband mode sum. This is the first time it is handed a closed-form solution. The receipt below probes a shell ε = 1e-9 outside the surface rather than the surface itself, where what is left is the ramp's own linear tail — a measured quantity, not a floating-point artefact, and not the exactly-zero field inside the obstacle that a probe sitting on d = 0 would read half the time.

helix-noise · exact NS column + obstacle
loading three.js…
obstacle field
∇d

receipt — remeasured every frame, all three fields, whichever one is driving the particles

field max |u·n̂|at the wall max |u|same points max |∇·u|in the band |∇u|same points
∇×(ramp·A)————
no obstacle — the bare column————
naive mask ramp·u————

How to read the table. The first column on its own proves nothing, and the table is built to make that impossible to miss. The naive mask ramp(d/th)·u — fade the velocity instead of the potential, which is the tempting shortcut — scores 5.4e-9 for normal flow at the wall: the same number, to every digit shown, as the real construction. It has to, because both are ramp(ε/th)·(u·n̂) at that point. What separates them is the column beside it. The correct field is moving at |u| ≈ 7 there and sliding around the obstacle; the naive mask's whole velocity is 6e-9, because it does not deflect the flow, it stops it — particles arrive and pile into a stalled crust, and the closest-approach readout falls to ~1e-9 instead of settling at a few hundredths. Its last column is the verdict: scaling a divergence-free field by a scalar destroys ∇·u = 0, and the measured divergence goes from ~1e-10 to 4.5.

How to break the real one. Two of the controls are wired to make the receipt fail. skewed 25° hands withBoundary a gradient that does not match the SDF it is paired with — a plausible bug, not a contrived one, since you supply the two separately. The picture still looks bounded; max|u·n̂| jumps to ~3 and the divergence to ~7 (the exact values depend on the shape), because ramp·A is no longer being curled against its own geometry. finite-diff is what the library actually does when you pass no gradient at all: on a sphere that costs the truncation error and the number rises to ~2e-6; on a box face or a plane the central difference of the distance is exact, and it does not move at all. That last fact is worth more than the first two — it is the sort of thing a demo that only printed a passing zero would have hidden.

What this is not. withBoundary makes the flow tangent to the obstacle. It does not solve a no-slip boundary layer — there is no viscous wall here, no vorticity generated at the surface, no drag, no wake. It is a kinematic deflection: an algebraic identity that steers an already-chosen field around a shape while preserving ∇·u = 0. Two consequences worth stating rather than discovering. First, the wall slip speed is set by ramp′(0)/th·|∇d×A|, so a thin band manufactures a fast sheet — the readout prints |u|wall / |u|free, which runs 3.9 at the default band, 10.8 at band = 0.2 and 1.3 at band = 1.6. The flow does not slow down at this wall; it speeds up. Second, u_b depends on A and not only on u, and A is fixed only up to a gradient — a different, equally valid potential for the same column would give a different slip flow on the same obstacle. That is a property of the method. Related: the column's potential grows like ln r and is not compactly supported (a swirling column cannot have one), so unlike createRing an obstacle placed far away still feels it.

outside the band — field bit-identical to the bare column inside the band — deflected inside the obstacle — should never appear under ∇×(ramp·A)
loading…