Thermal Twin — a physics world-model of a building

💡 Inspiration

An energy audit of a building today costs thousands of euros, needs site visits, and takes months — and its result travels as a static PDF between the owner, the engineering firm, the architect and the operator, each re-reading it from scratch. The usual way to "know" a building better is to instrument it with sensors — which means up-front investment and ongoing maintenance most owners will never pay.

We are building-physics researchers at Centrale Lille · CNRS – LaMcube. Our method for reduced-order thermal digital twins was just selected for the Best Paper Award at SASBE / BDT 2026 (Cambridge University) — but, like most research, it lived in a notebook, unusable by the people who actually renovate buildings. OpenAI Build Week was the push to turn that peer-reviewed method into a working tool that runs from data a building already has — without adding a single sensor, so no investment and no maintenance.

🏗️ What it does

From already available data (indoor temperature, outdoor temperature, heating) and a floor plan — no added sensors — Thermal Twin builds a physics world model of the building that simulates what renovating the envelope would change. It:

  • identifies a physics-constrained thermal twin,
  • dates when the building drifts from its calibrated behaviour,
  • simulates counterfactuals — renovation scenarios costed in €, CO₂, payback, eligible French subsidies and regulation,
  • lets the four trades — owner, engineer, architect, operator — read one shared source of truth, each with its own reading and no document handoff, and
  • answers any question in plain language through a GPT-5.6 guide that never invents a number.

Because that shared source of truth is a structured, machine-readable model — a compact ontology of the building's thermal topology, not a PDF — each trade can interrogate the same model in its own terms. What used to be weeks of back-and-forth and thousands of euros becomes a diagnosis in minutes, for every actor at once. Built for the French building sector, on public databases: BDNB, ADEME DPE, and IGN BD TOPO.

🔬 How we built it

The science. The twin is a resistance–capacitance (RC) grey-box network — a continuous state-space model

$$\dot{\mathbf{x}}(t) = A(\boldsymbol\theta)\,\mathbf{x}(t) + B(\boldsymbol\theta)\,\mathbf{u}(t),$$

with node temperatures $\mathbf{x}$ and inputs $\mathbf{u} = (T_\text{out}, \dot{Q})$, integrated exactly by matrix exponential

$$\mathbf{x}_{k+1} = A_d\,\mathbf{x}_k + B_d\,\mathbf{u}_k, \qquad A_d = e^{A\,\Delta t}, \quad B_d = A^{-1}!\left(e^{A\,\Delta t} - I\right)B.$$

Each structure is a typed graph — effectively a small ontology of the building's thermal topology: one air node, thermal masses, and the resistances between them. Parameters are calibrated by L-BFGS-B in log-space (keeping every $R, C > 0$), and among 19 candidate $xR+yC$ structures the operating twin is chosen by the Bayesian Information Criterion $\;\mathrm{BIC} = N\ln\widehat{\sigma}^2 + p\ln N\;$ — the exact method from our paper.

Codex reverse-engineered our own method — and made us fast. It compressed what would have been weeks of research-code archaeology into a tested engine in days. From our paper and the original notebook, Codex reverse-engineered the method: it extracted the 19 $xR+yC$ connectivities and the data pipeline, reimplemented the identification engine (state-space, matrix-exponential discretization, L-BFGS-B calibration, metrics, BIC), and ported the carbon + subsidy engines (reproducing 1,727 tCO₂ / €650,400 under test).

Rebuilding it independently, Codex surfaced things we hadn't seen ourselves: discrepancies between our published method and our own notebook that we had not caught, and — running the multi-start at scale on real data — how severely the automated fit degenerates: the best-RMSE solutions land in physically impossible regions, with heat-loss coefficients of order $10^{6}!-!10^{8}$ W/K (the real value is ~63 W/K), reachable only away from the physical basin. That is the practical- identifiability result our paper formalises — but Codex made it concrete, quantified, and impossible to ignore, which is exactly why the product shows the twin's structure and its uncertainty instead of one confident-but-false number. It also fetched the real footprint from the IGN BD TOPO WFS and shipped 87 passing tests.

GPT-5.6 (gpt-5.6-terra) — including its vision — makes the building actors fast. Instead of waiting for a specialist to re-read a PDF, each trade interrogates the same model in plain language, instantly. GPT-5.6 is used in three grounded ways:

  1. The guide — the entire computed diagnosis is injected as context; it explains, reformulates for non-experts, and refuses out-of-scope questions with an alternative — never producing a number (every figure comes from the deterministic engine; we audited each cited value against the payload).
  2. Vision — GPT-5.6 looks at the floor-plan footprint our reader extracted and flags implausible extractions (a captured title block, a degenerate blob), a safety net a classical computer-vision pipeline can't give itself.
  3. Review of the optimization — GPT-5.6 audits the structure-selection bench and, on the reference run, independently flagged the same degeneracy — reaching, on its own, the conclusion our paper reports.

The product is a FastAPI backend + a vanilla-JS control-room UI (live run, role selector, MapLibre + deck.gl 3D building over IGN tiles). The twin is identified on the open PLEIAData dataset (Nature Scientific Data, 2023); the renovation layer is contextualised on a real French social-housing building via its BDNB/DPE record.

🧗 Challenges we ran into

  • Degenerate basins / non-robust heat loss — the honest answer was to surface the twin's structure and its uncertainty, not a single confident number.
  • Strict LLM grounding — every displayed number stays from the engine, cross-checked one by one; the model phrases, it never computes.
  • Four trades, one diagnosis — reorganising (never recomputing) the same evidence per role, so no actor waits on another.
  • Real geometry — the true footprint from the IGN WFS, rendered in 3D with a robust fallback.
  • Reproducibility & packaging — one-command install, offline caches, 87 tests, and shipping a 745 MB dataset via a Release.

🏆 Accomplishments that we're proud of

  • A peer-reviewed, Best-Paper method turned into a usable product in days — no sensors, no capex, no maintenance.
  • A twin, a dated drift, costed renovation scenarios, and a real 3D building — all from data buildings already have.
  • A GPT-5.6 layer that is grounded and self-auditing (it even independently caught our known identifiability degeneracy), backed by 87 passing tests and reproduced reference figures.

📚 What we learned

  • Honest uncertainty beats false precision — and it can be a product principle.
  • Codex turns research into product — faithfully reimplementing a paper, with tests, is exactly where an agent removes the friction between published and usable.
  • Grounding an LLM is a discipline, not a prompt — inject the full computed payload, forbid invented numbers, and audit every cited figure.
  • GPT-5.6's vision genuinely QAs a geometry pipeline that couldn't check itself.

🚀 What's next for Thermal Twin

  • Semantic interoperability — align the twin and the BDNB/ADEME data to standard building ontologies (SAREF, Brick, BOT, ifcOWL) so it plugs into BIM (Building Information Modeling) and BMS (Building Management System), and the four-trade "single source of truth" becomes a formal shared semantic layer across a whole portfolio.
  • Portfolio scale — a park view over many buildings from BDNB, prioritising who to renovate first.
  • Plug into data that already exists — meter / BMS / smart-thermostat feeds where a building already has them, still without installing anything new.
  • More retrofit templates, region-specific subsidies, and a pilot with a French social landlord.

Repo: https://github.com/Saadzwak/Digital-twin_building — peer-reviewed paper, 87 tests, and the full demo.

Built With

Share this project:

Updates