Run the measure

B. Run the measure with OS SDK using CLI

There are 5 parts in the process of running the measure.

  1. Download the PRM measure (prerequisite)
  2. Setup a local directory
  3. Edit OSW file
  4. Execute the measure
  5. Save the Output
1. Download the PRM measure

Download measure in the link below:

Refer to Install the measure for other installation options.

2. Setup a local directory

Setup a local directory to include all required inputs (the following example is one way to setup the directory):

  • Seed model: place the .osm file in a directory named files. The Openstudio model should meet the model requirements.
  • Weather file: place the .epw file in a directory named weather.
  • Measure: place the Create ASHRAE 90.1 2019 PRM Model measure in a directory called measures.
  • OS Workflow: place the .osw file in the main directory.

The image below shows one way to setup the main directory and their corresponding sub-directories. This can be set up in any other way, however, this structure will be followed for all examples provided in this documentation. Thus, it’s recommended to make necessary changes if the folders are set up in a different manner.

Directory Setup

3. Edit OSW file

The OSW file can be structured as shown in the image below.

  • Lines 2-3 define the seed model and weather file.
  • Lines 4-5 define the measure path.
  • Lines 9-14 contain arguments to be passed to the measure. A detailed description of the arguments can be found in the API document.

OS Workflow Structure

Important Note: The directory names are not case sensitive. If you want to change the names of the directories that contain the seed model and weather file, make sure to define the paths in the OSW file.

4. Execute the measure
  • Open Command Prompt as an administrator.
  • Type the following command with paths to the openstudio\bin, openstudio-standard\lib and the OSW directories.
    C:\openstudio-3.7.0\bin\openstudio.exe run -w "[LOCAL_PATH]\workflow.osw"

Example:

C:\openstudio-3.7.0\bin\openstudio.exe  run -w "C:\Users\sample_user\baselinePRM\test.osw"

If the openstudio command is not recognized, either add the executable to your environment PATH or add the full path to the openstudio-3.7.0\bin directory. It is advised to avoid spaces in file and directory names. Use quotation marks when specifying long file names or paths with spaces.

The OpenStudio SDK version needs to be 3.7.0 or later.

5. Save the Output

Once the workflow simulation is completed, you will find additional files generated in your project directory.

  • An output OSW file out.osw is written to indicate whether the simulation run was successful or not.

Once the workflow is completed unsuccessfully (fails):

  • A run directory is generated with a run.log file that contains the error message.

Once the workflow is completed successfully:

  • A run directory is generated which contains all input/output files.
  • A reports directory is created which contains energyplus’s standard html report.
  • A generated_files directory contains all the generated models and simulation information.
  • A user_data directory contains all user provided data in json format.

Measure Output Structure

Optional Steps

This instruction is provided for users who want to access the latest features or bug fixes that are not accessible in the latest OpenStudio SDK.

In the workflow file, set the evaluation_package to TRUE and provide the evaluation package local path. This local path shall be the folder that saves the OSSTD source code.

The OSSTD source code download instruction can be found in the Use with OS SDK API instruction.

After the edit, your OSW file should contain data similar to the image OS Evaluation Package

Now running the PRM measure will use the local OSSTD source code.

Although source code has passed the CI test, it is unstable and may introduce new bugs or issues.