From 7c58340c9d0c8c9bed70fa69e1a65ffbd46d4eb1 Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Mon, 1 Aug 2022 14:17:20 -0400 Subject: [PATCH] fix(shw): Ensure hot water plant does not get created when all load is 0 --- lib/to_openstudio/geometry/room.rb | 10 ++++++---- lib/to_openstudio/model.rb | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/to_openstudio/geometry/room.rb b/lib/to_openstudio/geometry/room.rb index c158eb7..d260e68 100644 --- a/lib/to_openstudio/geometry/room.rb +++ b/lib/to_openstudio/geometry/room.rb @@ -312,10 +312,12 @@ def to_openstudio(openstudio_model) # assign service hot water if it exists if @hash[:properties][:energy][:service_hot_water] - shw_space = ServiceHotWaterAbridged.new(@hash[:properties][:energy][:service_hot_water]) - os_shw_space = shw_space.to_openstudio( - openstudio_model, os_space, @hash[:properties][:energy][:shw]) - $shw_for_plant = shw_space + if @hash[:properties][:energy][:service_hot_water][:flow_per_area].to_f != 0 + shw_space = ServiceHotWaterAbridged.new(@hash[:properties][:energy][:service_hot_water]) + os_shw_space = shw_space.to_openstudio( + openstudio_model, os_space, @hash[:properties][:energy][:shw]) + $shw_for_plant = shw_space + end end # assign infiltration if it exists diff --git a/lib/to_openstudio/model.rb b/lib/to_openstudio/model.rb index e37c9dd..f529da2 100644 --- a/lib/to_openstudio/model.rb +++ b/lib/to_openstudio/model.rb @@ -454,10 +454,12 @@ def create_rooms program_type_id = room[:properties][:energy][:program_type] shw_hash = $programtype_shw_hash[program_type_id] unless shw_hash.nil? - shw_object = ServiceHotWaterAbridged.new(shw_hash) - openstudio_shw = shw_object.to_openstudio( - @openstudio_model, openstudio_room, room[:properties][:energy][:shw]) - $shw_for_plant = shw_object + if shw_hash[:flow_per_area].to_f != 0 + shw_object = ServiceHotWaterAbridged.new(shw_hash) + openstudio_shw = shw_object.to_openstudio( + @openstudio_model, openstudio_room, room[:properties][:energy][:shw]) + $shw_for_plant = shw_object + end end end