Automatic code generation method for building a co-simulation platform integrating building automatic systems and EnergyPlus
• A joint energy consumption simulation code generation method based on an abstract syntax tree and templates is proposed. • A variable mapping table and automatic code generation method are used to achieve a flexible combination of different building automation systems and Energy Plus. • Using the proposed automatic code generation method, a visual joint simulation interactive platform is constructed, allowing joint simulation experiments to be conducted without writing code. Building energy consumption researchers are generally not proficient in programming, but require co-simulation tools and physical systems to validate energy-saving patterns and perform data analysis. This paper proposes a code-generation-based method for constructing a universal real-time co-simulation platform integrating EnergyPlus with building control systems. This method eliminates the need for writing code programs; through simple selection, it automatically generates code based on Abstract Syntax Tree (AST) design, enabling specific interactive functions between different EnergyPlus models and different building control systems.This paper first proposes an automatic code generation mode for energy consumption co-simulation, designing co-simulation tool integration template files and building control data communication templates. Utilizing this method, a universal co-simulation platform is implemented, providing building energy consumption researchers with a code-free universal co-simulation platform tool.Through evaluation across 30 experimental cases, the code generation approach proposed in this paper achieves over 95% time savings compared to manual coding, while ensuring the correctness and extensibility of the generated code. The platform has been tested with connections to 2 building control systems and 4 simulation models for joint operation. Each model contains 500 simulation monitoring points, enabling comparative analysis of over six months of actual building control and simulation model data, and provides a user-friendly comparative data interface for researchers.
Authors
- Yupei Yan (ORCID: https://orcid.org/0000-0001-6108-4787)
- Xin Li (ORCID: https://orcid.org/0000-0002-0010-5158)
- Chuang Chen (ORCID: https://orcid.org/0000-0002-4877-1184)
- Qiang Yang (ORCID: https://orcid.org/0000-0001-5059-8360)
- Hairong Yan
- Chenxi Guo
Institutions
- Beijing University of Technology (CN)
- Shenzhen Bay Laboratory (CN)
- China Academy of Building Research (CN)
Publication Details
- Journal
- Energy and Buildings
- Published
- 2025-11-11
- DOI
- https://doi.org/10.1016/j.enbuild.2025.116667
- Primary Topic
- Building Energy and Comfort Optimization
- Type
- article
- Field-Weighted Citation Impact
- 0.00