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
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
end
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)
else
sizing_ip_neat = 'Autosized'
end
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)
else
value_ip_neat = 'Autosized'
end
data_array = [component.iddObject.name, 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)
else
sizing_ip_neat = 'Autosized'
end