External Interface (S) Application Guide: Energyplus™ Version 8.8.0 Documentation
External Interface (S) Application Guide: Energyplus™ Version 8.8.0 Documentation
0 Documentation
Build: 7c3bbe4830
COPYRIGHT (c) 1996-2017 THE BOARD OF TRUSTEES OF THE UNIVERSITY OF ILLINOIS,
THE REGENTS OF THE UNIVERSITY OF CALIFORNIA THROUGH THE ERNEST ORLANDO
LAWRENCE BERKELEY NATIONAL LABORATORY, OAK RIDGE NATIONAL LABORATORY,
MANAGED BY UT-BATTELLE, ALLIANCE FOR SUSTAINABLE ENERGY, LLC, AND OTHER
CONTRIBUTORS. ALL RIGHTS RESERVED. NO PART OF THIS MATERIAL MAY BE REPRO-
DUCED OR TRANSMITTED IN ANY FORM OR BY ANY MEANS WITHOUT THE PRIOR WRIT-
TEN PERMISSION OF THE UNIVERSITY OF ILLINOIS OR THE ERNEST ORLANDO LAWRENCE
BERKELEY NATIONAL LABORATORY. ENERGYPLUS IS A TRADEMARK OF THE US DEPART-
MENT OF ENERGY.
Contents
1 External Interface(s) 3
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Coupling EnergyPlus with the Building Controls Virtual Test Bed . . . . . . . . . . 3
1.2.1 Algorithm for data exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 BCVTB Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.1 Architecture of System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.2 XML Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3.3 Example 1: Interface using ExternalInterface:Schedule . . . . . . . . . . . . 7
1.3.4 Example 2: Interface using ExternalInterface:Actuator . . . . . . . . . . . . 10
1.3.5 Example 3: Interface using ExternalInterface:Variable . . . . . . . . . . . . . 13
1.4 Coupling EnergyPlus with Functional Mock-up Units for co-simulation . . . . . . . 16
1.4.1 Data exchange between EnergyPlus and FMUs . . . . . . . . . . . . . . . . 17
1.4.2 Case 1: Linking two systems through differential variables . . . . . . . . . . 19
1.4.3 Case 2: Linking two systems through algebraic and differential variables . . 20
1.4.4 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.5 FMU Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.5.1 Architecture of the FMU for co-simulation Import . . . . . . . . . . . . . . . 21
1.5.2 Workflow of the FMU for co-simulation import . . . . . . . . . . . . . . . . 22
1.5.3 FMU Parser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.5.4 Example 1: Interface using ExternalInterface:FunctionalMockupUnitImport:To:Schedule 23
1.5.5 Example 2: Interface using ExternalInterface:FunctionalMockupUnitImport:To:Actuator 27
1.5.6 Example 3: Interface using ExternalInterface:FunctionalMockupUnitImport:To:Variable 28
1.6 Exporting EnergyPlus as a Functional Mock-up Unit for co-simulation . . . . . . . 30
2 References 31
2
Chapter 1
External Interface(s)
1.1 Introduction
The ExternalInterface allows coupling EnergyPlus to the Building Controls Virtual Test Bed
(BCVTB). It supports the import of Functional Mock-up Units (FMUs) for co-simulation as well
as the export of EnergyPlus as a FMU for co-simulation. BCVTB is a software environment
that allows expert users to couple different simulation programs for distributed simulation or for
a real-time simulation that is connected to a building control system. For example, the BCVTB
allows simulation of the building envelope and HVAC system in EnergyPlus and the control logic
in MATLAB/Simulink, while exchanging data between the two programs as they simulate. The
BCVTB can be downloaded from http://simulationresearch.lbl.gov/bcvtb. A FMU is a component
which implements the Functional Mock-up Interface (FMI) standard (http://www.modelisar.com).
3
4 CHAPTER 1. EXTERNAL INTERFACE(S)
In the situation where the differential equation is solved using co-simulation, the above algorithm
becomes
This algorithm is implemented in the BCVTB. Note that there is no iteration between the two
simulators.
External Interface Application Guide is how to configure this mapping and how to use these objects.
For a detailed explanation of the grey items, we refer to the BCVTB documentation.
Figure 1.1: Architecture of the BCVTB with the EnergyPlus client (black) and other clients (grey).
The external interface can map to three EnergyPlus input objects called ExternalInter-
face:Schedule, ExternalInterface:Actuator and ExternalInterface:Variable. The ExternalInter-
face:Schedule can be used to overwrite schedules, and the other two objects can be used in
place of Energy Management System (EMS) actuators and EMS variables. The objects have
similar functionality as the objects Schedule:Compact, EnergyManagementSystem:Actuator and
EnergyManagementSystem:GlobalVariable, except that their numerical value is obtained from the
external interface at the beginning of each zone time step, and will remain constant during this
zone time step.
Compared to EnergyManagementSystem:Actuator, the object ExternalInterface:Actuator has
an optional field called “initial value.” If a value is specified for this field, then this value will be
used during the warm-up period and the system sizing. If unspecified, then the numerical value
for this object will only be used during the time stepping. Since actuators always overwrite other
objects (such as a schedule), all these objects have values that are defined during the warm-up and
the system sizing even if no initial value is specified. For the objects ExternalInterface:Schedule
and ExternalInterface:Variable, the field “initial value” is required, and its value will be used during
the warm-up period and the system-sizing.
ExternalInterface:Variable is a global variable from the point of view of the EMS language.
Thus, it can be used within any EnergyManagementSystem:Program in the same way as an Ener-
gyManagementSystem:GlobalVariable or an EnergyManagementSystem:Sensor can be used.
Although variables of type ExternalInterface:Variable can be assigned to EnergyManagmentSys-
tem:Actuator objects, for convenience, there is also an object called ExternalInterface:Actuator.
This object behaves identically to EnergyManagmentSystem:Actuator, with the following excep-
tions:
• Its value is assigned by the external interface.
• Its value is fixed during the zone time step because this is the synchronization time step for
the external interface.
6 CHAPTER 1. EXTERNAL INTERFACE(S)
The external interface can also map to the EnergyPlus objects Output:Variable and Energy-
ManagementSystem:OutputVariable. These objects can be used to send data from EnergyPlus to
the BCVTB at each zone time step.
We will now present examples that use all of these objects. The following table shows which
EnergyPlus features are used in the examples, which are all distributed with the BCVTB installation
that can be obtained from the LBNL web site. Note – these examples are NOT distributed with
EnergyPlus installation because you need the special software to make them work.
To configure the data exchange, the following three steps are required from the user:
1) Create an EnergyPlus idf file.
2) Create an xml file that defines the mapping between EnergyPlus and BCVTB variables.
3) Create a Ptolemy model.
These steps are described in the examples below. Prior to discussing the examples, we will
explain the syntax of the xml configuration file that defines how data are mapped between the
external interface and EnergyPlus.
described above, the external interface can send data to ExternalInterface:Schedule, ExternalInter-
face:Actuator, ExternalInterface:Variable. For these objects, the “source” attribute needs to be set
to “Ptolemy,” because they are computed in Ptolemy. The xml elements for these objects look as
follows:
For ExternalInterface:Schedule, use
<variable source = “Ptolemy”>
<EnergyPlus schedule = “NAME”/>
</variable>
where NAME needs to be the EnergyPlus schedule name. For ExternalInterface:Actuator, use
<variable source = “Ptolemy”>
<EnergyPlus actuator = “NAME” />
</variable>
where NAME needs to be the EnergyPlus actuator name. For ExternalInterface:Variable, use
<variable source = “Ptolemy”>
<EnergyPlus variable = “NAME”/>
</variable>
where NAME needs to be the EnergyPlus Energy Runtime Language (Erl) variable name.
The external interface can also read data from any Output:Variable and EnergyManagementSys-
tem:OutputVariable. For these objects, set the “source” attribute to “EnergyPlus,” because they
are computed by EnergyPlus. The read an Output:Variable, use
<variable source = “EnergyPlus”>
<EnergyPlus name = “NAME” type = “TYPE”/>
</variable>
where NAME needs to be the EnergyPlus “Variable Name” (such as ZONE/SYS AIR TEMP)
and TYPE needs to be the EnergyPlus “Key Value” (such as ZONE ONE). To read an Energy-
ManagementSystem:OutputVariable, use
<variable source = “EnergyPlus”>
<EnergyPlus name = “EMS” type = “TYPE”/>
</variable>
i.e., the attribute “name” must be EMS, and the attribute “type” must be set to the EMS
variable name.
Complete examples of these xml files are presented below.
• EnergyPlus objects that write data from the external interface to the EMS.
8 CHAPTER 1. EXTERNAL INTERFACE(S)
These schedules can be used as other EnergyPlus schedules. In this example, they are used to
change a thermostat setpoint:
ThermostatSetpoint :DualSetpoint ,
DualSetPoint , !- Name
BCVTB -SP -TH , !- Heating Setpoint Temperature Schedule Name
BCVTB -SP -TC; !- Cooling Setpoint Temperature Schedule Name
Output:Variable ,
TSetHea , !- Key Value
Schedule Value , !- Variable Name
TimeStep; !- Reporting Frequency
Output:Variable ,
TSetCoo , !- Key Value
Schedule Value , !- Variable Name
TimeStep; !- Reporting Frequency
To specify that data should be exchanged every 15 minutes of simulation time, enter in the idf
file the section
1.3. BCVTB EXAMPLES 9
Timestep ,
4; !- Number of Timesteps per Hour
This file specifies that the actor in the BCVTB that calls EnergyPlus has an input vector with
two elements that are computed by Ptolemy (Ptolemy is the name of the software on which the
BCVTB is based) and sent to EnergyPlus, and that it has an output vector with four elements
that are computed by EnergyPlus and sent to Ptolemy. The order of the elements in each vector is
determined by the order in the above XML file. Hence, the input vector that contains the signals
sent to EnergyPlus has elements
TSetHea
TSetCoo
and the output vector that contains values computed by EnergyPlus has elements
Environment (Site Outdoor Air Drybulb Temperature)
ZSF1 (ZONE AIR TEMPERATURE)
TSetHea (Schedule Value)
TSetCoo (Schedule Value)
the file system.xml.) In this example, the time step is 15 minutes and the simulation period is four
days.
In this model, the Simulator actor that calls EnergyPlus is configured for Windows as follows:
Hence, it calls the file “RunEPlus.bat,” with arguments “EMSWindowShadeControl
USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.” The working directory is the current di-
rectory and the console output is written to the file simulation.log. If EnergyPlus does not
communicate with the BCVTB within 10 seconds, the BCVTB will terminate the connection. (See
http://simulationresearch.lbl.gov/bcvtb for more detailed documentation about how to configure
a BCVTB model that communicates with other programs.)
For Mac OS X and Linux, the configuration is similar:
This completes the configuration.
Figure 1.3: Configuration of the Simulator actor that calls EnergyPlus on Windows.
Figure 1.4: Configuration of the Simulator actor that calls EnergyPlus on Mac OS X and on Linux.
12 CHAPTER 1. EXTERNAL INTERFACE(S)
• Its value is fixed during the zone time step because this is the synchronization time step for
the external interface.
To interface EnergyPlus using the EMS feature, the following three items are needed:
1) An object that instructs EnergyPlus to activate the external interface.
2) EnergyPlus objects that write data from the external interface to the EMS.
3) A configuration file to configure the data exchange.
To declare an actuator that changes the control status of the window with name
“Zn001:Wall001:Win001”, we use:
ExternalInterface:Actuator ,
Zn001_Wall001_Win001_Shading_Deploy_Status , !- Name
Zn001:Wall001:Win001 , !- Actuated Component Unique Name
Window Shading Control , !- Actuated Component Type
Control Status , !- Actuated Component Control Type
; ! initial value
Thus, the entry is identical with EnergyManagmentSystem:Actuator, except for the additional
optional field that specifies the initial value. If unspecified, then the actuator will only be used
during the time stepping, but not during the warm-up and the system sizing. Since actuators
always overwrite other objects (such as a schedule), all these objects have values that are defined
during the warm-up and the system sizing even if no initial value is specified.
We also want to read from EnergyPlus the outdoor temperature, the zone air temperature, the
solar radiation that is incident on the window, and the fraction of time that the shading is on.
Thus, we declare the output variables
Output:Variable ,
Environment , !- Key Value
Site Outdoor Air Drybulb Temperature , !- Variable Name
timestep; !- Reporting Frequency
Output:Variable ,
*, !- Key Value
Zone Mean Air Temperature , !- Variable Name
timestep; !- Reporting Frequency
Output:Variable ,
Zn001:Wall001:Win001 , !- Key Value
Surface Outside Face Incident Solar Radiation Rate per Area , !- Var Name
timestep; !- Reporting Frequency
1.3. BCVTB EXAMPLES 13
Output:Variable ,
*, !- Key Value
Surface Shading Device Is On Time Fraction , !- Variable Name
timestep; !- Reporting Frequency
To specify that data should be exchanged every 10 minutes of simulation time, we enter in the
idf file the section
Timestep ,
6; !- Number of Timesteps per Hour
This file specifies that the actor in the BCVTB that calls EnergyPlus has an input vector with
one element that will be written to the actuator, and that it has an output vector with four elements
that are computed by EnergyPlus and sent to Ptolemy. The order of the elements in each vector is
determined by the order in the above XML file. Hence, the output vector that contains the signals
computed by EnergyPlus has elements
ENVIRONMENT (SITE OUTDOOR AIR DRYBULB TEMPERATURE)
WEST ZONE (Zone Mean Air Temperature)
Zn001:Wall001:Win001 (Surface Outside Face Incident Solar Radiation Rate per Area)
Zn001:Wall001:Win001 (Surface Shading Device Is On Time Fraction)
• EnergyPlus objects that write data from the external interface to the EMS.
ExternalInterface :Variable ,
yShade , !- Name of Erl variable
1; !- Initial value
During the warm-up period and the system-sizing, the variable will be set to its initial value.
Afterwards, the value will be assigned from the external interface at each beginning of a zone time
step and kept constant during the zone time step. From the point of view of the EMS language,
ExternalInterface:Variable can be used like any global variable. Thus, it can be used within any En-
ergyManagementSystem:Program in the same way as an EnergyManagementSystem:GlobalVariable
or an EnergyManagementSystem:Sensor.
This idf section above activates the external interface and declares a variable with name
yShade that can be used in an Erl program to actuate the shading control of the window
“Zn001:Wall001:Win001” as follows:
! EMS program. The first assignments sets the shading status and converts it into the
! EnergyPlus signal (i.e., replace 1 by 6).
! The second assignment sets yShade to
! an EnergyManagementSystem :OutputVariable
! which will be read by the external interface.
EnergyManagementSystem :Program ,
Set_Shade_Control_State , !- Name
Set Shade_Signal = 6*yShade , !- Program Line 1
Set Shade_Signal_01 = yShade +0.1; !- Program Line 2
We want to read from EnergyPlus the outdoor temperature, the zone air temperature and the
solar radiation that is incident on the window. Thus, we declare
Output:Variable ,
Environment , !- Key Value
Site Outdoor Air Drybulb Temperature , !- Variable Name
timestep; !- Reporting Frequency
Output:Variable ,
*, !- Key Value
Zone Mean Air Temperature , !- Variable Name
timestep; !- Reporting Frequency
Output:Variable ,
Zn001:Wall001:Win001 , !- Key Value
Surface Outside Face Incident Solar Radiation Rate per Area , !- Var Name
timestep; !- Reporting Frequency
In addition, we want to output the variable “Erl Shading Control Status” that has been set up
as
! Declare an output variable. This variable is equal to the shahing signal + 0.1
! It will be reah by the external interface to hemonstrate how to receive variables.
EnergyManagementSystem :OutputVariable ,
Erl Shahing Control Status , !- Name
Shahe_Signal_01 , !- EMS Variable Name
Averageh , !- Type of Data in Variable
ZoneTimeStep; !- Uphate Frequency
To specify that data should be exchanged every 10 minutes of simulation time, enter in the idf
file the section
Timestep ,
6; !- Number of Timesteps per Hour
</variable >
<variable source = "EnergyPlus">
<EnergyPlus name = "Zn001:Wall001:Win001" type = "Surface Outside Face Incident Solar Radiation
Rate per Area"/>
</variable >
<variable source = "EnergyPlus">
<EnergyPlus name = "EMS" type = "Erl Shading Control Status "/>
</variable >
</BCVTB -variables >
This file specifies that the actor in the BCVTB that calls EnergyPlus has an input vector with
one element that will be written to the actuator, and that it has an output vector with four elements
that are computed by EnergyPlus and sent to Ptolemy. The order of the elements in each vector
is determined by the order in the above XML file. Note that the fourth element has the name
“EMS” because it is an EnergyManagementSystem:OutputVariable. Hence, the output vector that
contains the signals computed by EnergyPlus has elements
ENVIRONMENT (SITE OUTDOOR AIR DRYBULB TEMPERATURE)
WEST ZONE (Zone Mean Air Temperature)
Zn001:Wall001:Win001 (Surface Outside Face Incident Solar Radiation Rate per Area)
EMS (Erl Shading Control Status)
The configuration of the Ptolemy model is identical to the configuration in the previous exam-
ples.
Figure 1.5: System with two variables that could be either differential or algebraic variables.
• 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.
18 CHAPTER 1. EXTERNAL INTERFACE(S)
• 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.
This case could be for an application where a wall with a phase change material (PCM) is modeled
in a FMU and is linked to a room model in EnergyPlus. The room air temperature is the differential
variable in EnergyPlus and the temperature of the wall with PCM is the differential variable in the
FMU. Each system solves a differential equation that is connected to the differential equation of
the other system. For simplicity, we assume that y1 (.) = x1 (.) and y2 (.) = x2 (.).The systems are
described by the ordinary differential equations
dx1 /dt = f1 (x1 , x2 ), with x1 (0) = x1,0 ,
dx2 /dt = f2 (x2 , x1 ), with x2 (0) = x2,0.
Let N ∈ N denote the number of time steps and let tk with k ∈ {1, ..., N } denote the time
steps. We will use the subscripts 1 and 2 to denote the variables and the functions that compute
the next state variable of the simulator 1 and 2, respectively.
The first system computes, for k ∈ {0, ..., N − 1} and some F̃1 : �n x �m x � x � → �n , the sequence
x1 (tk+1 ) = F̃1 (x1 (tk ), x2 (tk ), tk , tk+1 )
and, similarly, the simulator 2 computes for some F̃2 : �m x �n x � x � → �m the sequence
x2 (tk+1 ) = F̃2 (x2 (tk ), x1 (tk ), tk , tk+1 )
with initial conditions x1 (0) = x1,0 and x2 (0) = x2,0. F̃1 and F̃2 *are the functions that are used
to compute the value of the state variables at the new time step
To advance from time tk to tk+1 , each system uses its own time integration algorithm. At the
end of the time step, EnergyPlus sends the new state x1 (tk+1 ) to the FMU and it receives the state
x2 (tk+1 ) from the FMU. The same procedure is done with the FMU.
20 CHAPTER 1. EXTERNAL INTERFACE(S)
1.4.4 Requirements
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 1.7 for one FMU).
• Two or multiple FMUs are linked together only through differential variables in EnergyPlus
(see Figure 1.8 for two FMUs).
1.5. FMU EXAMPLES 21
The external interface can map to three EnergyPlus input objects called
• ExternalInterface:FunctionalMockupUnitImport:To:Schedule
• ExternalInterface:FunctionalMockupUnitImport:To:Actuator
• ExternalInterface:FunctionalMockupUnitImport:To:Variable.
22 CHAPTER 1. EXTERNAL INTERFACE(S)
Prior to discussing the examples, we will explain the pre-processing steps that are required to
prepare EnergyPlus to be linked to FMUs for co-simulation.
A FMU is a zip file which may contain executable programs for specific platforms, description
files and source code. In the pre-processing step, the FMU Parser will be called with the command
option –printidf. This will cause the parser to parse the XML file with the model description of the
FMU and write the FMU information in a format of the EnergyPlus input file (*.idf). The parser
will check if all the required fields from FMU (see next section for details) in the *.idf file are correctly
specified. If the check succeeds, the parser will successfully close. If the check fails, the parser will
close with an error message. After the EnergyPlus executable (such as EnergyPlus.exe) terminates,
the EnergyPlus batch file will delete all the temporary files that may have been generated. The
FMU Parser is distributed with EnergyPlus and can be found in the PreProcess folder (FMUParser)
of the EnergyPlus installation.
sensible (QSensible) heat transported across the thermodynamic boundary of air inlet and outlet
of the thermal zone.
To link the FMU with EnergyPlus, we need to send from the FMU to EnergyPlus two schedule
values for the latent and sensible heat gain and from EnergyPlus to the FMU four output variables
for outdoor dry-bulb temperature, outdoor air relative humidity, room dry-bulb temperature and
room air relative humidity at each zone time step. This can be accomplished by using two ob-
jects of type ExternalInterface:FunctionalMockupUnitImport:To:Schedule and four objects of type
ExternalInterface:FunctionalMockupUnitImport:From:Variable.
To interface EnergyPlus, the following four items are needed:
• EnergyPlus objects that read data from EnergyPlus and send to FMU.
• EnergyPlus objects that read data from FMU and send to EnergyPlus.
• Copy the FMU information from the temporary idf into the full idf file.
• Modify the full idf file to link the FMU variables with EnergyPlus variables.
The code below shows how the objects will be in the idf.
To activate the external interface, we use:
ExternalInterface:FunctionalMockupUnitImport ,
MoistAir.fmu , !- FMU Filename
15, !- FMU Timeout
0; !- FMU LoggingOn
To enter output variables from which the external interface read and send to FMUs, we use:
Output:Variable ,
Environment , !- Key Value
Site Outdoor Air Drybulb Temperature , !- Variable Name
TimeStep; !- Reporting Frequency
Output:Variable ,
ZONE ONE , !- Key Value
Zone Mean Air Temperature , !- Variable Name
TimeStep; !- Reporting Frequency
Output:Variable ,
Environment , !- Key Value
Site Outdoor Air Relative Humidity , !- Variable Name
TimeStep; !- Reporting Frequency
Output:Variable ,
ZONE ONE , !- Key Value
Zone Air Relative Humidity , !- Variable Name
TimeStep; !- Reporting Frequency
This completes the configuration that is required to simulate EnergyPlus with the FMU.
1.5. FMU EXAMPLES 27
The code below shows how the objects will be in the idf.
To activate the external interface, we use:
ExternalInterface:FunctionalMockupUnitImport ,
ShadingController.fmu , !- FMU Filename
15, !- FMU Timeout in milli -seconds
0; !- FMU LoggingOn
To enter the two output variables from which the external interface read from and send to FMUs,
we use:
Output:Variable ,
Zn001:Wall001:Win001 , !- Key Value
Surface Outside Face Incident Solar Radiation Rate per Area , !- Var Name
TimeStep; !- Reporting Frequency
Output:Variable ,
WEST ZONE , !- Key Value
Zone Mean Air Temperature , !- Variable Name
TimeStep; !- Reporting Frequency
To enter the actuator that changes the control status of the window with name “Zn001:Wall001:Win001”,
we use:
This completes the configuration that is required to simulate EnergyPlus with the FMU.
• EnergyPlus objects that read data from EnergyPlus and send to FMU.
• EnergyPlus objects that read data from FMU and send to EnergyPlus.
• Copy the FMU information from the temporary idf into the full idf file.
• Modify the full idf file to link the FMU variables with EnergyPlus
The code below shows how the objects will be in the idf.
To activate the external interface, we use:
1.5. FMU EXAMPLES 29
ExternalInterface:FunctionalMockupUnitImport ,
ShadingController.fmu , !- FMU Filename
15, !- FMU Timeout in milli -seconds
0; !- FMU LoggingOn
To enter the two output variables from which the external interface read from and send to FMUs,
we use:
Output:Variable ,
Zn001:Wall001:Win001 , !- Key Value
Surface Outside Face Incident Solar Radiation Rate per Area , !- Var Name
TimeStep; !- Reporting Frequency
Output:Variable ,
WEST ZONE , !- Key Value
Zone Mean Air Temperature , !- Variable Name
TimeStep; !- Reporting Frequency
To write data from the external interface to an EnergyPlus EMS variable, we use the following
item in idf file:
which declares a variable with name yShade that can be used in an Erl program to actuate the
shading control of the window “Zn001:Wall001:Win001” as follows:
! EMS program. The first assignments sets the shading status and converts it into the
! EnergyPlus signal (i.e., replace 1 by 6).
! The second assignment sets yShade to
! an EnergyManagementSystem :OutputVariable
! which will be read by the external interface.
EnergyManagementSystem :Program ,
Set_Shade_Control_State , !- Name
Set Shade_Signal = 6*yShade , !- Program Line 1
30 CHAPTER 1. EXTERNAL INTERFACE(S)
This completes the configuration that is required to simulate EnergyPlus with the FMU.
References
Hensen, Jan L. M. 1999. “A comparison of coupled and de-coupled solutions for temperature and
air flow in a building.” ASHRAE Transactions 105 (2): 962–969.
Zhai, Zhiqiang John, and Qingyan Yan Chen. 2005. “Performance of coupled building energy
and CFD simulations.” Energy and Buildings 37 (4): 333–344.
BCVTB Documentation. 2011. Online available at: http://simulationresearch.lbl.gov/bcvtb/
releases/1.0.0/doc/manual/index.xhtml [last accessed: 06/13/2011].
Expat XML Parser. 2011. http://sourceforge.net/projects/expat/ [Last accessed: 06/20/2011].
G. Fábián, D.A. van Beek, J.E. Rooda. 2008. Substitute equations for index reduction and
discontinuity handling. In Proc. of the Third International Symposium on Mathematical Modeling,
Vienna, Austria.
Modelisar. 2010. “Functional Mock-up Interface for Co-Simulation.” http://www.modelisar.com/specificatio
[Last accessed: 06/06/2011].
31