Skip to content

Commit

Permalink
Merge pull request #147 from NREL/develop
Browse files Browse the repository at this point in the history
Prep Release 0.5.1
  • Loading branch information
nllong authored Nov 3, 2021
2 parents b04b3fe + 6c4714a commit 8c04622
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# OpenStudio Extension Gem

## Version 0.5.1

* Fix adjancent surface matching

## Version 0.5.0

* Update OpenStudio Workflow Gem to 2.3.0 (support for epJSON)
Expand Down
25 changes: 17 additions & 8 deletions lib/openstudio/extension/core/os_lib_model_generation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1146,13 +1146,13 @@ def create_bar(runner, model, bar_hash, story_multiplier_method = 'Basements Gro
spaces_temp = OpenStudio::Model::SpaceVector.new
spaces_temp << space_a
spaces_temp << space_b
# disable until enhanced intersectio nand matching, will make walls adiabatic and exterior within create_bar workflow
# attempt to intersect and match walls on a story, but later secondary match will look for missted matches and turn them to adiabaitc
# intersect and sort
# OpenStudio::Model.intersectSurfaces(spaces_temp)
# OpenStudio::Model.matchSurfaces(spaces_temp)
OpenStudio::Model.intersectSurfaces(spaces_temp)
OpenStudio::Model.matchSurfaces(spaces_temp)
end
end
runner.registerInfo("Intersecting and matching surfaces in story #{story.name}, this will create additional geometry.")
runner.registerInfo("Intersecting and matching surfaces in story #{story.name}, this will create additional geometry. Diagnstoic intersection and matching done a in paris of spaces.")
end
end

Expand All @@ -1173,11 +1173,11 @@ def create_bar(runner, model, bar_hash, story_multiplier_method = 'Basements Gro
story.spaces.sort.each do |space|
story_spaces << space
end
# disable until enhanced intersectio nand matching, will make walls adiabatic and exterior within create_bar workflow
# attempt to intersect and match walls on a story, but later secondary match will look for missted matches and turn them to adiabaitc
# intersect and sort
# OpenStudio::Model.intersectSurfaces(story_spaces)
# OpenStudio::Model.matchSurfaces(story_spaces)
#runner.registerInfo("Intersecting and matching surfaces in story #{story.name}, this will create additional geometry.")
OpenStudio::Model.intersectSurfaces(story_spaces)
OpenStudio::Model.matchSurfaces(story_spaces)
runner.registerInfo("Intersecting and matching surfaces in story #{story.name}, this will create additional geometry.")
end
end

Expand Down Expand Up @@ -1205,7 +1205,9 @@ def create_bar(runner, model, bar_hash, story_multiplier_method = 'Basements Gro
runner.registerInfo("Finding non-exterior walls and setting boundary condition to adiabatic")

# need to organize by story incase top story is partial story
# should also be only for a single bar
story_bounding = {}
missed_match_count = 0

# gather new spaces by story
new_spaces.each do |space|
Expand Down Expand Up @@ -1238,6 +1240,7 @@ def create_bar(runner, model, bar_hash, story_multiplier_method = 'Basements Gro
v[:spaces].each do |space|
space.surfaces.each do |space_surface|
next if not space_surface.surfaceType == "Wall"
next if space_surface.outsideBoundaryCondition == "Surface" # if if found a match leave it alone, don't change to adiabiatc
surface_bounding_box = OpenStudio::BoundingBox.new
surface_bounding_box.addPoints(space.transformation * space_surface.vertices)
surface_on_outside = false
Expand All @@ -1253,10 +1256,16 @@ def create_bar(runner, model, bar_hash, story_multiplier_method = 'Basements Gro
# change if not exterior
if !surface_on_outside
space_surface.setOutsideBoundaryCondition("Adiabatic")
missed_match_count += 1
end
end
end
end

if missed_match_count > 0
runner.registerInfo("#{missed_match_count} surfaces that were exterior appear to be interior walls and had boundary condition chagned to adiabiatic.")
end

end

# sort stories (by name for now but need better way)
Expand Down
2 changes: 1 addition & 1 deletion lib/openstudio/extension/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@

module OpenStudio
module Extension
VERSION = '0.5.0'.freeze
VERSION = '0.5.1'.freeze
end
end
2 changes: 1 addition & 1 deletion spec/openstudio/core/os_lib_model_generation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def arguments(model)
arg = OpenStudio::Measure::OSArgument.makeBoolArgument('custom_height_bar', true); arg.setValue(true); args << arg
arg = OpenStudio::Measure::OSArgument.makeBoolArgument('bottom_story_ground_exposed_floor', true); arg.setValue(true); args << arg
arg = OpenStudio::Measure::OSArgument.makeBoolArgument('top_story_exterior_exposed_roof', true); arg.setValue(true); args << arg
arg = OpenStudio::Measure::OSArgument.makeBoolArgument('make_mid_story_surfaces_adiabatic', true); arg.setValue(false); args << arg
arg = OpenStudio::Measure::OSArgument.makeBoolArgument('make_mid_story_surfaces_adiabatic', true); arg.setValue(true); args << arg
arg = OpenStudio::Measure::OSArgument.makeBoolArgument('use_upstream_args', true); arg.setValue(false); args << arg
arg = OpenStudio::Measure::OSArgument.makeStringArgument('story_multiplier', true); arg.setValue('Basements Ground Mid Top'); args << arg
arg = OpenStudio::Measure::OSArgument.makeStringArgument('bar_division_method', true); arg.setValue('Multiple Space Types - Individual Stories Sliced'); args << arg
Expand Down

0 comments on commit 8c04622

Please sign in to comment.