Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/BOSS/boss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def write_baseline_osw(xml_file_path, output_dir, epw_file_path, standard_to_be_
OSWArgPopulator::populate_set_lighting_loads_by_LPD_args(baseline_osw, bsync_reader)
OSWArgPopulator::populate_set_electric_equipment_loads_by_epd_args(baseline_osw, bsync_reader)
OSWArgPopulator::populate_replace_baseline_windows_args(baseline_osw, bsync_reader)
OSWArgPopulator::populate_set_infiltration_by_ach_args(baseline_osw, bsync_reader)

OSWArgPopulator::populate_openstudio_results_args(baseline_osw, bsync_reader)

Expand Down
31 changes: 31 additions & 0 deletions lib/BOSS/buildingsync_reader/buildingsync_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,37 @@ def get_window_data
return window_pane_type, fenestration_u_factor, solar_heat_gain_coefficient, visible_transmittance
end
end

def _get_systems(system_name, system_path)
BOSS.BOSS_logger.info("|\t|\t|\t- finding all #{system_name} systems...")
systems = @facility_xml.elements.each("#{@ns}Systems/#{system_path}") {|s| s}
if systems.nil? || systems.length == 0
BOSS.BOSS_logger.info("|\t|\t|\t no #{system_name} systems found")
end
BOSS.BOSS_logger.info("|\t|\t|\t #{systems.length} #{system_name} systems found")

return systems
end


def get_air_infiltration_value
air_infiltration_system = _get_systems(
system_name="Air Infiltration",
system_path="#{@ns}AirInfiltrationSystems/#{@ns}AirInfiltrationSystem"
).first

return nil, nil if air_infiltration_system.nil?

units = air_infiltration_system.elements["#{@ns}AirInfiltrationValueUnits"]&.text
value = air_infiltration_system.elements["#{@ns}AirInfiltrationValue"]&.text

return "ACH50", value if units == "ACH50"
return "ACH_natural", value if units == "ACHnatural"

BOSS.BOSS_logger.info("|\t|\t|\t units is '#{units}', which does not translate.")
return nil, nil
end

return nil
end
end
Expand Down
36 changes: 36 additions & 0 deletions lib/BOSS/osw_arg_populator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,42 @@ def self.populate_replace_baseline_windows_args(osw, bsync_reader)

end

def self.populate_set_infiltration_by_ach_args(osw, bsync_reader)
BOSS.BOSS_logger.info("+++++++++++++++++++++ populating measure set_infiltration_by_ach +++++++++++++++++++++")
osw[:steps].append({"measure_dir_name": "set_infiltration_by_ach", "arguments": {}})
set_measure_argument = lambda {| key, value | OpenStudio::Extension.set_measure_argument(osw, "set_infiltration_by_ach", key, value) }

BOSS.BOSS_logger.info("|\t- gathering measure requirements...")
BOSS.BOSS_logger.info("|\t|\t- getting air infiltration value...")
input_type, ach_value = bsync_reader.get_air_infiltration_value

# skip if no input_type
if input_type.nil?
BOSS.BOSS_logger.info("|\t|\t- skipping measure...")
set_measure_argument.call("__SKIP__", true)
return
end

# - __SKIP__
set_measure_argument.call("__SKIP__", false)
# - input_type
BOSS.BOSS_logger.info("|\t- setting arg 'input_type'...")
BOSS.BOSS_logger.info("|\t set to #{input_type}")
set_measure_argument.call("input_type", input_type)
# - ach_value
BOSS.BOSS_logger.info("|\t- setting arg 'ach_value'...")
BOSS.BOSS_logger.info("|\t set to #{ach_value}")
set_measure_argument.call("ach_value", ach_value)
# - n_factor
BOSS.BOSS_logger.info("|\t- setting arg 'n_factor'...")
BOSS.BOSS_logger.info("|\t defaults to '20'")
set_measure_argument.call("n_factor", "20")

BOSS.BOSS_logger.info("++++++++++++++++++++++++++++++++++ populated. +++++++++++++++++++++++++++++++++++++++")
BOSS.BOSS_logger.info("")
end


def self.populate_openstudio_results_args(osw, bsync_reader)
BOSS.BOSS_logger.info("+++++++++++++++++++++++++ populating measure openstudio_results +++++++++++++++++++++")
osw[:steps].append({"measure_dir_name": "openstudio_results", "arguments": {}})
Expand Down
Loading