Intercom is a developed tool that allows the Crescendo Tool and EnergyPlus to work in simulations together.
In order to use the Case Study with Intercom, the Crescendo Tool and Intercom must be installed. To install Crescendo click here and to install Intercom click here. Both tools do not need any installation, they just have to be extracted from the zip file. To use the example with this tool, each step is shown in this page or in the video at the bottom of the page.
A VDM model of the controller logic has been done, and the functionality implemented in the finite state of the BCVTB has been implemented in VDM.
To download this example project click here.
The energy plus model defines the building characteristics and can be simulated with a weather file.
To download this example project click here.
Building characteristics presented in the EnergyPlus model
In order to use Intercom the models must be developed in Crescendo and in EnergyPlus. Also the data to be interchanged has to be defined in both tools.
In Crescendo the variables that are going to be used in the communication and their definition (in/out) have to be defined. This is done in two files: vdm.link and contract.css
contract.css file definition
vdm.link file definition
EnergyPlus allows external interface definition. In the external interface the input/output signals that are exchanged between Ptolemy II and EnergyPlus are mapped to EnergyPlus objects. The developed tool also uses this to communicate with EnergyPlus.
This external interface, defined in the idf file, can map to three EnergyPlus input object called ExternalInterface:Schedule, ExternalInterface:Actuator and ExternalInterface:Variable. ExternalInterface:Schedule is used to change schedules and the other two can be used in place of Energy Management System (EMS) actuators and EMS variables. The external interface can also be mapped to the EnergyPlus objects Output:Variable, and EnergyManagementSystem:OutputVariable. This objects can be sed to send data from EnergyPlus to Ptolemy II at each zone time step.
The data mapping between the external interface and EnergyPlus is defined in a file called variables.cfg, which has to be in the same folder as the idf file. The correctness of this file is important, as the tool will use it to initialize the data structure. And it must be compliant with the variables definition in the contract.csc and vdm.link files, al well as with the output variables defined in the idf file.
It also is necessary to define information about the socket that will be used to communicate with the exterior. For doing this, socket.cfg file is specified.
Definition of the external interface in the idf
Socket definition
The timestep definition states how often data is interchanged in both tools.
In EnergyPlus a line should be added to the idf file specifying the number of timesteps per hour. In this case the timestep value is 6, so that data is exchanged every 10 minutes.
In Crescendo te timestep can be defined in the overture model using periodic functions. The syntax of the function is "periodic(period, jitter, delay offset) where the parameters are:
In this example, the step is setup to be executed every 10 minutes.
To do a co-simulation with Crescendo and Energy plus both have to be executed, as well as Intercom. Before running them EnergyPlus, BCVTB, Intercom and Crescendo must be installed.
The first tool to be executed is Intercom. If it has been correctly executed, the following message will appear in the console
Then, execute EnergyPlus tool with the idf model of the building RunEPlus command will be used with the idf file and weather dile as arguments in the command line.
With this execution the first datas will appear in eclipse
Finally, execute Crescendo tool, launch the model in debug mode. The project that will run is the project with the shading control implemented an the mapping defined.
Once all tools are executing, the co-simulation will start. This will be observable in the Crescendo enviroment and the Intercom application.
In order to use the examples some changes must be done. Change the name of variables_C.cfg to variables.cfg and copy to C:\ and change the folder where idf, socket.cfg and variables.cfg are located.
Execute the epw file: C:\EnergyPlusV8-4-0\RunEPlus.bat EMSWindowShadeControl USA_IL_Chicago-OHare.Intl.AP.725300_TMY3