diff --git a/lib/openstudio-standards/create_typical/create_typical.rb b/lib/openstudio-standards/create_typical/create_typical.rb index 37efcb635..505102b22 100644 --- a/lib/openstudio-standards/create_typical/create_typical.rb +++ b/lib/openstudio-standards/create_typical/create_typical.rb @@ -144,7 +144,7 @@ def self.create_typical_building_from_model(model, # check that weekday start time plus duration does not exceed 24 hrs if (wkdy_op_hrs_start_time_hr + wkdy_op_hrs_duration_hr + (wkdy_op_hrs_start_time_min + wkdy_op_hrs_duration_min) / 60.0) > 24.0 - OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CreateTypical', "Weekday start time of #{wkdy_op_hrs_start} plus duration of #{wkdy_op_hrs_duration} is more than 24 hrs, hours of operation overlap midnight.") + OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CreateTypical', "Weekday start time of #{wkdy_op_hrs_start_time} plus duration of #{wkdy_op_hrs_duration} is more than 24 hrs, hours of operation overlap midnight.") end end diff --git a/lib/openstudio-standards/geometry/create_bar.rb b/lib/openstudio-standards/geometry/create_bar.rb index 7e84b6931..70e1f9532 100644 --- a/lib/openstudio-standards/geometry/create_bar.rb +++ b/lib/openstudio-standards/geometry/create_bar.rb @@ -190,7 +190,7 @@ def self.model_envelope_data(model) building_overhang_area_w = 0.0 # loop through stories based on mine z height of surfaces. - sorted_stories = sort_building_stories_and_get_min_multiplier(model).sort_by { |k, v| v } + sorted_stories = OpenstudioStandards::Geometry.model_sort_building_stories_and_get_min_multiplier(model).sort_by { |k, v| v } sorted_stories.each do |story, story_min_z| story_min_multiplier = nil story_footprint = nil @@ -365,10 +365,10 @@ def self.model_envelope_data(model) end end - envelope_data_hash[:building_overhang_proj_factor_n] = building_overhang_area_n / ext_surfaces_hash['northWindow'] - envelope_data_hash[:building_overhang_proj_factor_s] = building_overhang_area_s / ext_surfaces_hash['southWindow'] - envelope_data_hash[:building_overhang_proj_factor_e] = building_overhang_area_e / ext_surfaces_hash['eastWindow'] - envelope_data_hash[:building_overhang_proj_factor_w] = building_overhang_area_w / ext_surfaces_hash['westWindow'] + envelope_data_hash[:building_overhang_proj_factor_n] = building_overhang_area_n / ext_surfaces_hash['north_window'] + envelope_data_hash[:building_overhang_proj_factor_s] = building_overhang_area_s / ext_surfaces_hash['south_window'] + envelope_data_hash[:building_overhang_proj_factor_e] = building_overhang_area_e / ext_surfaces_hash['east_window'] + envelope_data_hash[:building_overhang_proj_factor_w] = building_overhang_area_w / ext_surfaces_hash['west_window'] # warn for spaces that are not on a story (in future could infer stories for these) model.getSpaces.sort.each do |space| @@ -390,7 +390,7 @@ def self.bar_reduced_bounding_box(envelope_data_hash) bounding_length = envelope_data_hash[:building_max_xyz][0] - envelope_data_hash[:building_min_xyz][0] bounding_width = envelope_data_hash[:building_max_xyz][1] - envelope_data_hash[:building_min_xyz][1] bounding_area = bounding_length * bounding_width - footprint_area = envelope_data_hash[:building_floor_area] / envelope_data_hash[:effective_num_stories].to_f + footprint_area = envelope_data_hash[:building_floor_area] / (envelope_data_hash[:effective_num_stories_above_grade]. + envelope_data_hash[:effective_num_stories_below_grade].to_f) area_multiplier = footprint_area / bounding_area edge_multiplier = Math.sqrt(area_multiplier) bar[:length] = bounding_length * edge_multiplier @@ -408,7 +408,7 @@ def self.bar_reduced_width(envelope_data_hash) bounding_length = envelope_data_hash[:building_max_xyz][0] - envelope_data_hash[:building_min_xyz][0] bounding_width = envelope_data_hash[:building_max_xyz][1] - envelope_data_hash[:building_min_xyz][1] - footprint_area = envelope_data_hash[:building_floor_area] / envelope_data_hash[:effective_num_stories].to_f + footprint_area = envelope_data_hash[:building_floor_area] / (envelope_data_hash[:effective_num_stories_above_grade]. + envelope_data_hash[:effective_num_stories_below_grade].to_f) if bounding_length >= bounding_width bar[:length] = bounding_length @@ -430,7 +430,7 @@ def self.bar_stretched(envelope_data_hash) bounding_length = envelope_data_hash[:building_max_xyz][0] - envelope_data_hash[:building_min_xyz][0] bounding_width = envelope_data_hash[:building_max_xyz][1] - envelope_data_hash[:building_min_xyz][1] - a = envelope_data_hash[:building_floor_area] / envelope_data_hash[:effective_num_stories].to_f + a = envelope_data_hash[:building_floor_area] / (envelope_data_hash[:effective_num_stories_above_grade]. + envelope_data_hash[:effective_num_stories_below_grade].to_f) p = envelope_data_hash[:building_perimeter] if bounding_length >= bounding_width diff --git a/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb b/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb index 8e920816f..38f3a1f8c 100644 --- a/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb +++ b/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb @@ -5181,8 +5181,7 @@ def model_add_low_temp_radiant(model, surface.setConstruction(radiant_interior_floor_slab_construction) # also assign construction to adjacent surface - adjacent_surface = surface.adjacentSurface - if adjacent_surface.is_initialized + if surface.adjacentSurface.is_initialized adjacent_surface = surface.adjacentSurface.get adjacent_surface.setConstruction(rev_radiant_interior_floor_slab_construction) end @@ -5196,8 +5195,7 @@ def model_add_low_temp_radiant(model, surface.setConstruction(radiant_interior_ceiling_slab_construction) # also assign construction to adjacent surface - adjacent_surface = surface.adjacentSurface - if adjacent_surface.is_initialized + if surface.adjacentSurface.is_initialized adjacent_surface = surface.adjacentSurface.get adjacent_surface.setConstruction(rev_radiant_interior_ceiling_slab_construction) end diff --git a/test/modules/create_typical/test_create_typical.rb b/test/modules/create_typical/test_create_typical.rb index c95ae46c7..bacd237e9 100644 --- a/test/modules/create_typical/test_create_typical.rb +++ b/test/modules/create_typical/test_create_typical.rb @@ -93,4 +93,33 @@ def test_create_typical_building_from_model_with_hvac_mapping assert(ptacs.length==4) assert(psz_ac.length==1) end + + def test_create_typical_ese_op_hrs_overnight + # load model and set up weather file + template = 'DEER Pre-1975' + climate_zone = 'CEC T24-CEC3' + std = Standard.build(template) + model = std.safe_load_model("#{File.dirname(__FILE__)}/../../../data/geometry/DEER_ESe.osm") + OpenstudioStandards::Weather.model_set_building_location(model, climate_zone: climate_zone) + + # set output directory + output_dir = "#{__dir__}/output" + FileUtils.mkdir output_dir unless Dir.exist? output_dir + + # apply create typical + starting_size = model.getModelObjects.size + result = @create.create_typical_building_from_model(model, + template, + climate_zone: climate_zone, + modify_wkdy_op_hrs: true, + wkdy_op_hrs_start_time: 12.50, + wkdy_op_hrs_duration: 13.0, + modify_wknd_op_hrs: true, + wknd_op_hrs_start_time: 8.00, + wknd_op_hrs_duration: 6.00, + sizing_run_directory: output_dir) + ending_size = model.getModelObjects.size + assert(result) + assert(starting_size < ending_size) + end end