Skip to content

OpenStudio Model Setup

Anya Petersen edited this page Mar 11, 2021 · 9 revisions

OpenStudio Models

Setting up an OSM

This section focuses on the OpenStudio modeling requirements and describes how to create readable and writeable points in OpenStudio so that Alfalfa can create the ExternalInterface objects. This DOES NOT define how the appropriate tags should be applied to 'type' something. That is TODO.

Readable Points

The following steps should be taken in the OpenStudio model in order to expose readable points from simulation to Alfalfa to acquire ExternalInterface objects needed for co-simulation, as well as Project Haystack points with tags associated with the readable points:

  1. Create an OutputVariable object for the simulation point whose value you wish to read
  2. Set the OutputVariable object attributes including name, reporting frequency, and key value as required
  3. Set the exportToBCVTB method to true

Writeable Points

The following steps should be taken in the OpenStudio model in order to expose writeable points in simulation to Alfalfa in order to acquire ExternalInterface objects needed for co-simulation, as well as Project Haystack points and tags associated with the writeable points.

  1. Create two (2) EnergyManagementSystemGlobalVariable objects for the simulation actuator point you wish to expose
  2. Set the name of the first object (e.g. “Fan_Mass_Flow”)
  3. Set the name of the second object the same as the first but include “_enable” (e.g. “Fan_Mass_Flow_enable”)
  4. Set exportToBCVTB method to true for both The following steps should be taken in the OpenStudio model EnergyManagementSystem Programs and Subroutines that reference this writeable point:
  5. EnergyPlus EMS Programs and Subroutines should reference the “NAME_enable” variable by String name whose Boolean value (True or False) dictates whether or not EnergyPlus should write the value from Alfalfa to the associated EnergyPlus EMS actuator. For example:
IF Fan_Mass_Flow_enable ==1
	SET EMS_fanmassflow_actuator = Fan_Mass_Flow
ELSE,
	SET EMS_fanmassflow_actuator = Null
ENDIF,

Where 1 is True and 0 is False.

Setting up an OSW

Assuming that the OpenStudio Model has been set up with the above requirements, an OpenStudio Workflow can easily be implemented. The workflow can be designed using the OpenStudio application or by correctly defining a directory structure with the necessary components. For those familiar with creating workflows, this is the standard directory structure, and is shown in the photo below. It also generally takes the form:

  • path/to/my_model.osm
  • path/to/my_model/workflow.osw
  • path/to/my_model/measures/…[insert measure directories]
  • path/to/my_model/files/desired_weather_file.epw

An example of the workflow.osw is also provided below:

Once the workflow has been setup, the model and model directory simply need to be zipped together. For both Windows and macOS, select the model and model directory, then right click, and see photos below for compressing:

This zipped folder can then be directly uploaded to Alfalfa.


Model Configuration

Openstudio

Tutorials

Guides

Reference

Modelica

Guides

Alfalfa Interaction

Tutorials

Guides

Reference

Explanation

Alfalfa Development

Guides

General

Reference

Explanation

Clone this wiki locally