Fast CFD
A multi-threaded 2.5D Terrain-Following Grid Fluid Solver for fast urban aerodynamic and pedestrian wind comfort analysis.
Overview
Fast CFD is an ultra-fast Eulerian fluid dynamics simulator written directly in native C# for Rhino and Grasshopper. It numerically resolves the incompressible Navier-Stokes equations across a 2.5D terrain-following grid, accurately predicting Venturi channeling, corner accelerations, stagnation zones, and recirculating wake eddies around urban structures.
Designed specifically for early-stage massing design and site planning, Fast CFD runs in tens of milliseconds rather than hours, allowing interactive manipulation via Grasshopper sliders without locking the Rhino interface.
Key Features & Numerical Physics
⚡ Multi-Core Parallelization
Employs thread-safe Parallel.For loops across all solver stages (Grid Draping, Advection, Diffusion, and Poisson Pressure Projection)
with deterministic ping-pong buffers, delivering 5x–15x speedups on multi-core systems.
🏢 Zero-Gradient Neumann Boundaries
Enforces ∂p/∂n = 0 at building obstacle facets. Incoming air forms realistic physical stagnation pressure
and smoothly deflects around corners, completely eliminating artificial boundary vacuum sinks.
🚶 Pedestrian Comfort (Lawson Scale)
Computes local shear strain tensors to estimate sub-grid Turbulent Kinetic Energy (TKE) and Turbulence Intensity (TI), categorizing urban spaces into Sitting, Standing, Strolling, and Uncomfortable pedestrian zones.
📦 Pre-Cached Spatial Indexing
Context geometry bounding boxes are cached once before grid construction, bypassing hundreds of thousands of redundant 3D point-in-mesh raycasts and eliminating UI lag during initial grid draping.
Lawson Pedestrian Comfort Categories (LDDC Criteria)
- ☕ Sitting / Outdoor Dining (< 4.0 m/s): Calm microclimate suitable for long-term sedentary activities, cafes, and restaurant terraces.
- 🧍 Standing / Pedestrian Waiting (< 6.0 m/s): Gentle breeze suitable for building entrances, bus stops, and plazas.
- 🚶 Strolling / Leisure Walking (< 8.0 m/s): Comfortable for pedestrian boulevards, promenades, and shopping streets.
- 💼 Business Walking / Transit (< 10.0 m/s): Fast-paced walking along transit corridors, office thoroughfares, and commuter routes.
- ⚠️ Uncomfortable / High Gusts (> 10.0 m/s): Strong winds with potential wind turbulence that compromise pedestrian comfort.
Inputs (16)
- TerrainMesh (Mesh): Input Terrain Mesh
- ContextMeshes (Mesh): Buildings and context as closed meshes
- WindVector (Vector): Prevailing wind direction vector
- WindSpeed (Number): Baseline wind velocity (m/s) at reference height (default 10m meteorological wind)
- CellSize (Number): Resolution of the grid in meters.
- Iterations (Integer): Simulation steps (time steps). Automatically adapts to domain scale if lower than minimum flush.
- AnalysisHeight (Number): Drape offset above terrain for pedestrian evaluation (m)
- Viscosity (Number): Kinematic viscosity (diffusion/turbulence in m²/s, default 0.1)
- Friction (Number): Surface drag coefficient (0.0 to 1.0). Accepts item or list.
- ComfortThreshold (Number): User threshold for pedestrian comfort (m/s)
- BoundaryMask (Curve): Optional closed curve to crop the simulation domain and lock grid coordinates.
- Colors (Colour): Custom color spectrum override (min to max)
- WindRefHeight (Number): Meteorological measurement height for input WindSpeed (m). Default = 10.0m (scales to pedestrian height via ABL power law).
- Run (Boolean): Optional. False = skip the analysis and keep showing the last results (cached). Share one toggle with the Analysis Dashboard to switch everything on/off together.
- Direction (Number): Optional. Wind direction in degrees, meteorological: where the wind blows FROM, 0 = North, clockwise (as in EPW files and the Wind Rose). Overrides WindVector when connected.
- North (Number): Optional. Angle of true north from the model +Y axis, degrees counter-clockwise (Ladybug convention). Only used with Direction.
Outputs (9)
- WindMesh (Mesh): Heatmap of wind speeds mapped to the terrain
- Points (Point): Grid points corresponding to the vectors
- WindVectors (Vector): Wind velocity vectors for visualization (m/s)
- Colors (Colour): The color assigned to each point/vector
- Speeds (Number): Wind speed magnitude (m/s) at each point
- Dashboard Data (Text): JSON string for Dashboard and Legend
- Info (Text): Simulation data, Lawson comfort criteria, and timing
- VertexSpeeds (Number): Wind speed (m/s) at every WindMesh vertex (NaN inside buildings) - feed Analysis Heatmap / Point Probe / Analysis Difference with WindMesh
- BuildingMask (Boolean): One bool per WindMesh face, True = mostly inside a building (Mask input of Analysis Heatmap / Difference)
Method, assumptions and simplifications
The same notes appear in the component's Info output.
Method
- A regular plan grid of CellSize cells (minimum 0.5 m, at most 100,000 cells) covers BoundaryMask or the terrain. Each cell centre is draped onto TerrainMesh at AnalysisHeight; cells whose draped point is inside a closed ContextMeshes mesh are solid.
- Inflow speed = WindSpeed × (AnalysisHeight / RefHeight)^0.25 (power law, only when AnalysisHeight < RefHeight), in the direction of WindVector or of Direction and North.
- The initial field is the inflow scaled by a terrain factor 1 + 0.5 × slope along the wind, clamped to 0.7 to 1.4.
- Each time step solves 2D incompressible flow in the style of Stam's Stable Fluids: semi-Lagrangian advection (Courant number 0.5), implicit Jacobi diffusion with Viscosity (10 passes) using the same physical time step as advection (Δt = 0.5 × CellSize / speed, at most 0.5 s), so Viscosity (m2/s) and Friction act independently of CellSize and wind speed, and pressure projection by red-black SOR (ω = 1.6, 12 to 40 passes) with zero velocity in solid cells and zero-gradient pressure at their faces.
- Inflow is imposed on the two upwind domain edges and zero-gradient outflow with p = 0 on the downwind edges; ground drag multiplies speeds by exp(−Friction / max(0.5, AnalysisHeight) × Δt) each step. A per-cell Friction list is read column by column: columns from minimum X, and within each column from minimum Y; the last value repeats.
- Steps = max(Iterations, min(250, 3 × cells along the longest side)); after that many steps the run stops early once the largest change between two consecutive full steps, on a sample of cells, is below 0.005 m/s.
- Turbulence intensity per cell comes from a Smagorinsky estimate (Cs = 0.12): k = (0.12 × CellSize × strain rate)², σ = √(2k/3), TI = σ / speed; a gust speed = speed × (1 + 1.2 × TI) is classed with Lawson-style limits 4, 6, 8 and 10 m/s. ComfortThreshold is compared with the mean speed, so the two percentages are not directly comparable.
- Outputs: coloured WindMesh (0 to 1.5 × inflow speed), points, vectors and speeds outside buildings and inside the mask, VertexSpeeds (NaN in buildings), BuildingMask, Dashboard Data and Info.
Assumptions
- Model units are metres and the wind speed is a mean speed measured at RefHeight (default 10 m).
- The power-law exponent 0.25 fits suburban or wooded terrain; open or dense urban terrain would need another exponent.
- Buildings are closed meshes; anything shorter than AnalysisHeight above the terrain is not an obstacle.
- One steady wind direction and speed are analysed.
Simplifications and limits
- 2.5D: one horizontal layer at pedestrian height. No vertical flow, so downwash from tall buildings, roof overflow and thermal effects are missing.
- Not a validated CFD: no turbulence model in the momentum equations, coarse grids, and comfort classes from one wind scenario instead of an annual exceedance analysis.
- Gust factor speed × (1 + 1.2 × TI) is a heuristic and is not the gust-equivalent mean used by Lawson LDDC criteria.
- The terrain slope factor only sets the initial field; inflow and advection replace it as the domain is flushed.
- Cells where the ray misses the terrain are kept as open flow cells at the domain floor level.
Workflow
- Terrain mesh -> TerrainMesh; building meshes -> ContextMeshes; EPW or Wind Rose direction -> Direction.
- WindMesh and VertexSpeeds -> Analysis Heatmap or Analysis Difference; Dashboard Data -> Analysis Dashboard.
References
- Stam J. (1999), Stable Fluids, SIGGRAPH 99: semi-Lagrangian advection and pressure projection.
- Smagorinsky J. (1963), General circulation experiments with the primitive equations, Monthly Weather Review 91(3).
- Lawson T.V. (2001), Building Aerodynamics, Imperial College Press: pedestrian comfort criteria.
Best Practices & Guidelines
- Anchor with BoundaryMask: The Eulerian grid anchors to the bounding box of your geometry. When comparing architectural massing options, always supply a fixed
BoundaryMaskcurve so that cell boundaries do not shift between iterations. - Resolution vs. Speed: For quick massing sweeps, a
CellSizeof 3.0m–5.0m provides near-instant interactive updates. For final presentation graphics, reduceCellSizeto 1.5m–2.0m. - 2.5D Assumption: The solver computes a terrain-following 2D layer. It excels at simulating horizontal Venturi effects, gap flows, and wake eddies, but does not capture 3D vertical downwash vortices from tall skyscrapers.