Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
4

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

asked 2017-08-15 11:02:01 -0600

antonszilasi's avatar

updated 2017-08-15 13:41:47 -0600

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?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2017-08-15 14:46:03 -0600

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.

edit flag offensive delete link more
0

answered 2017-08-16 13:08:15 -0600

antonszilasi's avatar

updated 2017-08-16 13:08:58 -0600

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.

edit flag offensive delete link more

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 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2017-08-15 11:02:01 -0600

Seen: 1,010 times

Last updated: Aug 16 '17