NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
503 stars 192 forks source link

Support running EnergyPlus simulations as part of measure test #4760

Open DavidGoldwasser opened 1 year ago

DavidGoldwasser commented 1 year ago

Enhancement Request

I want to be able to run the IDF file that comes out of an EnergyPlus measure through EnergyPlus. Currently we don't do this and have many situations where measure tests pass, we release, and then later realize the IDF files being made won't run successfully.

Here is one example https://github.com/NREL/openstudio-load-flexibility-measures-gem/issues/52

Detailed Description

This is already done for OpenStudio models in model measures using a method in the standard gems. https://github.com/NREL/openstudio-standards/blob/a61ba54ead336dbbd5376a8b0c3f1fb139aaebaa/lib/openstudio-standards/utilities/simulation.rb#L9

Possible Implementation

Code location: There are a few approaches two this, and they are a few possible places for the code to go. First I'll talk about code placement

  1. We could update the existing method in standards or make a similar method just for IDF files.
  2. We can have duplicate code to do this in every measure's test directory and/or test.rb (I really don't like this)
  3. We can update the OpenStudio CLI to run IDF files, or to support an OSW file with no OSM, and an IDF as starting point
  4. This could go in the extension gem.

Code approaches:

  1. Run an OSW through the CLI using WorkflowJSON. This is what the standards method does now (https://github.com/NREL/openstudio-standards/blob/a61ba54ead336dbbd5376a8b0c3f1fb139aaebaa/lib/openstudio-standards/utilities/simulation.rb#L89). Currently to use this approach I need to access a measure that replaces the OSM generate IDF with a custom IDF, and then runs EnergyPlus measures and then EnergyPlus. This is an old "Bring your own IDF" workflow I setup for people who wanted to use OSAF but not OSM models. It is shown here https://github.com/NREL/BESTEST-GSR/blob/main/integration_testing/workflow/600EN_from_idf/workflow.osw#L14-L22
  2. We can run the EnergyPlus CLI to run an IDF. I used this. for my current use, but it had a few issues. One is that while I could check if SQL file was made I didn't figure out how to confirm if the simulation was successful (I expect that is easy to solve) Another issue is what this didn't run well on the CLI. Not sure if EnergyPlus CLI didn't run, or if it just put the SQL file in unexpected location. I can provide a link to that later, but I modified a copy of the standards method I put into the measure test.rb.
DavidGoldwasser commented 1 year ago

@mdahlhausen do you have any reason to do this in Standards? I are you using any EnergyPlus measures, other than maybe utility tariffs?

mdahlhausen commented 1 year ago

I can't think of any instances where this is necessary in openstudio-standards. Generally I'm trying to avoid EnergyPlus measures and only use them as a last resort. openstudio-standards does use EMS for radiant slab controls, but hopefully that's replaced with OpenStudio methods by the next release.