Skip to main content
To KTH's start page

Open-source models for holistic building energy system design at scale (Completed)

Buildings and cities are becoming increasingly integrated into the energy supply system, creating a need for transparent, trustworthy, and holistic information for potential prosumers. This project is building the foundation for easy-to-access and automate building energy models to support distributed decision making and the energy transition.

Image of Karlstad Kommuns 3D city geometry used for building simulations
Image of Karlstad Kommuns 3D city geometry used for building simulations

Background

The need to improve energy efficiency and manage supply in buildings and cities is a core aspect of many climate change mitigation and sustainability scenarios. Demand for prosumer technologies, such as solar photovoltaics (PV), batteries, and electric vehicles (EV), is growing rapidly. At the same time, electrified heating already places a large demand on the electricity grid, therefore guiding a diverse set of citizens towards the best technical, economic, and social solution for the energy system is a challenge.

There is a long history of research in urban building energy models (UBEM) and several closed- and open-source software packages have been developed. These tools are typically used by researchers, city planners and policymakers, whereas the ones actually taking decisions – the building owners – typically get their information through commercial channels where biases and information asymmetry can create sub-optimal outcomes.

Solar maps are a good example of a public facing information source, where users can see the potential of their roofs for solar PV generation without needing to go through a salesperson. The utility of solar maps was boosted by our previous project , where the tools provide an analysis and specific recommendation with the same detail as a solar installer. Advances in data collection, geographic information systems, and machine learning make this possible, and this project aims to bring this same functionality to all aspects of building energy systems in support of prosumers contributing to the energy transition.

Aim and objectives

This project aims to democratize energy system design and empower building owners with trustworthy information for holistic analysis of sustainable technologies.

  • Identify the minimum viable dataset required to adopt and apply the proposed models
  • Build an integrated prosumer energy systems model which can automatically design and recommend a holistic solution considering demand and supply
  • Create an open-source code base that can be easily transferred to any municipality in Sweden

Project partners

rebase.energy, AIT Austrian Institute of Technology, Karlstads Energi, Karlstad Kommun

Funding is provided by the Swedish Energy Agency’s E2B2 program (project number P2022-00903).

Timeframe: January 2023 – December 2024 (Extended to June 2025)

Outcomes

This project was an ambitious attempt to combine urban building energy models, data driven models, private datasets, and public datasets and turn them into a scalable digital energy advisor for Swedish buildings. While the potential for such a tool exists, shortcomings of UBEMs and barriers to open data were discovered that makes future development more challenging than previously thought. UBEMs are good at simulating large building stocks with low error in aggregate, but providing individualized energy advice without user contact or input to the model results in unacceptably high variance in accuracy (+/- 30%) relative to the effort needed to build them.

The need to anonymize meter data from villas due to GDPR creates challenges for model development and validation. A novel approach to labeled the meter data was developed using the energy performance certificate dataset and unsupervised learning techniques. The resulting models did not improve over UBEM models in the literature, however direct comparisons were limited due to the scope of the model developed here applying to all energy demands, not just space heating. From a practical standpoint, the data driven models are easier to deploy at scale, and require less computation time, once trained, therefore even if errors are not reduced with this method, they can be a more viable alternative to UBEMs.

In contrast, energy supply models are relatively easy to simulate as there are several validated models for technologies like solar PV, batteries, and heat pumps available. However, the results here show that a modeling pipeline is needed to provide continuously updated analysis due to rapidly changing market conditions. Electricity prices have become volatile and a cannibalization of PV value is beginning to emerge even though Sweden receives less than 3% of its electricity from solar. The new model presented here using EnergyDataModel and enflow frameworks in Python, can help automate and standardized the analysis. And since it is published open-source, its also fully transparent.

Two open-source frameworks were launched as part of this project, targeting energy data scientists and modelers as the target user group. The first is called EnergyDataModel , and it provides a Python-based data model that helps to write more modular and readable code. The second is called enerflow , and is a Python framework inspired by OpenAI’s Gymnasium that helps in writing modular and reproducible energy models that solves sequential decision problems. Our hope is that the developments of this project are the beginning of a new era in collaboration and sharing of energy systems models and data to accelerate our knowledge of sustainable energy in buildings and cities.

Publications

Scientific Articles

Song, Y., Sommerfeldt, N. Data driven models for hourly electricity load profiles in Swedish villas. Submitted in Q4 2025, full details added once published.

Sommerfeldt, N., Riberi, M., Haglund, S. Optimal prosumer battery sizing and operations under price volatility. Submitted in Q4 2025, full details added once published.

Sommerfeldt, N., Höjer, M. (2024) The Potential and Limits of Digital Energy Advisors. 10th International Conference on ICT for Sustainability (ICT4S), 24-28 June 2024, Stockholm, Sweden. 10.1109/ICT4S64576.2024.00042

Master Thesis

​​​​​​​Andersson, E. and Höijer, H. (2023) Sustainable urban energy transition for the City of Bitola, North Macedonia. KTH M.Sc. Thesis.  ​​​​​​​

Lundholm, S. (2023) Techno-economic analysis of solar and battery systems. KTH M.Sc. Thesis.  ​​​​​​​

Open-Source libraries

EnergyData Model ( www.energydatamodel.org ), GitHub Repository

enflow ( www.enflow.org ), GitHub Repository

Data Protection

This project is guided by the EU General Data Protection Regulation (GDPR) ​​​​​​​.

