Skip to content

Commit

Permalink
Merge pull request #150 from NREL/space_type_names_fix
Browse files Browse the repository at this point in the history
Space type names fix
  • Loading branch information
mdahlhausen authored Jul 26, 2022
2 parents 8c04622 + 4b3f50f commit 2f510c8
Show file tree
Hide file tree
Showing 2 changed files with 438 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/openstudio/extension/core/os_lib_model_generation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def get_space_types_from_building_type(building_type, template, whole_building =
hash['Cafe'] = { ratio: 0.0103, space_type_gen: true, default: false }
hash['CleanWork'] = { ratio: 0.0071, space_type_gen: true, default: false }
hash['Conference'] = { ratio: 0.0082, space_type_gen: true, default: false }
hash['DresingRoom'] = { ratio: 0.0021, space_type_gen: true, default: false }
hash['DressingRoom'] = { ratio: 0.0021, space_type_gen: true, default: false }
hash['Elec/MechRoom'] = { ratio: 0.0109, space_type_gen: true, default: false }
hash['ElevatorPumpRoom'] = { ratio: 0.0022, space_type_gen: true, default: false }
hash['Exam'] = { ratio: 0.1029, space_type_gen: true, default: true }
Expand Down Expand Up @@ -3439,9 +3439,6 @@ def wizard(model, runner, user_arguments)
# mapping building_type name is needed for a few methods
lookup_building_type = standard.model_get_lookup_name(building_type)

# remap small medium and large office to office
if building_type.include?('Office') then building_type = 'Office' end

# get array of new space types
space_types_new = []

Expand All @@ -3457,14 +3454,14 @@ def wizard(model, runner, user_arguments)

# create space type
space_type = OpenStudio::Model::SpaceType.new(model)
space_type.setStandardsBuildingType(building_type)
space_type.setStandardsBuildingType(lookup_building_type)
space_type.setStandardsSpaceType(space_type_name)
space_type.setName("#{building_type} #{space_type_name}")
space_type.setName("#{lookup_building_type} #{space_type_name}")

# add to array of new space types
space_types_new << space_type

# add internal loads (the nil check isn't ncessary, but I will keep it in as a warning instad of an error)
# add internal loads (the nil check isn't necessary, but I will keep it in as a warning instad of an error)
test = standard.space_type_apply_internal_loads(space_type, true, true, true, true, true, true)
if test.nil?
runner.registerWarning("Could not add loads for #{space_type.name}. Not expected for #{template} #{lookup_building_type}")
Expand Down
Loading

0 comments on commit 2f510c8

Please sign in to comment.