@@ -121,7 +121,7 @@ def run(model, runner, user_arguments)
121121 # Do these once upfront for the entire HPXML object
122122 epw_path , weather = process_weather ( runner , hpxml , args )
123123 process_whole_sfa_mf_inputs ( hpxml )
124- hpxml_sch_map , hpxml_all_zone_loads , hpxml_all_space_loads = process_defaults_schedules_emissions_files ( runner , weather , hpxml , args )
124+ hpxml_sch_map , design_loads_results_out = process_defaults_schedules_emissions_files ( runner , weather , hpxml , args )
125125
126126 # Write updated HPXML object (w/ defaults) to file for inspection
127127 XMLHelper . write_file ( hpxml . to_doc , args [ :hpxml_defaults_path ] )
@@ -157,16 +157,13 @@ def run(model, runner, user_arguments)
157157
158158 # Write annual results output file
159159 # This is helpful if the user wants to get these results right away (e.g.,
160- # they might be using the run_simulation.rb --skip-simulation argument.
161- results_out = [ ]
162- Outputs . append_sizing_results ( hpxml . buildings , results_out )
163- Outputs . write_results_out_to_file ( results_out , args [ :output_format ] , args [ :annual_output_file_path ] )
160+ # they might be using the run_simulation.rb --skip-simulation argument) .
161+ annual_results_out = [ ]
162+ Outputs . append_sizing_results ( hpxml . buildings , annual_results_out )
163+ Outputs . write_results_out_to_file ( annual_results_out , args [ :output_format ] , args [ :annual_output_file_path ] )
164164
165165 # Write design load details output file
166- hpxml . buildings . each do |hpxml_bldg |
167- HVACSizing . write_detailed_output ( args [ :output_format ] , args [ :design_load_details_output_file_path ] ,
168- hpxml_bldg , hpxml_all_zone_loads [ hpxml_bldg ] , hpxml_all_space_loads [ hpxml_bldg ] )
169- end
166+ HVACSizing . write_detailed_output ( design_loads_results_out , args [ :output_format ] , args [ :design_load_details_output_file_path ] )
170167 rescue Exception => e
171168 runner . registerError ( "#{ e . message } \n #{ e . backtrace . join ( "\n " ) } " )
172169 return false
@@ -273,7 +270,7 @@ def process_whole_sfa_mf_inputs(hpxml)
273270 # @param weather [WeatherFile] Weather object containing EPW information
274271 # @param hpxml [HPXML] HPXML object
275272 # @param args [Hash] Map of :argument_name => value
276- # @return [Array<Hash, Hash, Hash >] Maps of HPXML Building => SchedulesFile object, HPXML Building => (Map of HPXML::Zones => DesignLoadValues object), HPXML Building => (Map of HPXML::Spaces => DesignLoadValues object)
273+ # @return [Array<Hash, Array >] Maps of HPXML Building => SchedulesFile object, Rows of design loads output data
277274 def process_defaults_schedules_emissions_files ( runner , weather , hpxml , args )
278275 hpxml_sch_map = { }
279276 hpxml_all_zone_loads = { }
@@ -300,7 +297,14 @@ def process_defaults_schedules_emissions_files(runner, weather, hpxml, args)
300297 Schedule . check_emissions_references ( hpxml . header , args [ :hpxml_path ] )
301298 Schedule . validate_emissions_files ( hpxml . header )
302299
303- return hpxml_sch_map , hpxml_all_zone_loads , hpxml_all_space_loads
300+ # Compile design load outputs for subsequent writing
301+ # This needs to come before we collapse enclosure surfaces
302+ design_loads_results_out = [ ]
303+ hpxml . buildings . each do |hpxml_bldg |
304+ HVACSizing . append_detailed_output ( hpxml_bldg , hpxml_all_zone_loads [ hpxml_bldg ] , hpxml_all_space_loads [ hpxml_bldg ] , design_loads_results_out )
305+ end
306+
307+ return hpxml_sch_map , design_loads_results_out
304308 end
305309
306310 # Creates a full OpenStudio model that represents the given HPXML individual dwelling by
0 commit comments