Skip to content

How to Configure a Modelica Model

Maggie Sullivan edited this page Jun 28, 2023 · 1 revision

Signal Exchange Blocks

Signal exchange blocks allow model parameters to be accessed by external programs which are commonly used in BopTest and Alfalfa. The Buildings Library has both Overwrite and Read blocks for signal exchanges. They are both located in MBL->Utilities->IO->SingalExchange package. Currently, both models only take Real type as inputs and outputs.

Overwrite block: The diagram of Overwrite model includes one input signal, one output signal, one Switch block and two additional input signals (activate and uExt) to the switch block.

image image

Under default conditions, the overwrite block sets activate to be false. As a result, the signal flow through the Overwrite block will not be impacted at all by the block itself. The output signal y will be the same as the input u. However, when an external program sets the activate signal to be true, the connection between y and u will be overridden. The external program can then set the output via uExt block. As an example, if an Overwrite block is connected between the reading of room temperature and a controller and in default case, the room temperature will be sent to the controller. However, when the external program sets the activate block to be true, it can then sets the room temperature to be arbitrary values as wish, mimicking a hacker hijacked the controller by feeding false room temperature readings.

Read block:

The diagram of Read model includes one input signal and one output signal. It enables the reading of a signal by an external program. The model also supports categorizing the input signal according to built-in kPI types. The current built-in type includes air temperature, radiative zone temperature, operative temperature, relative humidity and CO2 concentration. These types help BopTest to automatically output thermal comfort evaluations of the model. Users connect the Read block downstream of the Modelica output and select the corresponding kPI. kPI has been constantly updated from the work at LBL.

image image

OutputVariable block:

The OutputVariable block is used to display output variable from EnergyPlus. As examples, the block can be used to retrieve hourly occupancy schedule, electric equipment load, etc. The block requires three parameters: name, key and an Boolean of isDirectDependent. The name parameter indicates the name of the output variable and should be referred to EnergyPlus .rdd or .mdd file. The key parameter is the key for the output variable. For example, it can be the specific zone name such as "Perimeter Zn1". The Boolean is by default false, indicating a state or weather variable, but should be set to true for algebraic variables with direct dependency on input variables.

image image

Actuator block:

The Actuator blocks works in a similar way as the EMS actuators in EnergyPlus. The block overwrites existing EnergyPlus schedules in the EnergyPlus based on users inputs, e.g., a user defined occupants schedule to replace the one defined originally in the idf file. There are four parameters: variableName, componentType, controlType and unit. The componentType and controlType are defined in the .edd file. The unit is selected from one of the entries in the dropdown. image image


Model Configuration

Openstudio

Tutorials

Guides

Reference

Modelica

Guides

Alfalfa Interaction

Tutorials

Guides

Reference

Explanation

Alfalfa Development

Guides

General

Reference

Explanation

Clone this wiki locally