From b2c97e4c36bc339eba11806f45ac2824a89065b7 Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Mon, 3 Jun 2024 15:07:57 -0700 Subject: [PATCH] fix(hot_water): Fix bug with translating default "ideal" hot water load --- lib/to_openstudio/load/service_hot_water.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/to_openstudio/load/service_hot_water.rb b/lib/to_openstudio/load/service_hot_water.rb index db92177..d90d440 100644 --- a/lib/to_openstudio/load/service_hot_water.rb +++ b/lib/to_openstudio/load/service_hot_water.rb @@ -233,6 +233,11 @@ def add_hot_water_plants(openstudio_model, shw_hashes) end def to_openstudio(openstudio_model, os_space, shw_name) + # if there's no name, assume that we're using the default district water heater + if shw_name.nil? + shw_name = 'default_district_shw' + end + # create water use equipment + connection and set identifier os_shw_def = OpenStudio::Model::WaterUseEquipmentDefinition.new(openstudio_model) os_shw = OpenStudio::Model::WaterUseEquipment.new(os_shw_def) @@ -273,9 +278,6 @@ def to_openstudio(openstudio_model, os_space, shw_name) @@max_target_temp = target_temp @@max_temp_schedule = target_water_sch end - if shw_name.nil? - shw_name = 'default_district_shw' - end if @@shw_connections[shw_name].nil? @@shw_connections[shw_name] = [] end