-
Notifications
You must be signed in to change notification settings - Fork 13
How to Locally Test OpenStudio Models
In order to troubleshoot OpenStudio models with Alfalfa, it can be useful to run your models locally within OpenStudio to ensure they are working correctly independent of Alfalfa. However, if you have configured custom OpenStudio measures in order to expose points to Alfalfa, these points will not have an initialized value and therefore an additional measure will need to be run in the OSW in order to run a model configured for Alfalfa within OpenStudio.
An Example of such a program is written below:
def create_input(model, name, freq, init_val)
# [...]
# same as create_input method above
# [...]
# add EMS initialization program
init_prgm = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
init_prgm.setName('Init_' + name)
init_prgm.addLine("SET #{name} = #{init_val}")
init_prgm.addLine("SET #{name}_Enable = 1")
# add EMS initialization program calling manager
init_prgm_mngr = OpenStudio::Model::EnergyManagementSystemProgramCallingManager.new(model)
init_prgm_mngr.setName('Init ' + name)
init_prgm_mngr.setCallingPoint('BeginNewEnvironment')
init_prgm_mngr.addProgram(init_prgm)
end
These initializations will NOT extend to Alfalfa; instead, Alfalfa will initialize the values to nil
and the <NAME>_Enable
to 0
. If the user sets the value of a writeable point (Alfalfa input) the <NAME>_Enable
will automatically be set to 1
.
Set <init_value>
as desired and run the OSW locally, typically with a command like:
/path/to/openstudio_binary run --workflow /path/to/my.osw
Then verify that the model behaved as desired, typically by confirming with a set of timeseries EnergyPlus Output:Variable
objects from the EnergyPlus variable dictionary (eplusout.rdd). Once local testing is complete, make sure to remove this temporary code from the run
method otherwise collisions with Alfalfa may occur.
- Getting Started with Model Measures Part 1: Creating Inputs and Outputs
- Getting Started with Model Measures Part 2: Creating Actuators
- Getting Started with EnergyPlus Measures Part 1: Creating Inputs and Outputs
- Getting Started with EnergyPlus Measures Part 2: Creating Actuators
- How to Configure an OpenStudio Model
- How to Configure Measures for Use with Alfalfa Ruby Gem
- How to Create Inputs and Outputs With Measures
- How to Run URBANopt Output Models in Alfalfa
- How to Migrate EnergyPlus Python Plugins
- How to Integrate Python based Electric Vehicle Models with OpenStudio Workflows
- How to Locally Test OpenStudio Models
- Required Structure of OpenStudio Workflow
- List of Automatically Generated Energyplus Points
- Alfalfa EnergyPlus Mixin Methods
- Getting Started with Uploading and Running a Model Using Python
- Getting Started with Uploading and Running a Model Using the UI
- How to Install Alfalfa Client
- How to Preprocess and Upload a Model
- How to Step Through a Simulation
- How to View Historical Data in Grafana
- How to Configure an Alias
- How to Troubleshoot Models