Software Architecture and Implementation of Modelica Buildings Library Coupling for Spawn of EnergyPlus

Publication Type

Conference Paper

Date Published





Spawn of EnergyPlus is a next-generation energy simula-tion engine that targets control design and implementationworkflows. Spawn reuses the weather, lighting, loads, andenvelope modules from EnergyPlus through a precom-piled library and couples them with HVAC and controlmodels implemented in Modelica. Thus, for Spawn, theEnergyPlus HVAC models are removed. Spawn has beendesigned to perform coupled simulation with any numberof EnergyPlus models, supporting simulation of a singlebuilding or multiple buildings as part of a district energysystem.This paper describes how the Modelica objects are im-plemented and synchronized to allow the modular specifi-cation at the Modelica-level that uses a Functional Mock-up Unit (FMU) that contains the EnergyPlus model. A keyfeature of our implementation is that multiple instancesof Modelica models call C functions, which jointly builda data structure that defines parameters, inputs and out-puts of the EnergyPlus model. This data structure is usedduring the initialization to generate an FMU that containsa fully configured EnergyPlus model. This FMU is thenaccessed by all Modelica models to exchange with Ener-gyPlus values for parameters, inputs and outputs duringthe simulation. This setup allows the Modelica models tobe instantiated in a modular, object-oriented manner, as istypical for Modelica, yet they jointly construct and use anFMU that contains EnergyPlus.Compared to an HVAC and envelope simulation thatuses a native Modelica building model of comparable levelof detail, the Modelica-EnergyPlus model translates about35% faster and simulates about 50% faster


14th Modelica Conference 2021Proceedings of 14th Modelica Conference 2021, Linköping, Sweden, September 20-24, 2021



Year of Publication




Research Areas