← f_ notebook · Mirrors · PDE

f_vf_fluid, live ​

A spectral fluid solver: a force field stirs an incompressible swirl flow that keeps moving after the stir stops.

The cell below steps the NumPy mirror that f_vf_fluid's tests are written against, in your browser. It is the NumPy mirror, not the Max patch, and it is not claimed to match the patch bit for bit.

f_fluid · NumPy mirror (Pyodide) · not the Max patch
Downloads about 15 MB the first time (Python and NumPy).
  • force is how strongly the source field stirs the flow each frame (velocity gained per frame at full scale).
  • speed is the self-advection time step; faster makes the flow move further per frame. It does not change smoothing.
  • viscosity smooths the flow each frame (0 = off, 1 = honey); most of the useful range is in the lower part of the dial.
  • drag damps the whole flow uniformly; raise it if the field builds up too fast.
  • drift controls how much frame-wide uniform current is allowed to build up; 1 = free to build, 0 = zeroed every frame, swirls unaffected.
  • steps per frame runs several solver steps per displayed frame so the flow evolves faster.
  • velocity gain scales the velocity before the encode's limiter, so bigger gain means more, faster-moving swirls in the display.
  • display gain brightens the color mapping of the field only (the solver is untouched).
  • Strike injects a short random vortex-pair impulse that the flow then carries itself (the source selection also feeds a stir every frame).
  • The input select picks the force field that steers the solver; the module stays at rest without one.
  • Reseed starts again from a new seeded set of initial vortices.

reference doc · patcher · fluid_mirror.py

← Complex Ginzburg-LandauKuramoto-Sivashinsky →