Bijay Karki

WindFlow

Real-time indoor airflow on the GPU: a D3Q19 lattice Boltzmann solver with LES, written in C#.

Air · In development · 2026

A 2D lattice Boltzmann airflow simulation of a classroom plan, running live in the browser: the same method WindFlow uses in 3D.
Demo video coming soon
Solver
D3Q19 lattice Boltzmann, regularized BGK, Smagorinsky LES
Particles
Up to 1,000,000 on the GPU
Throughput
About 2,500 to 2,900 MLUPS on an RTX 5070 Ti
CPU vs GPU
Parity within 0.02%
Orifice-equation check
Cross-ventilation ratio 0.973

Problem

Architects decide where the openings go long before anyone simulates how air will move through the rooms. A CFD study is slow to set up, so it often comes too late.

I wanted to move a window and see the air respond.

Data and physics

The input is a building model with an outdoor margin around it. Openings can be toggled live, and fans, AC units, exhaust and diffusers are body-force regions.

Buoyancy runs on a coupled D3Q7 thermal lattice (Boussinesq, Guo forcing). A nested 2:1 fine simulation box is available for isothermal cases.

Method

The solver is D3Q19 lattice Boltzmann with a regularized BGK collision and Smagorinsky LES. One kernel serves both the CPU and the GPU, using ILGPU with CUDA, OpenCL or a CPU fallback.

Up to a million GPU particles with trails show the flow. Slices, probes and room metrics (air changes per hour, mean speed, stagnant fraction, age of air) sit alongside. The app exports a PDF report, a turntable MP4 and screenshots.

Result

WindFlow is in development: there is no public release and no public link yet. The analytic and self-consistency checks pass, including the orifice-equation check for cross-ventilation (ratio 0.973) and CPU/GPU parity (0.02%).

Validation against measured-room benchmarks is still in progress, so for now I treat the results as comparative rather than validated.

Built with: C# · .NET 10 · ILGPU · Avalonia · Direct3D 12

Next project · EarthQuakeLiveA live earthquake explorer in the browser: plain-language summaries and the full technical record.