Coupling EnergyPlus with Functional Mock-up Units for co-simulation[LINK]
The Functional Mock-up Unit (FMU) for co-simulation import for EnergyPlus allows EnergyPlus to conduct co-simulation with various programs that are packaged as FMUs. A FMU is a component which implements the Functional Mock-up Interface (FMI) standard (http://www.modelisar.com).
A FMU is distributed in the form of a zip file that may contain physical models, model descriptions, source code, and executable programs for various platforms. The FMU for co-simulation import provides EnergyPlus with a standard interface to conduct and control co-simulation with an arbitrary number of FMUs without any middle-ware, such as the Building Controls Virtual Test Bed (BCVTB Documentation, 2011).
The FMU for co-simulation import allows coupling of continuous-time and discrete-time models exported from different simulation programs. In the current implementation, EnergyPlus is implemented as the co-simulation master. It controls the data exchange between the subsystems and the synchronization of all slave simulation programs.
The FMU for co-simulation import enables the direct link between the EnergyPlus kernel and other simulation tools. It will make the co-simulation easier to conduct as no middle-ware is involved. This direct link will decrease run-time by eliminating the transaction layer. In addition, by separating the co-simulation interface from the EnergyPlus kernel, the FMU interface is reusable when EnergyPlus is updated. Furthermore, the FMU contains executable files that have the same interface to EnergyPlus regardless of their original programming environment. Some commercial tools allow running their FMU without licensing requirement.
1) The current implementation of FMU for co-simulation is only supported on Windows and Linux.
2) FMUs must be in a folder to which the user has write access.
Data exchange between EnergyPlus and FMUs[LINK]
Prior to describing the data exchange between EnergyPlus and FMUs, some definitions and terminologies used in the remainder of this document will be introduced.
A variable of a system described by a system of differential algebraic equations (DAE) is defined as differential variable if its derivatives are present in the DAE. A variable of a system described by a system of DAE is defined as algebraic if its derivatives do not appear explicitly in the DAE (Fabian et al., 2008).
Because in subsequent discussions, it will be distinguished between algebraic and differential variables, a notation for different system of equations that involve algebraic and differential variables will be introduced. Let q∈N , then
- If x1 and x2 are differential variables, then the system is
F(˙x1,x1,˙x2,x2,u,t)=0 with F: ℝn x ℝn x ℝm x ℝm x ℝq x ℝ → ℝn+m.
- If x1 is a differential variable and x2 is an algebraic variable, then the system is
G(˙x1,x1,x2,u,t)=0 with G: ℝn x ℝn x ℝm x ℝq x ℝ → ℝn+m.
- If x1 is an algebraic variable and x2 is a differential variable, then the system is
H(x1,˙x2,x2,u,t)=0 with H: ℝn xℝm xℝm xℝq xℝ →ℝn+m.
- If x1 is an algebraic variable and x2 is an algebraic variable, then the system is
I(x1,x2,u,t)=0 with I: ℝn xℝm xℝq xℝ →ℝn+m.
Figure shows a case where a FMU is linked to an EnergyPlus model for co-simulation. The FMU and EnergyPlus could be linked through differential or algebraic variables.
Table shows the different system configurations that are possible.
In the first case, the variable x1 and x2 are differential variables in both systems.
In the second case, the variable x1 is a differential variable and the variable x2 is an algebraic variable.
In the third case, the variable x1 is an algebraic variable and the variable x2 is a differential variable.
In the fourth case, the variable x1 is an algebraic variable and the variable x2 is an algebraic variable.
In the current implementation, it will be focused on the first and the second cases since the third and the fourth cases will constrain the FMU to be solved numerically in the iteration solver loop of EnergyPlus. This will necessitate the ability of the FMU to reject time steps (Modelisar, 2010) which is currently not implemented in the EnergyPlus FMU for co-simulation import. Applications for case 1 and 2 are described in the next sections.
|Case||EnergyPlus||FMU (e.g. from Modelica)|
|(1)||Model1 (Differential variable)||Model2 (Differential variable)|
|(2)||Model1 (Differential variable)||Model2 (Algebraic variable)|
|(3)||Model1 (Algebraic variable)||Model2 (Differential variable)|
|(4)||Model1 (Algebraic variable)||Model2 (Algebraic variable)|
Case 1: Linking two systems through differential variables[LINK]
Case 2: Linking two systems through algebraic and differential variables[LINK]
The current implementation for linking EnergyPlus with the FMUs has the following requirements:
The data exchange between EnergyPlus and the FMUs is done at the zone time step of EnergyPlus.
Each FMU is linked to EnergyPlus only through a differential variable in EnergyPlus (see Figure for one FMU).
- Two or multiple FMUs are linked together only through differential variables in EnergyPlus (see Figure for two FMUs).