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

openstudio 1.9 report SI unit

asked 2015-10-09 09:39:03 -0500

ngkhanh gravatar image

updated 2015-10-10 05:34:14 -0500

Hello i installed lastest 1.9 version Openstudio but the Openstudio report did change into IP system although i checked SI setup in OS menu. It's my setup fault or all report in 1.9 likes that. I have not this problem in OS 1.8

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2015-10-09 14:01:14 -0500

updated 2015-10-09 14:07:24 -0500

Adding to @David Goldwasser's answer: since the new default report is available in measure form on the BCL, you could edit the os_lib_reporting.rb file (in the resources folder of the measure) to remove all the instances where the measure converts a value from SI to IP with OpenStudio::convert*, and then run your edited measure from the measures tab. See this page for more information on the built-in unit conversion.

*among other changes you might have to make.

edit flag offensive delete link more


your answer is highly appreciated but would you please explain more, using steps or screenshots on how to do so. i'm quite a beginner with openstudio and i've no programming background. regards

shahin1992 gravatar image shahin1992  ( 2016-05-16 04:34:53 -0500 )edit

answered 2015-10-09 13:46:24 -0500

Since we switched to an HTML based simulation report in 1.4.0 it hasn't responded to the units setting in the application. For SI results you can view the standard energyplus output from within OpenStudio, or write a custom SI measure.

Unit aware measures (reporting or model) would be a good feature request to add to the OpenStudio User Voice page.

In fact it looks like someone else has requested this, but you can add your vote to the request.

edit flag offensive delete link more

answered 2015-12-05 11:14:08 -0500

ngkhanh gravatar image

updated 2015-12-05 11:17:44 -0500

I get those following codes from os_lib_reporting.rb file. Plesae give me some instruction for change them into SI unit of value and unit shown in result.

First type:

    eui =  sqlFile.netSiteEnergy.get / query_results.get
    display = 'EUI'
    source_units = 'GJ/m^2'
    target_units = 'kBtu/ft^2'
    value = OpenStudio.convert(eui, source_units, target_units).get
    value_neat = OpenStudio.toNeatString(value, 2, true)
    general_building_information[:data] << [display, value_neat, target_units]
    runner.registerValue(display, value, target_units)
    return general_building_information

Second type:

# summary of what to show for each type of air loop component
  def self.air_loop_component_summary_logic(component, model)
    if component.to_AirLoopHVACOutdoorAirSystem.is_initialized
      component = component.to_AirLoopHVACOutdoorAirSystem.get
      # get ControllerOutdoorAir
      controller_oa = component.getControllerOutdoorAir

      sizing_source_units = 'm^3/s'
      sizing_target_units = 'cfm'
      if controller_oa.maximumOutdoorAirFlowRate.is_initialized
        sizing_ip = OpenStudio.convert(controller_oa.maximumOutdoorAirFlowRate.get, sizing_source_units, sizing_target_units).get
        sizing_ip_neat = OpenStudio.toNeatString(sizing_ip, 2, true)
        sizing_ip_neat = 'Autosized'
      value_source_units = 'm^3/s'
      value_target_units = 'cfm'
      if controller_oa.minimumOutdoorAirFlowRate.is_initialized
        value_ip = OpenStudio.convert(controller_oa.minimumOutdoorAirFlowRate.get, value_source_units, value_target_units).get
        value_ip_neat = OpenStudio.toNeatString(value_ip, 2, true)
        value_ip_neat = 'Autosized'
      data_array = [, sizing_ip_neat, sizing_target_units, 'Minimum Outdoor Air Flow Rate', value_ip_neat, value_target_units, '']

    elsif component.to_CoilCoolingDXSingleSpeed.is_initialized
      component = component.to_CoilCoolingDXSingleSpeed.get
      sizing_source_units = 'W'
      sizing_target_units = 'Btu/h'
      if component.ratedTotalCoolingCapacity.is_initialized
        sizing_ip = OpenStudio.convert(component.ratedTotalCoolingCapacity.get, sizing_source_units, sizing_target_units).get
        sizing_ip_neat = OpenStudio.toNeatString(sizing_ip, 2, true)
        sizing_ip_neat = 'Autosized'
edit flag offensive delete link more


it's no problem for me with Openstudio.convert - Removing all Openstudio.Convert syntax is easy , i . what should i replace for Openstudio.convert and how to change the related demonstrating code for showing the value and units like : sizing_ip = OpenStudio.convert(component.ratedTotalCoolingCapacity.get, sizing_source_units, sizing_target_units).get general_building_information[:data] << [display, value_neat, target_units] runner.registerValue(display, value, target_units)

I have no experiences with ruby/python programing style before so it's a little hard for me. Thanks

ngkhanh gravatar image ngkhanh  ( 2015-12-05 13:32:06 -0500 )edit

I'd recommend getting some grounding in Ruby in general - this is a good place to start. Basically, you can get the value you want with value = component.ratedTotalCoolingCapacity.get. Default units are SI, so the value is in Watts, so you don't need the convert method. Passing value to the method toNeatString makes the value look nice (instead of some long decimal point float), so I would keep that. Then you pass that neat string value to the data array, which becomes the entry for that component row in the table.

Eric Ringold gravatar image Eric Ringold  ( 2015-12-06 10:21:58 -0500 )edit

If you want to change as little code as possible you can just set target units to the same string as source units. Just need to make sure that the resulting value is only for display purposes. If any calculations are done on it, it may be expecting IP, which would create issues. I think I generally only converted to IP when I was getting ready to display results.

      value_source_units = 'm^3/s'
      value_target_units = 'm^3/s'
David Goldwasser gravatar image David Goldwasser  ( 2015-12-07 09:46:46 -0500 )edit

I'm modifying Openstudio standard report to SI. I dont want to need to rerun the whole simulation each times for checking my result. How to run report measure only ?

ngkhanh gravatar image ngkhanh  ( 2016-01-02 11:54:33 -0500 )edit

Your Answer

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

Add Answer


Question Tools



Asked: 2015-10-09 09:39:03 -0500

Seen: 1,352 times

Last updated: Dec 05 '15