Where a Building Digital Twin Sits on the Web: The Analytical Type
Web visualization of wind and sunlight around a building is an analytical digital twin: a real object represented electronically so that users can inspect its state and the transitions between states (Voas et al., 2025). This kind of digital twin connects no sensors. Its inputs are an offline CFD result and the building geometry, and its output is a 3D scene in the browser that can be rotated, switched between layers, and scrubbed through time of day. For the overall path of getting a building model onto the web, see From BIM and CAD to Web 3D.
The method resamples the solver's unstructured mesh result onto a regular grid and quantizes it, then precomputes streamlines and sections, so the browser can display the wind field and pedestrian-level wind speed in real time. This article covers each step in order, with its parameters, error, and range of applicability.
Inputs and Division of Work
The client's engineering team solved the CFD with OpenFOAM's simpleFoam, a steady-state, incompressible, turbulent solver based on the SIMPLE algorithm (OpenFOAM source documentation). The turbulence model is k-omega SST, and the mesh has about 11 million cells. The development team handles the data engineering and web visualization that come after the results.
| Item | Responsible party | Content |
|---|---|---|
| CFD solving and meshing | The client's engineering team | Steady simpleFoam, k-omega SST, about 11 million cells |
| Building geometry | CAD-grade STL provided by the client | Exterior shape and ground elevation |
| Resampling, quantization, streamlines, sections, isosurfaces | Development team | Offline data pipeline that outputs regular-grid assets |
| Display geometry | Development team | STL decimated and exported as a single GLB |
| Web layers and interaction | Development team | Three.js; wind, wind pressure, sunlight, and surface temperature layers |
The inflow speed was normalized to about 1 m/s in the solve, so every value in the field is a velocity ratio: local wind speed divided by a reference wind speed, not an absolute speed. The velocity ratio is a common metric in wind environment assessment; Hong Kong's air ventilation assessment uses it as the primary indicator (Ng, 2009). Converting to m/s requires a reference wind speed from local meteorological data.
From an Unstructured Mesh to a Regular Grid
The solver mesh is refined around the buildings, so its points are unevenly distributed, while a browser GPU texture needs a regular layout. The pipeline reads the last time step, the converged state; a steady-state solve approaches equilibrium by iteration, and only the final result is meaningful. The sampling box is about 600×600×200 m, resampled to a 176×176×56 regular grid, about 3.4 m horizontally and 3.6 m vertically per cell. The pedestrian level at 1.5 m is cut separately into a 512×512 slice, at a higher resolution than the 3D field.
Resampling uses probe-style interpolation: each regular grid point is interpolated with the shape functions of the solver cell it falls in, and points outside the box or inside buildings are flagged invalid. This interpolation is continuous but not conservative. It suits value lookup and visualization, and does not suit re-solving or computing fluxes.
In uint8 quantization, the choice of upper bound determines accuracy at pedestrian scale. For the 3D field, the bound for the velocity components is the maximum absolute value after discarding the largest one thousandth of values, and for speed magnitude it is the 98th percentile. This keeps a few outlying jets from raising the bound and compressing away the differences near pedestrian height. The rounding error of quantization is about ±0.4% of the bound. Computed from a 176×176×56 grid with four uint8 channels, the uncompressed 3D field is about 7 MB. That figure is derived from the grid dimensions, not a measured transfer size.
- CFD results (solved by the client)About 11 million cellsSteady simpleFoam, last time step
- Resampling176×176×56Sampling box about 600×600×200 m; pedestrian level 512×512
- uint8 quantizationError about ±0.4%Clip value set by percentile
- Streamlines, sections, isosurfacesPrecomputed offlineRK2 streamlines; isosurfaces smoothed, then decimated
- Display geometry GLBSingle fileShape-preserving STL decimation
- Web layersThree.jsThe browser reads precomputed assets
Stage names and parameters are the actual pipeline steps; units differ between stages, so the stages are not drawn to scale. Cells are solver mesh cells; the regular grid holds the resampled points.
The Pedestrian-Level Slice
The pedestrian level sits 1.5 m above the ground and is exported as one heat map of velocity ratio. The map answers wind conditions at entrances, seating, and walkways directly, which is why its resolution is raised separately to 512×512. The color scale is set to the slice's actual maximum. A single height has few outliers, so the full dynamic range is kept; this differs from the percentile scaling used for the 3D field, and the two are separated deliberately by purpose.
Comfort is classified in three levels: calm, comfortable, and strong, with thresholds at velocity ratios of 0.4 and 0.8. These are illustrative screening thresholds and do not correspond to the Lawson criteria or the NEN 8100 classes. The area ratios on screen are shares of space: the ratios describe the distribution of velocity ratio across ground locations, with no time weighting.
Streamlines: In Steady Flow, Streamlines Equal Pathlines
In a steady flow field, streamlines coincide with the pathlines of fluid particles, so streamlines showing how wind flows around a building have a physical basis. The limitation is that these are streamlines of time-averaged RANS and do not include instantaneous gusts or vortex shedding.
Integration uses the RK2 midpoint method: a half step to find the midpoint direction, then a full step. In high-curvature regions such as wakes, this follows the actual path more closely than the Euler method. The step length is fixed at 3 m along the arc, which decouples vertex spacing from flow speed and keeps vertices evenly distributed in fast and slow zones. Each streamline is integrated once upstream and once downstream, then joined, so a line passing through a point of interest is complete at both ends.
Seeding determines coverage. The windward face has 9 height layers, showing the gradient of the boundary layer, slow near the ground and fast aloft. The pedestrian level gets another 90 seeds, because the assessment cares most about where the wind goes where people stand. Integration has three stopping conditions: leaving the domain, entering an invalid region, and speed falling below 2% of the bound. A streamline that ends somewhere reflects the algorithm's stopping criterion; the wind has not stopped there.
Vertical Sections and Isosurfaces
A vertical section parallel to the mean flow direction draws the boundary-layer velocity gradient, roof acceleration, and wake deficit on a single cut plane. An isosurface extracts the surface of equal velocity ratio, a method in the Marching Cubes family (Lorensen and Cline, 1987, which handled isodensity surfaces in medical scans). The thresholds are 0.35, 0.55, 0.75, and 0.95 times the 98th percentile of the whole field, giving 4 nested shells. The low-threshold shell encloses the low-speed wake, and the high-threshold shells outline the acceleration zones. Percentiles are used instead of fixed m/s values because the field itself is a dimensionless velocity ratio.
Smoothing has two stages in a fixed order. Before extraction, the field gets a Gaussian smooth (radius 3, standard deviation 1.6) that lowers the noise from resampling and quantization, so isosurfaces join up instead of breaking into small islands. After extraction, each layer is decimated to about 16,000 faces and then given 40 iterations of Taubin smoothing. Taubin's method is a low-pass filter that alternates shrinking and inflating steps, designed to remove high-frequency stair-step jaggedness without shrinking the shape (Taubin, 1995). With plain Laplacian smoothing, a closed shell shrinks gradually over many iterations and drifts from the original isovalue position.
Display Geometry Is Not the Simulation Mesh
The STL provided by the client is a CAD-grade triangle mesh, with about 304,000 faces in the main tower. The pipeline first welds and patches seams in Blender, then merges adjacent coplanar faces, reducing the count to about 20,000 with the exterior shape unchanged, and finally exports a single GLB. Coplanar merging introduces no geometric error on flat surfaces. Walls, floor slabs, and roofs are mostly flat, so the reduction is large while the shape stays put. The decimated mesh guarantees only that the visible shape is correct and guarantees no physical quantity, which makes it a display mesh and not a simulation mesh. For general decimation and texture practice, see 3D Model Optimization: Before and After.
Sunlight and Shadows
The sunlight layer uses an astronomical sun position formula, converting declination, hour angle, and spherical trigonometry into altitude and azimuth. Latitude is set to the single latitude of the site, and the hour angle is approximated by local apparent solar time, with no equation-of-time or longitude time zone correction. Accuracy is lower than NREL's SPA algorithm, with errors on the order of a few degrees or a few minutes, which is sufficient for judging obstruction. The view provides three sun paths for the summer solstice, the equinoxes, and the winter solstice, plus a time-of-day slider. Winter solstice shadows are the longest and summer solstice shadows the shortest, so the range of shading across the year is covered.
Shadows are computed with shadow maps. This is geometric occlusion, the shadow edges are hard with no penumbra, and the screen brightness is only a visual adjustment that does not represent irradiance. The sun geometry and occlusion in the sunlight layer are exact, but neither is physically coupled to the wind field. With both layers on, the view is a side-by-side comparison, and neither layer is computed from the other.
The building facade has two more layers. The wind pressure layer resamples the pressure field delivered by the CFD onto the same regular grid, normalizes it symmetrically with sign, and samples along the facade normal, with red for positive pressure and blue for negative. Because inflow normalization cannot reliably pin down the reference dynamic pressure, this layer is a relative distribution of positive and negative pressure and is not a structural design pressure. The temperature layer runs a surface energy balance on the sol-air equivalent temperature: solar radiation, whether the surface is sunlit, and convective cooling from local wind speed, combined with live weather input, give relative hot spots and cool zones on each facade. This is an empirical energy-balance proxy, not thermal CFD and not a perceived-temperature index such as PET or UTCI.
The client's engineering team
- CFD solvingsimpleFoam, k-omega SST
- CAD-grade STLBuilding geometry
The development team's offline pipeline
- Resampling and quantizationRegular grid, uint8
- Streamlines, sections, isosurfacesPrecomputed
- Shape-preserving decimationOutputs GLB
User's browser
- Wind field and pedestrian-level layersStreamlines, heat map, sections, isosurfaces
- Facade and sunlight layersWind pressure, sol-air temperature, sun position and shadows
Stays out of the browserThe solver mesh and the CFD solving process; the browser reads only precomputed assets
Scope is the data flow described in this article; wind and sunlight are not physically coupled.
Data Size and Memory on the Web
The browser reads regular-grid textures, precomputed streamlines, and one GLB. It receives no solver mesh and does no integration or surface extraction on the client. The moving light-point animation along streamlines runs on the GPU, and density is adjusted by random thinning with no recomputation. Memory used by textures and geometry has a ceiling on phones; for how to work out the budget, see A Memory Budget for Mobile 3D, and for overall performance practice, see Web 3D Performance Engineering. This article lists no frame rates, because an unmeasured frame rate carries no meaning.
For the general scope of building this kind of interactive scene, see 3D web design services.
How the Results Feed Design Decisions
Every layer is positioned as a relative comparison during design: different schemes for the same site are placed side by side to see which has better wind and sunlight conditions. The table below lists the design item each layer informs.
| Layer | What it shows | Design items it informs |
|---|---|---|
| Pedestrian-level velocity ratio heat map | Ground areas with strong or weak wind | Building spacing, entrances and seating placement, planting |
| Streamlines | Paths of flow around buildings, acceleration, and wake recirculation | Setbacks, building spacing, tower offsets |
| Vertical sections and isosurfaces | Roof acceleration, wake depth, extent of low- and high-speed zones | Massing height and tapering, opening heights |
| Facade velocity and relative wind pressure | Which facades and corners carry relatively larger wind loads | Opening locations, chamfered corners, podium and balcony depth |
| Sunlight and shadows | Shaded areas at each time of day | Building spacing, setbacks, shading, deciduous tree placement |
| Sol-air facade temperature | Relative hot spots and cool zones | Priority of shading structures, planting, and facade materials |
Wind assessment in planning has documented practice to follow. The guidelines compiled by a working group of the Architectural Institute of Japan describe the computational conditions for predicting the pedestrian wind environment with CFD, based on seven test cases from CFD, wind tunnel, and field measurements (Tominaga et al., 2008). The k-omega SST model combines near-wall k-omega with far-field settings, and the original paper reports that the model improves the prediction of flows with adverse pressure gradients (Menter, 1994).
Data Needed to Go Further
The current results stop at relative comparison during design. Going further has a clear input requirement for each item, shown in the diagram below.
- Already in hand: 3D wind velocity ratio fieldSingle wind direction, relative values
- Absolute wind speed neededAdd the local meteorological reference wind speedVelocity ratio times reference speed
- Review-grade wind comfort conclusion neededCFD for each wind direction, wind rose, and frequency integrationReplace thresholds with standard absolute speeds and exceedance frequencies
- Structural wind pressure coefficients neededSurface pressure and reference dynamic pressureNondimensionalize by dynamic pressure
- Thermal comfort or wind-thermal coupling neededTemperature field and radiation dataIncludes a solution of the energy equation
Based on the current state of the pipeline described here; the input needs are data requirements and involve no code rewrite.
The standard assessment of pedestrian wind comfort has two steps: first obtain velocity ratios from CFD, then multiply by the local meteorological frequency of each wind direction and each wind speed class, and integrate to get the probability of exceeding a threshold speed. Only the first step is done at present, so the view draws no conclusion of comfortable or uncomfortable.
Cases That Do Not Fit
- A review-grade wind comfort conclusion is needed: this requires a full wind climate analysis and the review process.
- Only a static slide deck exists, with no schemes to compare.
- No converged CFD result is available.
- A conclusion on thermal comfort or wind-thermal coupling is needed, and no temperature or radiation data is at hand.
Data to Prepare Before Starting
- The CFD results and the format, plus the coordinates and ground elevation.
- The reference wind speed of the inflow.
- CAD or BIM geometry.
- The number of schemes to compare.
- The range of users and devices.
- The latitude of the site.
Once the data is ready, the contact page is the place to describe the site and the comparison goals, so the data pipeline and layer scope can be assessed further.