Public and private data associated with individual households will be used during the course of this project, and includes;

  • The full database of energy performance certificates (energideklaration in Swedish), as of July 2023, acquired from Boverket. This data can be traced back to individual households, but is also part of the public domain ​​​​​​​.
  • Anonymized historical electricity and heat meter data, with hourly time resolution, from hundreds of residential buildings within Karlstad Energi’s customer base. This data is not associated with and cannot be traced back to individual households.
  • 3D building geometry from Karlstads kommun, which is already in the public domain ​​​​​​​.

This data will be used in novel simulation methods, as either inputs or to validate outputs, used to predict the hourly energy demand of any real residential building at a city-wide scale. The demand profiles generated during the project will be informed by the original data listed above, but will only be representative of what a typical demand profile can look like. At no point will any original data from any of the sources be published publicly or used for purposes outside the scope of the project.

The original data used by KTH and AIT researchers during the duration of the project will be deleted from their respective computers/servers within six months of the project’s completion (June 2025).

Individuals may voluntarily provide permission to associate their meter data with their household. It is their right to, at any time during the project, to withdraw their consent and have their data removed from the project dataset.

Contact details for the project responsible, Nelson Sommerfeldt, can be found at the bottom of the page. The KTH data protection officer can be contacted at dataskyddsombud@kth.se ​​​​​​​

Contact person

Nelson Sommerfeldt
Nelson Sommerfeldt researcher
SPORT-RENOV: Innovative approaches for renovating sport facilities in Europe
Environmentally friendly lubricants for high temperature heat pumps with low GWP refrigerants
Under the Dome: An Educational Journey into Urban Energy Solutions
LABS – LABoratory Scale model for Borehole Thermal Energy Storage
Recovery of waste heat from base stations in the mobile network
Experimental investigations to maximize efficiency of CO2 vapor compression systems
Sustainable Geothermal Energy for the Future: AI in ATES
Warm water systems, losses and Legionella
PARMENIDES – Plug & plAy EneRgy ManagEmeNt for hybriD Energy Storage
HYSTORE - Hybrid services from advanced thermal energy storage systems
Open-source models for holistic building energy system design at scale (Completed)
Tank to Grave Management of new Low-GWP Refrigerants (Hantering av nya låg-GWP köldmedier från installation till destruktion)
Novel tool and guidelines for designing ground source heat pumps (GSHPs) in densely populated areas
Data driven lab for building energy systems
Long-term performance measurement of GSHP systems serving commercial, institutional and multi-family buildings
Open-source models for holistic building energy system design at scale
Control systems for hybrid solutions based on biomass fueled Stirling engines, solar and wind for rural electrification
Prosumer-Centric Communication for Solar PV Diffusion (completed)
Towards Sustainable (Fossil-free) Heating System in Small Residential Buildings
Solar energy and ground source heat pumps for Swedish multi-family housing (completed)
Solar photovoltaic systems in Swedish cooperative housing (completed)
Smart Control Strategies for Heat Pump Systems (completed)
Creating and Understanding Smart Innovation in Cities
Building heating solutions in China
Accelerating innovation in buildings
High-Resolution GIS District Heating Source-Load Mapping
Digitalization and IoT technologies for Heat Pump systems
Sustainable combined systems for heating of buildings (completed)
Cost- and Energy-Efficient Control Systems for Buildings
Situation of Opportunity in the Growth and Change of three Stockholm City Districts (completed)
Wuxi Sino-Swedish Eco-City Project (completed)
Smart Renovation Strategies for Sustainable Electrification
Future Secondary Fluids for indirect refrigeration systems
Smart Fault Detection and Diagnosis for Heat Pumps
Performance indicators for energy efficient supermarket buildings
Magnetic Refrigeration
High-Resolution GIS District Heating Source-Load Mapping
Smart Solar Hybrid Solutions for Sustainable European Buildings (completed)
Building state-of-the-art (SotA) supermarket: Putting theory into practice
Efficient utilization of industrial waste heat by low temperature heat driven power cycles – an integrated approach for Swedish Industry
Cooperation between Supermarkets and Real Estate Owners; Energy Efficiency and Business Models
Digitalization and IoT technologies for Heat Pump systems
Capacity control in Heat Pump systems
Alternative secondary fluids
Functional surface coatings for energy efficient heat pumps
Two-phase flow in flat channels
Two phase heat transfer & pressure drop with new environment friendly refrigerants in minichannels (completed)
Numerical Study on flow boiling in micro/mini channels (completed)
Distributed Cold Storages in District Cooling
Integrating Latent Heat Storage into Residential Heating Systems
Simulation of temperature distribution in borehole thermal storages supported by fiber optic temperature measurements (completed)
Solar energy and ground source heat pumps for Swedish multi-family housing (completed)
Neutrons for Heat Storage, NHS, (completed)
4D Monitoring of BTES (completed)
Aquifer Thermal Energy Storage (completed)
Deep Borehole Heat Exchanger (completed)
Combined Heat and Power plants in combination with borehole thermal energy storage (completed)
Improved borehole technology for Geothermal Heat Pumps development (completed)
Compact Minichannel Latent Energy Storage for Air Related Cold Storage Applications
Building heating solutions in China
Toward Sustainable (Fossil-free) Heating System in Small Residential Buildings
Renewable Energy Park, RE-Park (completed)
Efficient use of energy wells for heat pumps (completed)
Efficient design of geothermal heating systems (completed)
SPF (completed)