4

Use/Convert all OpenStudio measures to SI & run on OpenStudio server in SI

As the question title states, I would like every measure which I use to be in SI units.

I noticed that most measures are taking ip units as inputs - however I also noticed that in several measures that these ip units are converted into si within the code of the measure itself, is this the case with all measures created by NREL?

What would I need to do to convert every measure to SI units, are the underlying helper functions in ip or si?

Furthermore will OpenStudio server work with every measure using SI?

antonszilasi's avatar
1.5k
antonszilasi
asked 2017-08-15 11:02:01 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2017-08-15 13:41:47 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

4

You are right, majority of NREL written measures takes the inputs (or 'arguments' in scripting world) in IP units. These "arguments" (ex: Supply Temp in F) gets converted into the SI unit systems within the .RB (ruby file) by using the given methods: https://nrel.github.io/OpenStudio-use...

For ex, If you open any measure in notepad++ file (or any text editor) where the inputs were needed in F for temperature, you will find a method similar to "val_in_celsius = OpenStudio.convert(val_in_fahrenheit,"F","C")" to convert the temp F values in Celsius.

As energyPlus runs all the simulations in SI system, we can anyways delete this "conversion method" from the RB file (precisely) & just provide the inputs in SI units to the measure in the argument section. All you need to do is careful editing of your measure RB files which shouldn't be a huge trouble if you are familiar with some of the measure writing stuff. If it's me with 1 out of 10 measure writing experience, I would start with "commenting out" all these "conversion methods" by adding a "#" before the methods.

For ex, change:

val_in_celsius = OpenStudio.convert(val_in_fahrenheit,"F","C")

to

[#]val_in_celsius = OpenStudio.convert(val_in_fahrenheit,"F","C") - remove parenthesis from #

As a test run, try it for the simplest measure & see if you can understand the workflow for what you want.

Harshul Singhal's avatar
565
Harshul Singhal
answered 2017-08-15 14:46:03 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

I am adding to the answer by Harshul after a discussion with David Goldwasser on unmet hours slack.

According to David "Everything in OSM and IDF files are stored in SI units, and any API methods that alter OpenStudio objects also expect SI units. Most measures have user input in IP, then convert internally to SI to run. Then at the tail end convert back to IP for reporting.

You can change this val_si = OpenStudio.convert(val_in_fahrenheit,"F","C")

to

val_si = OpenStudio.convert(val_in_fahrenheit,"C","C")"

If you change your user argument to expect an SI value vs. an IP value. There is some work involved in this, and if we update the measures you may be out of sync with what NREL is developing as most measures are developed to take ip units.

antonszilasi's avatar
1.5k
antonszilasi
answered 2017-08-16 13:08:15 -0500, updated 2017-08-16 13:08:58 -0500
edit flag offensive 0 remove flag delete link

Comments

Additionally according to DanMacumber by default osms are always in SI units and any gbxml imported will be converted to SI - see the code: https://github.com/NREL/OpenStudio/bl...

antonszilasi's avatar antonszilasi (2018-03-28 13:52:47 -0500) edit
add a comment see more comments