Posted in

Build HVAC Digital Twin with Foundry Local

This article explains building an HVAC digital twin with an AI copilot using Foundry Local. It covers system architecture (React/Three.js frontend, Node backend), 1R1C thermal and CO₂ models, real-time simulation, natural language control, visualization, and fault injection for operator workflows.

Building operations now can run a local AI copilot with Foundry Local integrated into a physics-based HVAC digital twin. This change combines real-time simulation, 3D visualization, and local generative AI for explainable operations.

Main feature and impact

The main feature is Foundry Local enabling on-premise AI copilot access to digital twin state. It provides contextual natural language answers without sending building data to external clouds. Operators gain faster root-cause explanations and local control while meeting data residency and latency requirements.

Practical implications

Teams can deploy a three-tier stack: React/Three.js frontend, Node.js simulation backend, and Foundry Local for AI. The simulator uses 1R1C thermal models and CO₂ mass balance for real-time fidelity. This architecture supports live WebSocket updates, manual overrides, and copilot-driven commands with auditable actions.
“The conference room is 3 degrees too warm because the VAV damper is stuck at 40% open, reducing airflow by 60%.”
The simulator runs deterministic physics models each timestep to update temperatures and CO₂. ZoneThermalModel computes heat capacity, envelope losses, internal gains, and HVAC heat exchange. AirQualityModel applies occupant CO₂ generation and outdoor ventilation mass balance. Simulation outputs feed KPIs, anomaly detectors, and copilot prompts. The frontend uses React Three Fiber for rendering and real-time color-coded zones. Users can click equipment to inspect telemetry and send control requests. The backend exposes REST endpoints for control and copilot queries, and WebSockets for live state pushes. Foundry Local SDK handles local model scoring and conversational context assembly. Operational workflows change: operators ask natural language questions for diagnostics and recommended actions. The copilot can suggest setpoint changes, flag stuck actuators, or propose demand response strategies. Fault injection and scenario testing can train the copilot and validate automated interventions before deployment. Next steps are deploying a pilot and validating model fidelity against measured data. Start with one floor, tune 1R1C parameters to match logged temperatures, and enable copilot read-only queries before granting command privileges. Monitor audit logs and iterate on anomaly detection thresholds.

Key points from the article:

  • Three-tier architecture separates visualization, simulation, and state management.
  • 1R1C thermal model enables fast, realistic zone temperature simulation.
  • CO₂ mass balance model estimates indoor air quality and ventilation effects.
  • React Three Fiber provides real-time 3D visualization of building state.
  • Foundry Local powers on-premise AI copilot for contextual natural language queries.
  • Related Coverage:

    From the Microsoft Developer Community Blog articles