Crossdraft

How the simulation works, and what it cannot tell you

Crossdraft runs a small 2D stable-fluids solver in your browser. This page explains the method, the numbers it reports, its assumptions and its limits.

Last updated:

The method in brief

The drawing is a grid of cells. Each cell holds a velocity, a pressure and three tracers: fresh air (0 to 1), air age in seconds and temperature rise. Every step the solver applies forces, moves the velocity along itself (semi-Lagrangian advection), removes compression with a pressure solve so that the air behaves as incompressible, then carries the tracers along and mixes them slightly.

This is the "stable fluids" approach of Jos Stam (1999), chosen because it stays stable at any wind speed, which suits a teaching tool. Small eddies are kept alive with vorticity confinement (Fedkiw, Stam and Jensen, 2001). Fans are jets of fixed speed, heaters are cells held above ambient temperature, and screens, plants and curtains are porous cells that let air through but slow it with quadratic drag.

What the numbers mean

For each closed room the app reports:

  • Fresh air: the average share of air that has come from outside, from 0% to 100%.
  • Dead zone: the share of the room whose smoothed air speed is below a threshold, 0.1 m/s by default.
  • Draught comfort: 100% while the speed stays under 0.3 m/s, falling to 0 at 1.5 m/s.
  • Air age: how long, on average, the air has been inside.
  • T90: the time for the room to reach 90% fresh air starting from still, stale air.
  • Score: 50 × stale air flushed + 30 × (1 − dead zone) + 20 × comfort, out of 100. It is a way to compare two layouts under the same test, not a standard.

Assumptions and limits

Read results with these in mind:

  • It is two-dimensional. A plan has no ceiling height effects other than a fixed heat conversion; a section has no depth.
  • The wind is uniform across the board. Real wind changes with street layout, height and season, and the preset winds are typical values for teaching, not site data.
  • Openings are open gaps. Window sashes, louvres, insect screens and doors that swing are not modelled.
  • The grid is coarse (0.25 m cells in a plan) and turbulence is represented by a simple mixing term, so small features and exact speeds are not reliable.
  • Corner cells can show unrealistically high speeds. Treat peak speeds with caution and compare layouts rather than reading single values.
  • It does not model pollutants, humidity, solar gain, occupants or mechanical systems.

Open source

The code is public on GitHub, including the solver and the tests that check it. If you spot a mistake in the physics or in the text, an issue or pull request is welcome.