PROTOTYPING THE NEXT GENERATION ENERGYPLUS SIMULATION ENGINE Michael Wetter 1 , Thierry S. Nouidui 1 , David Lorenzetti 1 , Edward A. Lee 2 and Amir Roth 3 1 Lawrence Berkeley National Laboratory, Berkeley, CA 2 University of California at Berkeley, Berkeley, CA 3 US Department of Energy, Washington, DC ABSTRACT We describe the prototype of a next-generation im- plementation of EnergyPlus, DOE’s whole-building energy simulation engine. This new implementation breaks EnergyPlus into a set of component models with clearly defined input and output ports. It instanti- ates these components and their connections from the EnergyPlus input file – thereby not disrupting applica- tions that use EnergyPlus – and then simulates them using a discrete event simulator. This new structure should allow EnergyPlus to evolve more rapidly and robustly by decoupling component modules from the numerical solver. It also allows models to be exported for integration with building control systems. We prototyped this new implementation using the open-source Ptolemy II framework. We encapsulated the computing modules as Functional Mockup Units (FMUs) for Model Exchange. The system of equa- tions defined by the connection of the FMUs is inte- grated using Quantized State System (QSS) simula- tion, a novel method that partitions systems of differ- ential equations and integrates them asynchronously, using step sizes that are based on the time rate of change of the individual state variables. We present a numerical example that illustrates the asynchronous integration and numerical benchmarks of a multizone building model with a radiant slab. We compare the computing time among our prototype, EnergyPlus version 8.2 and the Dymola 2015 FD01 Modelica simulation engine. INTRODUCTION EnergyPlus is DOE’s open-source whole building en- ergy simulation program (Crawley et al., 2001). It is a state-of-the-art building energy simulation pro- gram with a significant user base that serves as the basis for both energy-efficiency codes and a growing ecosystem of commercial software. It is also near- ing its twentienth birthday, having originated from a union of DOE-2 (Winkelmann and Selkowitz, 1985) and BLAST (BLAST, 1999) in 1996. As EnergyPlus has grown, its traditional monolithic, imperative structure – which intermingles governing equations of physics, numerical solution methods and idealized control schemes – has become more burden- some. It makes EnergyPlus difficult to maintain and extend as solvers for new models must be carefully in- tegrated with the existing solver. It complicates mod- eling of modular HVAC systems as it is rigidly orga- nized around traditional primary and secondary HVAC loops. And it is not suited for simulation of con- trol schemes other than rule-based supervisory control sequences because its load-based models have inputs and outputs that are semantically different from actu- ator commands and sensor signals, respectively, and the numerical methods cannot handle fast dynamics, events, certain sampled systems and finite state ma- chines. EnergyPlus’ control language is also bespoke and meaningless outside of EnergyPlus itself. In short, EnergyPlus is a self-contained ecosystem that provides few opportunities to leverage or reuse outside compo- nents, platforms, technologies, and expertise. Spawn-of-EnergyPlus (SOEP) is a prototype using a partially new implementation of EnergyPlus that ad- dresses these structural issues. SOEP leverages two open standard simulation technologies – the Modelica language (Mattsson et al., 1999) and the Functional Mockup Interface (FMI) (Blochwitz et al., 2011) for co-simulation and model-exchange. Modelica is a declarative modeling language in which developers write the governing equations of the system and link them with an external, domain-indepdendent solver. By separating models from numerical solvers, Mod- elica allows domain experts to focus on their domain while leveraging outside expertise to develop high- performance simulation platforms. Modelica makes it easy to prototype new models, to share models be- tween simulation environments, and even to repurpose models for other applications. In the specific case of buildings, Modelica control models can be directly translated into working controller code – unlike cur- rent models written in EnergyPlus Runtime Language (ERL). SOEP exploits FMI to encapsulate existing Energy- Plus models for envelope heat transfer, lighting, and airflow as Functional Mockup Units (FMU) and simu- late them together with new HVAC and control FMUs generated from Modelica. SOEP selects, instantiates, and connects FMUs by in- terpreting EnergyPlus’ existing input files and is there- fore backward-compatible with EnergyPlus. FMU time-stepping, state variable integration, and solution of the algebraic loops formed by connecting FMU are performed by the open-source actor-based framework Ptolemy II. The specific time integration method used is Quantized State System (QSS) (Zeigler and Lee, Proceedings of BS2015: 14th Conference of International Building Performance Simulation Association, Hyderabad, India, Dec. 7-9, 2015. - 403 -