Home

EQUATIONS / SOURCE-GROUNDED

Formulas

The relations that keep the wake incompressible

These equations are taken from the fluid chapter’s solver notes. Hover a symbol inside an equation, or move through the symbol list beneath it, to highlight that term and read what it means. Nothing here invents results—only the mathematics the Metal solver implements.

EQ. 01

Momentum

Incompressible Navier–Stokes

How velocity changes under advection, pressure, viscosity, and force.

ut+(u)u=p+ν2u+f\dfrac{\partial \htmlClass{fs fs--u}{\mathbf{u}}}{\partial t}+\bigl(\htmlClass{fs fs--u}{\mathbf{u}}\cdot\htmlClass{fs fs--grad}{\nabla}\bigr)\htmlClass{fs fs--u}{\mathbf{u}}=-\htmlClass{fs fs--grad}{\nabla}\htmlClass{fs fs--p}{p}+\htmlClass{fs fs--nu}{\nu}\htmlClass{fs fs--grad}{\nabla}^{2}\htmlClass{fs fs--u}{\mathbf{u}}+\htmlClass{fs fs--f}{\mathbf{f}}

RowSim advances a 2-D velocity field with Stam’s stable-fluids decomposition of this equation. Advection moves the field, forces inject stroke energy, and pressure later removes compression so the result stays fluid-like under projection.

Sourcedocs/THESIS_PROJECT_DOSSIER.md §4.5.1

EQ. 02

Divergence-free

Incompressibility constraint

The field must not locally expand or compress.

u=0\htmlClass{fs fs--div}{\nabla\cdot\mathbf{u}}=\htmlClass{fs fs--zero}{0}

This single constraint is what makes the motion read as water. After forces create a tentative velocity, the projection step restores divergence-free flow so room-scale wakes stay continuous instead of smearing.

Sourcedocs/THESIS_PROJECT_DOSSIER.md §4.5.1

EQ. 03

Projection

Pressure Poisson equation

Find the pressure that cancels measured divergence.

2p=u~\htmlClass{fs fs--lap}{\nabla^{2}p}=\htmlClass{fs fs--divu}{\nabla\cdot\tilde{\mathbf{u}}}

Divergence of the tentative velocity becomes the right-hand side of a Poisson solve. On Apple Silicon, RowSim uses sixteen red/black Gauss–Seidel pairs; the fragment fallback uses twenty Jacobi sweeps. Subtracting ∇p then yields a divergence-free field.

Sourcedocs/THESIS_PROJECT_DOSSIER.md §4.5.1 / §4.5.5

EQ. 04

Correct

Velocity projection

Remove the compressive part of the tentative velocity.

u=u~p\htmlClass{fs fs--u}{\mathbf{u}}=\htmlClass{fs fs--utilde}{\tilde{\mathbf{u}}}-\htmlClass{fs fs--gradp}{\nabla p}

Once pressure is known, subtracting its gradient projects the field onto an incompressible state. This is the practical heart of the solver: injected stroke energy becomes a wake instead of a blob.

Sourcedocs/THESIS_PROJECT_DOSSIER.md §4.5.5

EQ. 05

Curl

Scalar vorticity estimate

Local rotation recovered from neighbouring velocity samples.

ω12[(vi+1,jvi1,j)(ui,j+1ui,j1)]\htmlClass{fs fs--omega}{\omega}\approx\tfrac{1}{2}\big[(\htmlClass{fs fs--v}{v}_{i+1,j}-\htmlClass{fs fs--v}{v}_{i-1,j})-(\htmlClass{fs fs--u}{u}_{i,j+1}-\htmlClass{fs fs--u}{u}_{i,j-1})\big]

Semi-Lagrangian advection damps rotation. Estimating curl and feeding a confinement force back into velocity restores visible swirls. RowSim also adds obstacle-edge curl shedding so the hull sheds vortices instead of killing them.

Sourcedocs/THESIS_PROJECT_DOSSIER.md §4.5.4

EQ. 06

Ripples

Damped wave / ripple update

A second height field carries wave memory across frames.

ht+1=(2d)ht(1d)ht1+c22ht\htmlClass{fs fs--h}{h}_{t+1}=(2-\htmlClass{fs fs--d}{d})\,\htmlClass{fs fs--h}{h}_{t}-(1-\htmlClass{fs fs--d}{d})\,\htmlClass{fs fs--h}{h}_{t-1}+\htmlClass{fs fs--c}{c}^{2}\htmlClass{fs fs--lap}{\nabla^{2}}\htmlClass{fs fs--h}{h}_{t}

Ripples live in a separate texture with current and previous height. The explicit damped wave update, plus advection along the carrier flow, lets disturbances drift with the wake and couple back into velocity.

Sourcedocs/THESIS_PROJECT_DOSSIER.md §4.5.6

EQ. 07

Stability

Wave-speed CFL clamp

Keep the explicit wave update inside a stable regime.

cmin(c,0.707)\htmlClass{fs fs--c}{c}\leftarrow\min(\htmlClass{fs fs--c}{c},\htmlClass{fs fs--bound}{0.707})

On a unit grid the damped wave scheme needs c² < 0.5. RowSim clamps wave speed so ripple propagation remains stable even when interaction energy is large.

Sourcedocs/THESIS_PROJECT_DOSSIER.md §4.5.6