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 7 years ago

antonszilasi's avatar

updated 7 years ago

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?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
4

answered 7 years ago

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.

Preview: (hide)
link
0

answered 7 years ago

antonszilasi's avatar

updated 7 years ago

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.

Preview: (hide)
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  ( 7 years ago )

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: 7 years ago

Seen: 1,047 times

Last updated: Aug 16 '17