Flow
A current assembled from local collisions. Lattice populations stream and relax until a fluid-like velocity field appears—bending around obstacles, shedding wakes and carrying dye. The sphere makes transport visible and also asks what a computational flow may honestly claim once
The idea
A current assembled from local collisions. Lattice populations stream and relax until a fluid-like velocity field appears—bending around obstacles, shedding wakes and carrying dye. The sphere makes transport visible and also asks what a computational flow may honestly claim once solver choices, boundaries and measurement enter the picture.
Science and concept
Continuum fluid mechanics describes density, velocity, pressure and stress as fields varying through space and time. The incompressible Navier–Stokes equations are often written
Compact form: ∇· u=0, \qquad (∂ u)/(∂ t) + ( u·∇) u = -(1)/(\rho)∇ p + \nu∇^2 u + f.
A conventional CFD solver discretises these continuum equations directly. The lattice-Boltzmann method takes a different route. It evolves discrete populations moving along a small set of lattice directions, then recovers density and velocity from their moments.
AL.Floys uses the two-dimensional nine-velocity lattice known as D2Q9. At each cell, (f_i) denotes a population associated with one rest direction, four axial directions and four diagonals. Macroscopic density and momentum are obtained from
Compact form: \rho=Σ_i f_i, \qquad \rho u=Σ_i f_i e_i.
The local equilibrium distribution is a low-Mach expansion in (\mathbf u). The engine uses the standard D2Q9 weights (4/9), (1/9) and (1/36).
Its collision rule is the single-relaxation-time Bhatnagar–Gross–Krook form:
Compact form: f_i^\star = f_i -(1)/(\tau) \left(f_i-f_i^eq\right).
When (\tau) is close to its lower stability limit, populations relax rapidly and the corresponding lattice viscosity is low. Larger (\tau) produces greater viscosity. For this D2Q9 BGK formulation,
Compact form: \nu=(\tau-\tfrac12)/(3)
in lattice units.
After collision, streaming moves each directional population to the neighbouring cell aligned with its lattice velocity. A pull-stream implementation asks each destination cell where its incoming population came from.
This collision–streaming alternation is the conceptual core of the sphere. No global object calculates a streamline. Fluid-like transport emerges from repeated local redistribution.
Solid cells use a simple bounce-back rule. A population that would arrive from a solid neighbour is replaced by the population travelling in the opposite direction. This approximates a no-slip boundary at the grid scale. It is efficient and visually effective, but geometry is stair-stepped by the lattice and exact wall location depends on the discretisation.
The top and bottom rows are solid channel walls. The left boundary can impose a uniform, shear-like or swirl-like inlet. The right boundary copies the macroscopic state from the adjacent interior column into a constrained equilibrium, providing a simple zero-gradient-style outflow. These are designed numerical boundaries, not an infinite physical domain.
Flow makes motion visible with passive dye. The dye is not one of the nine fluid populations and does not affect density, momentum or viscosity. It is stored separately, traced backward through the current velocity field using bilinear interpolation, then multiplied by a decay factor.
The relation is one-way:
velocity field → dye transport.
Dye does not feed back into the fluid. A bright plume is therefore a tracer of recent advection, not a denser or more forceful fluid.
Continuous dye sources are also a presentation device. Depending on the selected source, the engine injects streaks, a plume, multiple streaks or an internal cloud each frame so the current remains visible. Without injection and persistence, a steady flow field could be scientifically present but visually empty.
An obstacle creates a wake because the boundary redirects momentum and separates the downstream flow. Behind a circular cylinder, alternating vortices can form a von Kármán street in appropriate regimes. The characteristic competition is commonly summarised by the Reynolds number
Compact form: Re=(UL)/(\nu),
where (U) is a characteristic speed, (L) a characteristic obstacle size and (\nu) kinematic viscosity.
AL.Floys does not presently report a calibrated Reynolds number. Its dimensions and time are lattice/display units, the effective viscosity contract is inconsistent, and the boundary/obstacle discretisation is simplified. The sphere may show vortex-street-like shedding, but it should not publish a Reynolds-number claim until the parameter authority and validation suite are corrected.
The distinction between vortex shedding and turbulence is especially important. Roshko’s cylinder-wake experiments identified a range in which regular vortex streets occur without turbulent motion, followed by transition and irregular wakes at higher Reynolds number. A curled or alternating wake is not by itself proof of turbulence.
The preset name Turbulent Gate is therefore stronger than current evidence. The implementation computes no energy spectrum, inertial range, dissipation rate, Reynolds stress or convergence study. Unless those validations are added, a title such as Staggered Wake or Wake Gate would be more truthful.
The obstacle called Airfoil is also approximate. The code stamps a rotated elongated ellipse with fixed inclination. It is not a NACA profile and does not implement a sharp trailing edge. The preset description “NACA-like profile” should be removed. Elliptic Foil, Inclined Foil or Streamlined Obstacle would match the geometry.
Current viscosity / relaxation contract defect
The most important implementation finding in Batch 2 is the authority conflict between viscosity and relaxation.
The code correctly provides
Compact form: \tau_\nu=3\nu+0.5
through tauFromViscosity(). It then calls resolveTau(viscosity, relaxation). However, whenever the explicit relaxation value is finite and between 0.52 and 1.98, that value is returned and the viscosity-derived value is ignored.
Every current preset supplies a valid relaxation time. The public Viscosity (ν) slider therefore does not change the solver while relaxation remains valid.
For example:
- default
viscosity = 0.012would imply (\tau=0.536); - default
relaxation = 1.56is what the engine actually uses; - (\tau=1.56) corresponds to (\nu\approx0.3533), not
0.012.
The same conflict exists across the shipped presets. Their textual “low viscosity” or “thicker fluid” interpretations cannot be trusted from the declared viscosity field.
One parameter must become authoritative:
- Recommended: expose (\nu), derive (\tau=3\nu+0.5), and remove or make relaxation read-only.
- Expose (\tau) as the actual control and display derived (\nu).
- Add an explicit expert override that makes the authority switch visible.
Until this is corrected, Viscosity must not be the featured public experiment.
The current public inlet speed reaches 0.32 in lattice units. The D2Q9 speed of sound is (c_s=1/\sqrt3\approx0.577), so the maximum nominal Mach number can exceed 0.5. Standard weakly compressible LBM is usually interpreted most cleanly at substantially lower Mach number. The engine clamps some density values and is built for interactive stability, but high inlet settings should be presented as stylised extremes, not quantitatively incompressible flow.
Solver iterations / frame repeats complete collide–stream passes. The kernel does not subdivide a fixed physical timestep by the number of substeps. Raising this parameter advances more lattice time per rendered frame and changes apparent rate; it is not automatically greater temporal accuracy at equal simulated time.
The current “pressure” render mode displays density. In an isothermal weakly compressible lattice-Boltzmann model, pressure is related to density by (p=c_s^2\rho). Calling the mode Density—as the option label already does—is safer than treating it as an independently solved pressure field.
Curl is estimated from centred differences of the velocity field:
Compact form: \omega_z = (∂ u_y)/(∂ x) - (∂ u_x)/(∂ y).
The Curl render mode makes local rotation visible. The vorticityBoost control only scales its visual emphasis. It does not inject vorticity into the solver. Its current simple-surface role should be described as Curl emphasis, not a physical behaviour parameter.
This separation of dynamics from instrumentation is the strongest editorial opportunity in Flow. The visitor can view one underlying state as dye, dye plus curl, speed, curl or density. Different images can therefore be treated as different measurements of the same computed field.
History
Osborne Reynolds’s 1883 experiments on flow in pipes established a foundational relation between speed, scale, viscosity and the transition from direct to sinuous motion. The dimensionless number later named after him became central to comparing flow regimes across different physical systems.
The alternating wake behind a bluff body was analysed mathematically by Theodore von Kármán in the early twentieth century. Anatol Roshko’s 1950s cylinder experiments then mapped the development of regular and turbulent wakes across Reynolds-number ranges, making clear that periodic shedding and turbulence are related but distinct.
The lattice route to fluid simulation emerged from cellular automata. In 1986, Uriel Frisch, Brosl Hasslacher and Yves Pomeau showed that suitable deterministic lattice gases could reproduce Navier–Stokes-like behaviour. Their Boolean particles, however, suffered substantial statistical noise.
Guy McNamara and Gianluigi Zanetti’s 1988 proposal replaced noisy lattice-gas occupancy with a lattice Boltzmann equation for population distributions. The method retained local collision and streaming while enabling smoother hydrodynamic simulation.
The single-relaxation-time lattice BGK formulation was developed in the early 1990s, especially by Y. H. Qian, Dominique d’Humières and Pierre Lallemand. D2Q9 became a standard two-dimensional lattice because it balances symmetry, efficiency and recovery of the required hydrodynamic moments.
Shiyi Chen and Gary Doolen’s 1998 review consolidated the lattice-Boltzmann method as a mesoscopic computational approach with particular strengths for complex boundaries, multiphase systems and parallel execution.
AL.Floys belongs to this lineage as a real-time educational implementation. It captures the collision–streaming architecture and several recognisable wake phenomena, while using a small CPU grid, simple BGK relaxation, interactive boundaries and aesthetic tracer injection.
What this simulates
| Aspect | Current implementation |
|---|---|
| Entities / field | Nine floating-point lattice populations per fluid cell, plus extracted density, velocity, curl and a separate dye scalar. |
| Lattice | D2Q9: one rest, four axial and four diagonal velocity directions. |
| Collision | Single-relaxation-time BGK movement toward local D2Q9 equilibrium. |
| Streaming | Pull streaming from neighbouring cells. |
| Viscosity relation | Intended (\nu=(\tau-0.5)/3), but explicit relaxation currently overrides public viscosity. |
| Solids | Bounce-back at top/bottom channel walls, preset obstacles and painted obstacles. |
| Inlet / outlet | Imposed equilibrium at the left for uniform, shear-like or swirl-like input; copied/clamped equilibrium at the right. |
| Obstacle geometry | Circle, staggered rectangles, a rotated elongated ellipse labelled airfoil, painted-only or open channel. |
| Dye | Passive scalar advected semi-Lagrangianly through extracted velocity, decayed and continuously reinjected for visibility. |
| Substeps | Repeated collide–stream passes per display frame; not a fixed-time subdivision. |
| Randomness | Seeded initial dye placement and some pointer/source variation; LBM update is deterministic given state. |
| Rendering interpretation | Dye, dye plus curl, speed, curl or density, with contrast, glow and field fade. |
| Public simple controls | Inlet speed, Inlet mode, Viscosity, Curl emphasis and Render mode. |
| Public tools | Brush, Spawn, Erase and Force with mode-specific targets. |
| Known scientific-contract issues | Viscosity is currently inert under valid (\tau); airfoil is an ellipse; turbulence is unvalidated; dye is passive. |
The most truthful one-line description is: a stylised lattice fluid that carries a passive tracer through interactive channel geometry.
What to look for
Stagnation and diversion — a solid reorganises the field upstream
Dye approaching an obstacle slows and divides. The disturbance begins before the visible edge because the velocity field must redirect around the no-flow region.
Wake formation — downstream remembers the obstacle
Behind a cylinder or block, the flow contains a low-speed region and shear layers separating it from faster surrounding current. Geometry continues to matter after the fluid has passed the object.
Alternating shedding — symmetry can become time-dependent
A nominally symmetric obstacle and inlet can develop an alternating wake. Small perturbations select the first side; subsequent feedback can produce a vortex-street-like sequence.
Recirculation — local flow can oppose the main current
In the wake or between blocks, curl and velocity renderings may reveal closed or backward-moving regions even though the average inlet points rightward.
Shear — neighbouring layers move differently
The shear-like inlet changes speed and direction with vertical position. Dye stretches because adjacent portions are transported at different rates.
Passive advection — a visible cloud is not the fluid itself
Dye can leave one region while the velocity field persists. Change render mode from Dye to Speed or Curl to reveal dynamics that are invisible in the tracer image.
Obstacle topology — shape controls separation
Compare a circle, blocks and the elongated ellipse. Different curvature and sharpness reorganise the wake, even with the same inlet. Grid resolution also changes how faithfully those boundaries are represented.
Curl versus speed — fast is not the same as rotating
A high-speed region can have low curl if neighbouring velocities are parallel. Strong curl can occur in a relatively slow recirculation zone. The render modes separate two different properties.
Density variation — the solver is weakly compressible
Density mode can reveal small changes associated with the lattice populations and boundaries. These are not a separately calibrated pressure measurement.
How to explore
First 30 seconds
- Load Vortex Street.
- Keep Render mode on Dye + Curl and identify the circular obstacle, upstream flow and downstream wake.
- Move Inlet speed downward, wait for the field to adjust, then raise it gradually. Change no other behavioural control.
- Watch the wake shorten, lengthen or become more time-dependent as transport changes.
- Switch Render mode to Speed, then Curl, without resetting. Compare where the field is fast with where it rotates.
- Open Steer, choose Brush, select Obstacle, and add a small downstream obstruction. Watch the established current reorganise.
- Avoid using Viscosity as a causal experiment until the (\nu/\tau) authority defect is fixed.
Three experiments
| Experiment | Question | Do | Watch for | Why it matters |
|---|---|---|---|---|
| Drive and wake | How does stronger transport alter an obstacle wake? | Vortex Street → vary Inlet speed in stages while keeping geometry and render mode fixed. | Wake extent, separation and onset of alternating structure. | Changes a trustworthy behavioural input without relying on the broken viscosity control. |
| One state, several instruments | Is the visible dye identical to the fluid field? | Hold one run → switch Dye, Speed, Curl and Density render modes. | Structures present in velocity/curl but absent from dye, and vice versa. | Separates simulated state from measurement and presentation. |
| Geometry as intervention | Can a local solid reorganise the entire downstream current? | Vortex Street → paint a small obstacle in the wake or use the Blocks preset. | New separation points, recirculation regions and redirected dye. | Shows boundary conditions as active generators of flow structure. |
After the viscosity contract is repaired, a fourth experiment should hold (U), obstacle size, resolution and inlet mode fixed while varying (\nu). That would provide the cleanest route to Reynolds-number reasoning.
Parameters that teach
| Parameter | What it really controls | Increase it | Decrease it | What to watch |
|---|---|---|---|---|
| Inlet speed | Imposed left-boundary velocity scale. | Faster transport, stronger wake response and higher compressibility/stability risk. | Gentler, often steadier flow. | Wake length and time dependence. |
| Inlet mode | Spatial pattern of velocity imposed at the left boundary. | Not scalar. | Not scalar. | Uniform, shear-like or swirl-driven organisation. |
| Viscosity (ν) (current defect) | Intended kinematic viscosity, but presently ignored whenever valid explicit (\tau) is supplied. | No reliable live effect under current presets. | No reliable live effect. | Must be fixed before educational use. |
| τ collision time (advanced; actual authority) | BGK relaxation time used by the solver. | Higher derived viscosity and stronger relaxation timescale. | Lower derived viscosity, approaching stability limit near 0.5. | Currently overrides ν. |
| Grid resolution (advanced; structural) | Number of lattice cells across the width. | Finer obstacle raster and more flow detail at higher cost. | Coarser, faster and more diffusive-looking field. | Convergence should be tested before quantitative claims. |
| Obstacle preset / scale (advanced; reset-bound) | Solid geometry and characteristic size. | Larger obstruction and wider wake. | Smaller obstruction. | Separation, blockage and lattice stair-stepping. |
| Solver iterations / frame (advanced) | Number of complete lattice timesteps per display frame. | Faster simulated-time advance. | Slower evolution. | It is not automatic numerical refinement at fixed time. |
| Dye strength (visual) | Amount of passive tracer injected. | Brighter, denser tracer. | Fainter tracer. | Fluid dynamics remain unchanged. |
| Dye decay (visual) | Fraction of tracer retained. | Longer-lived dye. | Faster disappearance. | Dye memory versus current field. |
| Dye injection (visual) | Spatial pattern of ongoing tracer source. | Not scalar. | Not scalar. | Different source images can reveal different parts of the same flow. |
| Curl emphasis (visual) | Scale applied to curl display. | Brighter rotational structures. | More restrained curl map. | Does not alter vorticity. |
| Render mode (visual instrument) | Selects dye, dye+curl, speed, curl or density. | Not scalar. | Not scalar. | Distinct observables of one state. |
| Field fade / contrast / glow (visual) | Persistence and tonemapping of the displayed field. | More visual memory or emphasis. | Cleaner, flatter view. | No change to LBM populations. |
The strongest current simple control is Inlet speed. The strongest methodological control is Render mode because it teaches that a simulation and its visual instrument are not the same thing.
Presets as experiments
Vortex Street
The best introduction. A circular obstacle, left inlet and continuous dye streaks create a readable cylinder wake. Describe the result as a vortex-street-like wake unless a calibrated regime is established.
Ink Chamber
An open channel with an internal dye cloud. It is useful for passive-advection experiments, but the current description “Low viscosity channel” is unsupported because (\tau), not the declared (\nu), controls the solver.
Airfoil Flow
A rotated elongated ellipse produces a streamlined-obstacle wake. It is not a NACA airfoil. Rename the preset Inclined Foil, Elliptic Foil or Streamlined Obstacle, and remove “NACA-like.”
Turbulent Gate
Staggered blocks produce multiple interacting wakes and strong curl. The visual complexity is valuable, but the name should become Staggered Wake unless turbulence is validated through a documented dimensionless regime and diagnostics.
Quiet Tank
A lower-resolution, slower-drive regime intended for mobile performance and legibility. It is useful as a calm contrast, although the channel still has imposed transport and is not a sealed tank.
Recommended learning order: Vortex Street → Ink Chamber → Quiet Tank → Staggered Wake / current Turbulent Gate → Elliptic Foil / current Airfoil Flow.
Interactions
- Force adds a local velocity impulse to the fluid field. It is the closest interaction to stirring.
- Brush applies the selected target, which can include dye, velocity, obstacle or erasure depending on the current brush presentation.
- Spawn injects dye bursts or source-like tracer; it does not create fluid particles or increase conserved fluid mass in a literal particle sense.
- Erase attenuates dye and can remove user-painted obstacles. Base preset obstacles and channel walls are rebuilt or protected according to the obstacle masks.
- Painting an obstacle changes the boundary condition and can reorganise a large downstream region.
- Painting dye changes visibility but not momentum. Painting velocity changes the fluid field. These targets should be distinguished clearly in the HUD.
The interaction model is strongest when the visitor first changes an observational layer—dye—and then changes a causal layer—velocity or solid geometry—and compares the outcomes.
What this does not mean
Flow is not a molecular simulation. The nine populations are numerical distribution functions on a lattice, not nine kinds of molecule.
It is not a quantitatively calibrated wind tunnel or engineering CFD package. Length, time, density and viscosity are in lattice/display units; resolution is modest; boundaries are simplified; no validation or grid-convergence evidence is shown.
The current viscosity slider does not control the active relaxation time. Any viscosity, Reynolds-number or “thickness” experiment is invalid until that defect is corrected.
The elongated “airfoil” is a rotated ellipse, not a NACA profile. Lift, drag and pressure coefficients are not calculated.
A periodic wake is not automatically turbulent. The engine does not compute turbulence spectra, Reynolds stresses or an inertial range. “Turbulent” should remain a visual metaphor only if explicitly qualified; renaming is better.
Dye is passive. It neither increases density nor changes momentum. Brightness is not mass.
The Density render mode is not a high-fidelity pressure measurement. BGK D2Q9 is weakly compressible, and high inlet speeds can move beyond the clean low-Mach regime.
Solver iterations per frame advance more lattice steps; they do not necessarily improve accuracy at equal simulated time.
Bounce-back boundaries and low-resolution obstacles are grid approximations. Small geometry changes can reflect rasterisation as well as fluid response.
The defensible conclusion is:
Local collision and streaming on a lattice can generate a coherent macroscopic flow field whose structure is shaped by drive, boundaries and dissipation.
Why it belongs
Flow contributes transport through a continuous-looking field. Flock and Particle Life organise discrete agents; Stigmergy couples agents to a field; Flow makes the field itself the principal dynamical object. It also provides the atlas’s clearest lesson in computational instrumentation: dye, speed, curl and density are different ways of observing one simulated state.
Sources
Foundational and primary sources
- Osborne Reynolds, “An Experimental Investigation of the Circumstances Which Determine Whether the Motion of Water Shall Be Direct or Sinuous, and of the Law of Resistance in Parallel Channels,” Philosophical Transactions of the Royal Society of London 174, 935–982 (1883). DOI: 10.1098/rstl.1883.0029.
- Anatol Roshko, “On the Development of Turbulent Wakes from Vortex Streets,” NACA Technical Note 2913 (1953), later NACA Report 1191. NASA NTRS record.
- Uriel Frisch, Brosl Hasslacher and Yves Pomeau, “Lattice-Gas Automata for the Navier–Stokes Equation,” Physical Review Letters 56, 1505–1508 (1986). DOI: 10.1103/PhysRevLett.56.1505.
- Guy R. McNamara and Gianluigi Zanetti, “Use of the Boltzmann Equation to Simulate Lattice-Gas Automata,” Physical Review Letters 61, 2332–2335 (1988). DOI: 10.1103/PhysRevLett.61.2332.
- Y. H. Qian, Dominique d’Humières and Pierre Lallemand, “Lattice BGK Models for Navier–Stokes Equation,” Europhysics Letters 17, 479–484 (1992). DOI: 10.1209/0295-5075/17/6/001.
- Shiyi Chen and Gary D. Doolen, “Lattice Boltzmann Method for Fluid Flows,” Annual Review of Fluid Mechanics 30, 329–364 (1998). DOI: 10.1146/annurev.fluid.30.1.329.
Modern scientific context
- Sauro Succi, The Lattice Boltzmann Equation for Fluid Dynamics and Beyond (Oxford University Press, 2001).
- Timm Krüger et al., The Lattice Boltzmann Method: Principles and Practice (Springer, 2017). Comprehensive modern treatment of lattice units, collision operators, boundaries, stability and validation.