Spotlight #52 – Geometry, Swarm Intelligence & Fluid Dynamics

Wave 55 expands three simulation categories: discrete geometry with the full family of convex regular and semi-regular solids; collective behaviour with a fish-school Boids model and a hunting predator; and computational fluid dynamics through a real-time SPH dam-break.

Three Categories Explored

mysimulator.uk tracks category depth as one quality metric. Wave 55 strengthens three distinct domains — from the timeless mathematics of polyhedra to the computational physics of particle-based fluids.

🔷

Geometry

Platonic and Archimedean solids, Bézier curves, fractal attractors, and topological invariants.

🐟

Swarm Intelligence

Emergent collective motion from local rules: Boids flocking, ant-colony optimisation, flock formation.

💧

Fluid Dynamics

Lagrangian particle methods, boundary-layer flow, Bénard convection cells, and wave propagation.

🔷 Discrete Geometry — Polyhedra and Euler’s Formula

The study of polyhedra — solid figures bounded by flat polygonal faces — stretches from Plato's Timaeus (c. 360 BC), which identified four solids with the classical elements, to Euler's surprising topological theorem, to modern applications in crystallography and computer graphics.

Why only five Platonic solids?

A Platonic solid requires (a) all faces to be the same regular polygon and (b) the same number of faces to meet at each vertex. For the solid to close up, the total angle at each vertex must be less than 360°, otherwise the faces lie flat or fold back on themselves. There are exactly five solutions:

Six equilateral triangles would tile a flat plane (360°), not close; five squares would exceed 360°. The constraint is tight — there is no room for a sixth Platonic solid.

Euler's characteristic: V − E + F = 2

In 1752 Leonhard Euler noticed that for every convex polyhedron the quantity V−E+F equals exactly 2. This was remarkable because it held regardless of the shape: a tetrahedron (4−6+4=2), a cube (8−12+6=2), an icosahedron (12−30+20=2), and even a truncated icosahedron (60−90+32=2).

V − E + F = χ — the Euler characteristic χ is a topological invariant. For surfaces homeomorphic to a sphere (genus g=0), χ=2. For a torus (g=1), χ=0. Polyhedra with holes can satisfy different values: a cube with a square tunnel has χ=0. This bridges combinatorics and topology.

Archimedean solids and truncation

The 13 Archimedean solids are convex, vertex-transitive polyhedra with two or more types of regular polygon face. They arise naturally from the Platonic solids by truncation (cutting off vertices), rectification (cutting to edge midpoints), snubbing (twisting), and cantellation (expanding faces outward). The truncated icosahedron — 60 vertices, 90 edges, 32 faces of pentagons and hexagons — is identical to the pattern on a standard football and to the C₆₀ buckminsterfullerene molecule (Buckball).

🐟 Swarm Intelligence — Emergence from Local Rules

Swarm intelligence describes the collective, self-organised behaviour emerging from local interactions between simple agents. No central controller directs the swarm; each individual follows only nearby information. Yet the group-level patterns — coherent flocks, branching trail networks, coordinated panic responses — can rival the output of any centralised system.

Craig Reynolds' Boids (1986)

Reynolds' original Boids paper (SIGGRAPH '87) showed that three rules suffice to produce realistic flocking:

  1. Separation: avoid crowding immediate neighbours.
  2. Alignment: steer toward the average heading of nearby neighbours.
  3. Cohesion: steer toward the average position (centre of mass) of nearby neighbours.

The three radii — rsep < rali < rcoh — create nested zones of influence. Fish School 3D uses rsep=28, rali=55, rcoh=80 px with three depth layers giving pseudo-3D appearance at Canvas 2D cost.

Predator-prey dynamics in flocks

The new Fish School 3D adds a hunting shark that triggers a panic response in fish within its patrol radius. This reproduces several documented field phenomena:

The trade-offs in schooling are not costless. Dense schools compete for food; swimming in a school increases drag for most non-leader fish (hydrodynamic wake interference); and bright aggregations are more easily spotted from a distance. The optimal flock size is a dynamic balance of these forces — which is why you see dense balls of baitfish at high predation risk and diffuse loose aggregations in low-risk conditions.

💧 Computational Fluid Dynamics — SPH

Computational fluid dynamics (CFD) is the numerical simulation of the Navier–Stokes equations. Two families of methods dominate: Eulerian (mesh-based: finite-volume, finite-element, finite-difference) and Lagrangian (particle-based: SPH, DEM, MPM). SPH belongs to the Lagrangian family and has properties that mesh methods lack.

Why go Lagrangian?

Mesh methods struggle with problems involving large deformations, free surfaces, and multi-phase flows: the mesh must be regenerated or deformed at every step. In SPH the particles carry the flow with them — free surfaces are automatically tracked, no mesh is needed, and fragmentation is trivial. The price is that SPH is O(N²) naively (though spatial hashing reduces this to O(N log N)) and less accurate than high-order finite-element methods for smooth flows.

The pressure-viscosity-gravity system

The simulator integrates three force contributions every substep:

Boundary elastic reflection with damping factor 0.4 models the energy absorption of real concrete walls. Three substeps per animation frame (dt=0.004 s each) keep the CFL stability condition satisfied at 60 fps.

A brief history of SPH:
1977 — Lucy and independently Gingold & Monaghan invent SPH for astrophysical collapse simulations.
1992 — Monaghan adapts SPH to free-surface flows and dam breaks.
1996 — Desbrun & Cani improve the kernel choice for graphics-quality water.
2003 — Müller, Charypar & Gross popularise SPH for real-time game fluids.
2010s — GPU-accelerated SPH reaches tens of millions of particles in interactive demos.
Today — SPH is standard in tsunami modelling, galaxy collision simulations, and industrial forming processes.
← Spotlight #51: Immunology, Magnetism & Electrochemistry Blog index →