openstudio-model-articulation 0.2.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -1
  3. data/CHANGELOG.md +36 -19
  4. data/Gemfile +6 -0
  5. data/Jenkinsfile +1 -0
  6. data/LICENSE.md +1 -1
  7. data/README.md +14 -0
  8. data/Rakefile +5 -7
  9. data/doc_templates/LICENSE.md +1 -1
  10. data/doc_templates/copyright_erb.txt +1 -1
  11. data/doc_templates/copyright_js.txt +1 -1
  12. data/doc_templates/copyright_ruby.txt +1 -1
  13. data/lib/measures/AssignConstructionSetToBuilding/LICENSE.md +1 -1
  14. data/lib/measures/AssignConstructionSetToBuilding/measure.rb +1 -3
  15. data/lib/measures/AssignConstructionSetToBuilding/measure.xml +11 -10
  16. data/lib/measures/AssignSpaceTypeBySpaceName/LICENSE.md +1 -1
  17. data/lib/measures/AssignSpaceTypeBySpaceName/measure.rb +1 -3
  18. data/lib/measures/AssignSpaceTypeBySpaceName/measure.xml +11 -10
  19. data/lib/measures/AssignSpaceTypeToBuilding/LICENSE.md +1 -1
  20. data/lib/measures/AssignSpaceTypeToBuilding/measure.rb +1 -3
  21. data/lib/measures/AssignSpaceTypeToBuilding/measure.xml +11 -10
  22. data/lib/measures/AssignSpacesToStories/LICENSE.md +1 -1
  23. data/lib/measures/AssignSpacesToStories/measure.rb +1 -3
  24. data/lib/measures/AssignSpacesToStories/measure.xml +9 -8
  25. data/lib/measures/BarAspectRatioStudy/LICENSE.md +1 -1
  26. data/lib/measures/BarAspectRatioStudy/measure.rb +1 -3
  27. data/lib/measures/BarAspectRatioStudy/measure.xml +8 -7
  28. data/lib/measures/CleanupSpaceOrigins/LICENSE.md +1 -1
  29. data/lib/measures/CleanupSpaceOrigins/measure.rb +1 -3
  30. data/lib/measures/CleanupSpaceOrigins/measure.xml +9 -8
  31. data/lib/measures/FindAndReplaceObjectNames/LICENSE.md +1 -1
  32. data/lib/measures/FindAndReplaceObjectNames/measure.rb +1 -3
  33. data/lib/measures/FindAndReplaceObjectNames/measure.xml +8 -7
  34. data/lib/measures/InjectOsmGeometryIntoAnExternalIdf/LICENSE.md +1 -1
  35. data/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.rb +1 -3
  36. data/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.xml +10 -10
  37. data/lib/measures/RemoveHardAssignedConstructions/LICENSE.md +1 -1
  38. data/lib/measures/RemoveHardAssignedConstructions/measure.rb +1 -3
  39. data/lib/measures/RemoveHardAssignedConstructions/measure.xml +8 -7
  40. data/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/LICENSE.md +1 -1
  41. data/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/measure.rb +1 -3
  42. data/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/measure.xml +9 -8
  43. data/lib/measures/RotateBuilding/LICENSE.md +1 -1
  44. data/lib/measures/RotateBuilding/measure.rb +1 -3
  45. data/lib/measures/RotateBuilding/measure.xml +8 -7
  46. data/lib/measures/SetExtWallToGroundBoundaryConditionByStory/LICENSE.md +1 -1
  47. data/lib/measures/SetExtWallToGroundBoundaryConditionByStory/measure.rb +1 -3
  48. data/lib/measures/SetExtWallToGroundBoundaryConditionByStory/measure.xml +8 -7
  49. data/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/LICENSE.md +1 -1
  50. data/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.rb +1 -3
  51. data/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.xml +8 -7
  52. data/lib/measures/SetInteriorWallsToSelectedConstruction/LICENSE.md +1 -1
  53. data/lib/measures/SetInteriorWallsToSelectedConstruction/measure.rb +1 -3
  54. data/lib/measures/SetInteriorWallsToSelectedConstruction/measure.xml +8 -7
  55. data/lib/measures/SetWindowToWallRatioByFacade/LICENSE.md +1 -1
  56. data/lib/measures/SetWindowToWallRatioByFacade/measure.rb +11 -6
  57. data/lib/measures/SetWindowToWallRatioByFacade/measure.xml +11 -5
  58. data/lib/measures/SimplifyGeometryToSlicedBar/LICENSE.md +1 -1
  59. data/lib/measures/SimplifyGeometryToSlicedBar/measure.rb +1 -3
  60. data/lib/measures/SimplifyGeometryToSlicedBar/measure.xml +8 -8
  61. data/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_cofee.rb +1 -3
  62. data/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_geometry.rb +1 -3
  63. data/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_helper_methods.rb +2 -4
  64. data/lib/measures/SpaceTypeAndConstructionSetWizard/LICENSE.md +1 -1
  65. data/lib/measures/SpaceTypeAndConstructionSetWizard/measure.rb +1 -3
  66. data/lib/measures/SpaceTypeAndConstructionSetWizard/measure.xml +63 -11
  67. data/lib/measures/SurfaceMatching/LICENSE.md +1 -1
  68. data/lib/measures/SurfaceMatching/measure.rb +1 -3
  69. data/lib/measures/SurfaceMatching/measure.xml +8 -7
  70. data/lib/measures/{BarAspectRatioSlicedBySpaceType → add_empd_material_properties}/LICENSE.md +1 -1
  71. data/lib/measures/add_empd_material_properties/README.md +116 -0
  72. data/lib/measures/{BarAspectRatioSlicedBySpaceType → add_empd_material_properties}/README.md.erb +0 -0
  73. data/lib/measures/add_empd_material_properties/docs/.gitkeep +0 -0
  74. data/lib/measures/add_empd_material_properties/measure.rb +247 -0
  75. data/lib/measures/add_empd_material_properties/measure.xml +201 -0
  76. data/lib/measures/blended_space_type_from_floor_area_ratios/LICENSE.md +1 -1
  77. data/lib/measures/blended_space_type_from_floor_area_ratios/measure.rb +1 -3
  78. data/lib/measures/blended_space_type_from_floor_area_ratios/measure.xml +5 -5
  79. data/lib/measures/blended_space_type_from_model/LICENSE.md +1 -1
  80. data/lib/measures/blended_space_type_from_model/measure.rb +1 -3
  81. data/lib/measures/blended_space_type_from_model/measure.xml +6 -6
  82. data/lib/measures/blended_space_type_from_model/resources/os_lib_model_simplification.rb +1 -3
  83. data/lib/measures/clone_building_from_external_model/LICENSE.md +1 -1
  84. data/lib/measures/clone_building_from_external_model/measure.rb +1 -3
  85. data/lib/measures/clone_building_from_external_model/measure.xml +5 -5
  86. data/lib/measures/create_DOE_prototype_building/LICENSE.md +1 -1
  87. data/lib/measures/create_DOE_prototype_building/measure.rb +3 -4
  88. data/lib/measures/create_DOE_prototype_building/measure.xml +509 -377
  89. data/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/LICENSE.md +1 -1
  90. data/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/measure.rb +1 -3
  91. data/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/measure.xml +5 -5
  92. data/lib/measures/create_bar_from_building_type_ratios/LICENSE.md +1 -1
  93. data/lib/measures/create_bar_from_building_type_ratios/README.md +109 -35
  94. data/lib/measures/create_bar_from_building_type_ratios/README.md.erb +54 -35
  95. data/lib/measures/create_bar_from_building_type_ratios/measure.rb +6 -3
  96. data/lib/measures/create_bar_from_building_type_ratios/measure.xml +129 -17
  97. data/lib/measures/create_bar_from_deer_building_type_ratios/LICENSE.md +1 -1
  98. data/lib/measures/create_bar_from_deer_building_type_ratios/README.md +301 -79
  99. data/lib/measures/create_bar_from_deer_building_type_ratios/README.md.erb +62 -79
  100. data/lib/measures/create_bar_from_deer_building_type_ratios/measure.rb +7 -4
  101. data/lib/measures/create_bar_from_deer_building_type_ratios/measure.xml +20 -64
  102. data/lib/measures/create_bar_from_doe_building_type_ratios/LICENSE.md +1 -1
  103. data/lib/measures/create_bar_from_doe_building_type_ratios/README.md +298 -57
  104. data/lib/measures/create_bar_from_doe_building_type_ratios/README.md.erb +54 -57
  105. data/lib/measures/create_bar_from_doe_building_type_ratios/measure.rb +7 -4
  106. data/lib/measures/create_bar_from_doe_building_type_ratios/measure.xml +127 -19
  107. data/lib/measures/create_bar_from_model/LICENSE.md +1 -1
  108. data/lib/measures/create_bar_from_model/measure.rb +1 -3
  109. data/lib/measures/create_bar_from_model/measure.xml +5 -5
  110. data/lib/measures/create_bar_from_space_type_ratios/LICENSE.md +27 -0
  111. data/lib/measures/create_bar_from_space_type_ratios/README.md +556 -0
  112. data/lib/measures/create_bar_from_space_type_ratios/README.md.erb +324 -0
  113. data/lib/measures/create_bar_from_space_type_ratios/docs/ar_05.png +0 -0
  114. data/lib/measures/create_bar_from_space_type_ratios/docs/ar_1.png +0 -0
  115. data/lib/measures/create_bar_from_space_type_ratios/docs/ar_2.png +0 -0
  116. data/lib/measures/create_bar_from_space_type_ratios/docs/bar_double_loaded.png +0 -0
  117. data/lib/measures/create_bar_from_space_type_ratios/docs/bar_single_core_perim.png +0 -0
  118. data/lib/measures/create_bar_from_space_type_ratios/docs/bar_sliced_indiv.png +0 -0
  119. data/lib/measures/create_bar_from_space_type_ratios/docs/bar_sliced_simple.png +0 -0
  120. data/lib/measures/create_bar_from_space_type_ratios/docs/basement.png +0 -0
  121. data/lib/measures/create_bar_from_space_type_ratios/docs/custom_height_false.png +0 -0
  122. data/lib/measures/create_bar_from_space_type_ratios/docs/custom_height_true.png +0 -0
  123. data/lib/measures/create_bar_from_space_type_ratios/docs/no_party_mult.png +0 -0
  124. data/lib/measures/create_bar_from_space_type_ratios/docs/party.png +0 -0
  125. data/lib/measures/create_bar_from_space_type_ratios/docs/party_multi.png +0 -0
  126. data/lib/measures/create_bar_from_space_type_ratios/docs/perim_mult_2010.png +0 -0
  127. data/lib/measures/create_bar_from_space_type_ratios/docs/perim_mult_2012.png +0 -0
  128. data/lib/measures/create_bar_from_space_type_ratios/docs/perim_mult_2020.png +0 -0
  129. data/lib/measures/create_bar_from_space_type_ratios/docs/sep_05.png +0 -0
  130. data/lib/measures/create_bar_from_space_type_ratios/docs/sep_10.png +0 -0
  131. data/lib/measures/create_bar_from_space_type_ratios/docs/sep_3.png +0 -0
  132. data/lib/measures/create_bar_from_space_type_ratios/docs/story_sort.png +0 -0
  133. data/lib/measures/create_bar_from_space_type_ratios/docs/wwr_custom.png +0 -0
  134. data/lib/measures/create_bar_from_space_type_ratios/measure.rb +314 -0
  135. data/lib/measures/create_bar_from_space_type_ratios/measure.xml +687 -0
  136. data/lib/measures/create_baseline_building/LICENSE.md +1 -1
  137. data/lib/measures/create_baseline_building/measure.rb +1 -1
  138. data/lib/measures/create_baseline_building/measure.xml +5 -5
  139. data/lib/measures/create_deer_prototype_building/LICENSE.md +1 -1
  140. data/lib/measures/create_deer_prototype_building/measure.rb +1 -3
  141. data/lib/measures/create_deer_prototype_building/measure.xml +6 -6
  142. data/lib/measures/create_deer_prototype_building/resources/deer_building_types.rb +1 -3
  143. data/lib/measures/create_parametric_schedules/LICENSE.md +1 -1
  144. data/lib/measures/create_parametric_schedules/measure.rb +1 -3
  145. data/lib/measures/create_parametric_schedules/measure.xml +5 -5
  146. data/lib/measures/create_typical_building_from_model/LICENSE.md +1 -1
  147. data/lib/measures/create_typical_building_from_model/README.md +82 -17
  148. data/lib/measures/create_typical_building_from_model/README.md.erb +36 -16
  149. data/lib/measures/create_typical_building_from_model/measure.rb +7 -7
  150. data/lib/measures/create_typical_building_from_model/measure.xml +62 -30
  151. data/lib/measures/create_typical_building_from_model/resources/Model.hvac.rb +7 -6
  152. data/lib/measures/create_typical_deer_building_from_model/LICENSE.md +1 -1
  153. data/lib/measures/create_typical_deer_building_from_model/README.md +173 -53
  154. data/lib/measures/create_typical_deer_building_from_model/README.md.erb +57 -53
  155. data/lib/measures/create_typical_deer_building_from_model/measure.rb +7 -4
  156. data/lib/measures/create_typical_deer_building_from_model/measure.xml +29 -29
  157. data/lib/measures/create_typical_deer_building_from_model/resources/Model.hvac.rb +7 -6
  158. data/lib/measures/create_typical_doe_building_from_model/LICENSE.md +1 -1
  159. data/lib/measures/create_typical_doe_building_from_model/README.md +182 -44
  160. data/lib/measures/create_typical_doe_building_from_model/README.md.erb +58 -44
  161. data/lib/measures/create_typical_doe_building_from_model/measure.rb +7 -4
  162. data/lib/measures/create_typical_doe_building_from_model/measure.xml +56 -24
  163. data/lib/measures/create_typical_doe_building_from_model/resources/Model.hvac.rb +7 -6
  164. data/lib/measures/deer_space_type_and_construction_set_wizard/LICENSE.md +1 -1
  165. data/lib/measures/deer_space_type_and_construction_set_wizard/measure.rb +1 -3
  166. data/lib/measures/deer_space_type_and_construction_set_wizard/measure.xml +17 -17
  167. data/lib/measures/find_and_replace_in_all_thermal_zone_names/LICENSE.md +1 -1
  168. data/lib/measures/find_and_replace_in_all_thermal_zone_names/measure.rb +1 -3
  169. data/lib/measures/find_and_replace_in_all_thermal_zone_names/measure.xml +8 -7
  170. data/lib/measures/make_shading_surfaces_based_on_zone_multipliers/LICENSE.md +1 -1
  171. data/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.rb +1 -3
  172. data/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.xml +5 -5
  173. data/lib/measures/merge_floorspace_js_with_model/LICENSE.md +1 -1
  174. data/lib/measures/merge_floorspace_js_with_model/measure.rb +1 -3
  175. data/lib/measures/merge_floorspace_js_with_model/measure.xml +5 -5
  176. data/lib/measures/merge_spaces_from_external_file/LICENSE.md +1 -1
  177. data/lib/measures/merge_spaces_from_external_file/measure.rb +1 -3
  178. data/lib/measures/merge_spaces_from_external_file/measure.xml +6 -6
  179. data/lib/measures/merge_spaces_from_external_file/resources/ScheduleTranslator.rb +5 -7
  180. data/lib/measures/radiance_measure/LICENSE.md +1 -1
  181. data/lib/measures/radiance_measure/measure.rb +2 -4
  182. data/lib/measures/radiance_measure/measure.xml +11 -11
  183. data/lib/measures/radiant_slab_with_doas/LICENSE.md +1 -1
  184. data/lib/measures/radiant_slab_with_doas/measure.rb +6 -4
  185. data/lib/measures/radiant_slab_with_doas/measure.xml +10 -10
  186. data/lib/measures/replace_geometry_by_story/LICENSE.md +1 -1
  187. data/lib/measures/replace_geometry_by_story/measure.rb +1 -3
  188. data/lib/measures/replace_geometry_by_story/measure.xml +5 -5
  189. data/lib/measures/scale_geometry/LICENSE.md +1 -1
  190. data/lib/measures/scale_geometry/measure.rb +1 -3
  191. data/lib/measures/scale_geometry/measure.xml +5 -5
  192. data/lib/openstudio/model_articulation/extension.rb +1 -1
  193. data/lib/openstudio/model_articulation/version.rb +2 -2
  194. data/lib/openstudio/model_articulation.rb +1 -1
  195. data/lib/openstudio-model-articulation.rb +1 -1
  196. data/openstudio-model-articulation.gemspec +3 -3
  197. metadata +44 -20
  198. data/lib/measures/.rubocop.yml +0 -5
  199. data/lib/measures/BarAspectRatioSlicedBySpaceType/README.md +0 -64
  200. data/lib/measures/BarAspectRatioSlicedBySpaceType/measure.rb +0 -186
  201. data/lib/measures/BarAspectRatioSlicedBySpaceType/measure.xml +0 -130
  202. data/lib/measures/BarAspectRatioSlicedBySpaceType/resources/os_lib_cofee.rb +0 -254
@@ -0,0 +1,314 @@
1
+ # *******************************************************************************
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
+ # All rights reserved.
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # (1) Redistributions of source code must retain the above copyright notice,
8
+ # this list of conditions and the following disclaimer.
9
+ #
10
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
11
+ # this list of conditions and the following disclaimer in the documentation
12
+ # and/or other materials provided with the distribution.
13
+ #
14
+ # (3) Neither the name of the copyright holder nor the names of any contributors
15
+ # may be used to endorse or promote products derived from this software without
16
+ # specific prior written permission from the respective party.
17
+ #
18
+ # (4) Other than as required in clauses (1) and (2), distributions in any form
19
+ # of modifications or other derivative works may not use the "OpenStudio"
20
+ # trademark, "OS", "os", or any other confusingly similar designation without
21
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
22
+ #
23
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
24
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
25
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
27
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
28
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
30
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ # *******************************************************************************
35
+
36
+ # see the URL below for information on how to write OpenStudio measures
37
+ # http://openstudio.nrel.gov/openstudio-measure-writing-guide
38
+
39
+ # see the URL below for information on using life cycle cost objects in OpenStudio
40
+ # http://openstudio.nrel.gov/openstudio-life-cycle-examples
41
+
42
+ # see the URL below for access to C++ documentation on model objects (click on "model" in the main window to view model objects)
43
+ # http://openstudio.nrel.gov/sites/openstudio.nrel.gov/files/nv_data/cpp_documentation_it/model/html/namespaces.html
44
+
45
+ require 'openstudio-standards'
46
+
47
+ # load OpenStudio measure libraries from openstudio-extension gem
48
+ require 'openstudio-extension'
49
+ require 'openstudio/extension/core/os_lib_helper_methods'
50
+ require 'openstudio/extension/core/os_lib_geometry.rb'
51
+ require 'openstudio/extension/core/os_lib_model_generation.rb'
52
+ require 'openstudio/extension/core/os_lib_model_simplification.rb'
53
+
54
+ # start the measure
55
+ class CreateBarFromSpaceTypeRatios < OpenStudio::Measure::ModelMeasure
56
+ # resource file modules
57
+ include OsLib_HelperMethods
58
+ include OsLib_Geometry
59
+ include OsLib_ModelGeneration
60
+ include OsLib_ModelSimplification
61
+
62
+ # define the name that a user will see, this method may be deprecated as
63
+ # the display name in PAT comes from the name field in measure.xml
64
+ def name
65
+ return 'Create Bar From Space Type Ratios'
66
+ end
67
+
68
+ # human readable description
69
+ def description
70
+ return 'Creates one or more rectangular building elements based on space type ratios of selected mix of building types, along with user arguments that describe the desired geometry characteristics.'
71
+ end
72
+
73
+ # human readable description of modeling approach
74
+ def modeler_description
75
+ return 'The building floor area can be described as a footprint size or as a total building area. The shape can be described by its aspect ratio or can be defined as a set width. Because this measure contains both DOE and DEER inputs, care needs to be taken to choose a template compatable with the selected building types. See readme document for additional guidance.'
76
+ end
77
+
78
+ # used to populate taxonomy in readme.md
79
+ def taxonomy
80
+ return 'Envelope.Form'
81
+ end
82
+
83
+ def arguments(model)
84
+ args = OpenStudio::Measure::OSArgumentVector.new
85
+
86
+ # Make argument for template
87
+ template = OpenStudio::Measure::OSArgument.makeChoiceArgument('template', get_templates(true), true) # setting up measure to list all templates, but space types in string should all come from one
88
+ template.setDisplayName('Target Standard')
89
+ template.setDefaultValue('90.1-2004')
90
+ args << template
91
+
92
+ # make an argument for space type ratios
93
+ space_type_hash_string = OpenStudio::Measure::OSArgument.makeStringArgument('space_type_hash_string', true)
94
+ space_type_hash_string.setDisplayName('Space Type Ratios String')
95
+ space_type_hash_string.setDescription('Hash of Space Types with Building and Space Type name as Key and Fraction as value. All space types should come from the selected OpenStudio Standards template. Example entry is (BuildingType | SpaceType => 0.25)')
96
+ space_type_hash_string.setDefaultValue('MediumOffice | Conference => 0.2, PrimarySchool | Corridor => 0.125, PrimarySchool | Classroom => 0.175, Warehouse | Office => 0.5')
97
+ args << space_type_hash_string
98
+
99
+ # Make argument for total_bldg_floor_area
100
+ total_bldg_floor_area = OpenStudio::Measure::OSArgument.makeDoubleArgument('total_bldg_floor_area', true)
101
+ total_bldg_floor_area.setDisplayName('Total Building Floor Area')
102
+ total_bldg_floor_area.setUnits('ft^2')
103
+ total_bldg_floor_area.setDefaultValue(10000.0)
104
+ args << total_bldg_floor_area
105
+
106
+ # Make argument for single_floor_area
107
+ single_floor_area = OpenStudio::Measure::OSArgument.makeDoubleArgument('single_floor_area', true)
108
+ single_floor_area.setDisplayName('Single Floor Area')
109
+ single_floor_area.setDescription('Non-zero value will fix the single floor area, overriding a user entry for Total Building Floor Area')
110
+ single_floor_area.setUnits('ft^2')
111
+ single_floor_area.setDefaultValue(0.0)
112
+ args << single_floor_area
113
+
114
+ # Make argument for floor_height
115
+ floor_height = OpenStudio::Measure::OSArgument.makeDoubleArgument('floor_height', true)
116
+ floor_height.setDisplayName('Typical Floor to FLoor Height')
117
+ floor_height.setDescription('Selecting a typical floor height of 0 will trigger a smart building type default.')
118
+ floor_height.setUnits('ft')
119
+ floor_height.setDefaultValue(0.0)
120
+ args << floor_height
121
+
122
+ # add argument to enable/disable multi custom space height bar
123
+ custom_height_bar = OpenStudio::Measure::OSArgument.makeBoolArgument('custom_height_bar', true)
124
+ custom_height_bar.setDisplayName('Enable Custom Height Bar Application')
125
+ custom_height_bar.setDescription('This is argument value is only relevant when smart default floor to floor height is used for a building type that has spaces with custom heights.')
126
+ custom_height_bar.setDefaultValue(true)
127
+ args << custom_height_bar
128
+
129
+ # Make argument for num_stories_above_grade
130
+ num_stories_above_grade = OpenStudio::Measure::OSArgument.makeDoubleArgument('num_stories_above_grade', true)
131
+ num_stories_above_grade.setDisplayName('Number of Stories Above Grade')
132
+ num_stories_above_grade.setDefaultValue(1.0)
133
+ args << num_stories_above_grade
134
+
135
+ # Make argument for num_stories_below_grade
136
+ num_stories_below_grade = OpenStudio::Measure::OSArgument.makeIntegerArgument('num_stories_below_grade', true)
137
+ num_stories_below_grade.setDisplayName('Number of Stories Below Grade')
138
+ num_stories_below_grade.setDefaultValue(0)
139
+ args << num_stories_below_grade
140
+
141
+ # Make argument for building_rotation
142
+ building_rotation = OpenStudio::Measure::OSArgument.makeDoubleArgument('building_rotation', true)
143
+ building_rotation.setDisplayName('Building Rotation')
144
+ building_rotation.setDescription('Set Building Rotation off of North (positive value is clockwise). Rotation applied after geometry generation. Values greater than +/- 45 will result in aspect ratio and party wall orientations that do not match cardinal directions of the inputs.')
145
+ building_rotation.setUnits('Degrees')
146
+ building_rotation.setDefaultValue(0.0)
147
+ args << building_rotation
148
+
149
+ # Make argument for ns_to_ew_ratio
150
+ ns_to_ew_ratio = OpenStudio::Measure::OSArgument.makeDoubleArgument('ns_to_ew_ratio', true)
151
+ ns_to_ew_ratio.setDisplayName('Ratio of North/South Facade Length Relative to East/West Facade Length')
152
+ ns_to_ew_ratio.setDescription('Selecting an aspect ratio of 0 will trigger a smart building type default. Aspect ratios less than one are not recommended for sliced bar geometry, instead rotate building and use a greater than 1 aspect ratio.')
153
+ ns_to_ew_ratio.setDefaultValue(0.0)
154
+ args << ns_to_ew_ratio
155
+
156
+ # Make argument for perim_mult
157
+ perim_mult = OpenStudio::Measure::OSArgument.makeDoubleArgument('perim_mult', true)
158
+ perim_mult.setDisplayName('Perimeter Multiplier')
159
+ perim_mult.setDescription('Selecting a value of 0 will trigger a smart building type default. This represents a multiplier for the building perimeter relative to the perimeter of a rectangular building that meets the area and aspect ratio inputs. Other than the smart default of 0.0 this argument should have a value of 1.0 or higher and is only applicable Multiple Space Types - Individual Stories Sliced division method.')
160
+ perim_mult.setDefaultValue(0.0)
161
+ args << perim_mult
162
+
163
+ # Make argument for bar_width
164
+ bar_width = OpenStudio::Measure::OSArgument.makeDoubleArgument('bar_width', true)
165
+ bar_width.setDisplayName('Bar Width')
166
+ bar_width.setDescription('Non-zero value will fix the building width, overriding user entry for Perimeter Multiplier. NS/EW Aspect Ratio may be limited based on target width.')
167
+ bar_width.setUnits('ft')
168
+ bar_width.setDefaultValue(0.0)
169
+ args << bar_width
170
+
171
+ # Make argument for bar_sep_dist_mult
172
+ bar_sep_dist_mult = OpenStudio::Measure::OSArgument.makeDoubleArgument('bar_sep_dist_mult', true)
173
+ bar_sep_dist_mult.setDisplayName('Bar Separation Distance Multiplier')
174
+ bar_sep_dist_mult.setDescription('Multiplier of separation between bar elements relative to building height.')
175
+ bar_sep_dist_mult.setDefaultValue(10.0)
176
+ args << bar_sep_dist_mult
177
+
178
+ # Make argument for wwr (in future add lookup for smart default)
179
+ wwr = OpenStudio::Measure::OSArgument.makeDoubleArgument('wwr', true)
180
+ wwr.setDisplayName('Window to Wall Ratio')
181
+ wwr.setDescription('Selecting a window to wall ratio of 0 will trigger a smart building type default.')
182
+ wwr.setDefaultValue(0.0)
183
+ args << wwr
184
+
185
+ # Make argument for party_wall_fraction
186
+ party_wall_fraction = OpenStudio::Measure::OSArgument.makeDoubleArgument('party_wall_fraction', true)
187
+ party_wall_fraction.setDisplayName('Fraction of Exterior Wall Area with Adjacent Structure')
188
+ party_wall_fraction.setDescription('This will impact how many above grade exterior walls are modeled with adiabatic boundary condition.')
189
+ party_wall_fraction.setDefaultValue(0.0)
190
+ args << party_wall_fraction
191
+
192
+ # party_wall_fraction was used where we wanted to represent some party walls but didn't know where they are, it ends up using methods to make whole surfaces adiabiatc by story and orientaiton to try to come close to requested fraction
193
+
194
+ # Make argument for party_wall_stories_north
195
+ party_wall_stories_north = OpenStudio::Measure::OSArgument.makeIntegerArgument('party_wall_stories_north', true)
196
+ party_wall_stories_north.setDisplayName('Number of North facing stories with party wall')
197
+ party_wall_stories_north.setDescription('This will impact how many above grade exterior north walls are modeled with adiabatic boundary condition. If this is less than the number of above grade stoes, upper flor will reamin exterior')
198
+ party_wall_stories_north.setDefaultValue(0)
199
+ args << party_wall_stories_north
200
+
201
+ # Make argument for party_wall_stories_south
202
+ party_wall_stories_south = OpenStudio::Measure::OSArgument.makeIntegerArgument('party_wall_stories_south', true)
203
+ party_wall_stories_south.setDisplayName('Number of South facing stories with party wall')
204
+ party_wall_stories_south.setDescription('This will impact how many above grade exterior south walls are modeled with adiabatic boundary condition. If this is less than the number of above grade stoes, upper flor will reamin exterior')
205
+ party_wall_stories_south.setDefaultValue(0)
206
+ args << party_wall_stories_south
207
+
208
+ # Make argument for party_wall_stories_east
209
+ party_wall_stories_east = OpenStudio::Measure::OSArgument.makeIntegerArgument('party_wall_stories_east', true)
210
+ party_wall_stories_east.setDisplayName('Number of East facing stories with party wall')
211
+ party_wall_stories_east.setDescription('This will impact how many above grade exterior east walls are modeled with adiabatic boundary condition. If this is less than the number of above grade stoes, upper flor will reamin exterior')
212
+ party_wall_stories_east.setDefaultValue(0)
213
+ args << party_wall_stories_east
214
+
215
+ # Make argument for party_wall_stories_west
216
+ party_wall_stories_west = OpenStudio::Measure::OSArgument.makeIntegerArgument('party_wall_stories_west', true)
217
+ party_wall_stories_west.setDisplayName('Number of West facing stories with party wall')
218
+ party_wall_stories_west.setDescription('This will impact how many above grade exterior west walls are modeled with adiabatic boundary condition. If this is less than the number of above grade stoes, upper flor will reamin exterior')
219
+ party_wall_stories_west.setDefaultValue(0)
220
+ args << party_wall_stories_west
221
+
222
+ # make an argument for bottom_story_ground_exposed_floor
223
+ bottom_story_ground_exposed_floor = OpenStudio::Measure::OSArgument.makeBoolArgument('bottom_story_ground_exposed_floor', true)
224
+ bottom_story_ground_exposed_floor.setDisplayName('Is the Bottom Story Exposed to Ground')
225
+ bottom_story_ground_exposed_floor.setDescription("This should be true unless you are modeling a partial building which doesn't include the lowest story. The bottom story floor will have an adiabatic boundary condition when false.")
226
+ bottom_story_ground_exposed_floor.setDefaultValue(true)
227
+ args << bottom_story_ground_exposed_floor
228
+
229
+ # make an argument for top_story_exterior_exposed_roof
230
+ top_story_exterior_exposed_roof = OpenStudio::Measure::OSArgument.makeBoolArgument('top_story_exterior_exposed_roof', true)
231
+ top_story_exterior_exposed_roof.setDisplayName('Is the Top Story an Exterior Roof')
232
+ top_story_exterior_exposed_roof.setDescription("This should be true unless you are modeling a partial building which doesn't include the highest story. The top story ceiling will have an adiabatic boundary condition when false.")
233
+ top_story_exterior_exposed_roof.setDefaultValue(true)
234
+ args << top_story_exterior_exposed_roof
235
+
236
+ # Make argument for story_multiplier
237
+ choices = OpenStudio::StringVector.new
238
+ choices << 'None'
239
+ choices << 'Basements Ground Mid Top'
240
+ # choices << "Basements Ground Midx5 Top"
241
+ story_multiplier = OpenStudio::Measure::OSArgument.makeChoiceArgument('story_multiplier', choices, true)
242
+ story_multiplier.setDisplayName('Calculation Method for Story Multiplier')
243
+ story_multiplier.setDefaultValue('Basements Ground Mid Top')
244
+ args << story_multiplier
245
+
246
+ # make an argument for make_mid_story_surfaces_adiabatic (added to avoid issues with intersect and to lower surface count when using individual stories sliced)
247
+ make_mid_story_surfaces_adiabatic = OpenStudio::Measure::OSArgument.makeBoolArgument('make_mid_story_surfaces_adiabatic', true)
248
+ make_mid_story_surfaces_adiabatic.setDisplayName('Make Mid Story Floor Surfaces Adiabatic')
249
+ make_mid_story_surfaces_adiabatic.setDescription('If set to true, this will skip surface intersection and make mid story floors and celings adiabatic, not just at multiplied gaps.')
250
+ make_mid_story_surfaces_adiabatic.setDefaultValue(false)
251
+ args << make_mid_story_surfaces_adiabatic
252
+
253
+ # make an argument for bar sub-division approach
254
+ choices = OpenStudio::StringVector.new
255
+ choices << 'Multiple Space Types - Simple Sliced'
256
+ choices << 'Multiple Space Types - Individual Stories Sliced'
257
+ choices << 'Single Space Type - Core and Perimeter' # not useful for most use cases
258
+ # choices << "Multiple Space Types - Individual Stories Sliced Keep Building Types Together"
259
+ # choices << "Building Type Specific Smart Division"
260
+ bar_division_method = OpenStudio::Measure::OSArgument.makeChoiceArgument('bar_division_method', choices, true)
261
+ bar_division_method.setDisplayName('Division Method for Bar Space Types')
262
+ bar_division_method.setDescription('To use perimeter multiplier greater than 1 selected Multiple Space Types - Individual Stories Sliced.')
263
+ bar_division_method.setDefaultValue('Multiple Space Types - Individual Stories Sliced')
264
+ args << bar_division_method
265
+
266
+ # double_loaded_corridor
267
+ choices = OpenStudio::StringVector.new
268
+ choices << 'None'
269
+ choices << 'Primary Space Type'
270
+ # choices << 'All Space Types' # possible future option
271
+ double_loaded_corridor = OpenStudio::Measure::OSArgument.makeChoiceArgument('double_loaded_corridor', choices, true)
272
+ double_loaded_corridor.setDisplayName('Double Loaded Corridor')
273
+ double_loaded_corridor.setDescription('Add double loaded corridor for building types that have a defined circulation space type, to the selected space types.')
274
+ double_loaded_corridor.setDefaultValue('Primary Space Type')
275
+ args << double_loaded_corridor
276
+
277
+ # Make argument for space_type_sort_logic
278
+ choices = OpenStudio::StringVector.new
279
+ choices << 'Size'
280
+ choices << 'Building Type > Size'
281
+ # choices << "Basements Ground Midx5 Top"
282
+ space_type_sort_logic = OpenStudio::Measure::OSArgument.makeChoiceArgument('space_type_sort_logic', choices, true)
283
+ space_type_sort_logic.setDisplayName('Choose Space Type Sorting Method')
284
+ space_type_sort_logic.setDefaultValue('Building Type > Size')
285
+ args << space_type_sort_logic
286
+
287
+ # make an argument for use_upstream_args
288
+ use_upstream_args = OpenStudio::Measure::OSArgument.makeBoolArgument('use_upstream_args', true)
289
+ use_upstream_args.setDisplayName('Use Upstream Argument Values')
290
+ use_upstream_args.setDescription('When true this will look for arguments or registerValues in upstream measures that match arguments from this measure, and will use the value from the upstream measure in place of what is entered for this measure.')
291
+ use_upstream_args.setDefaultValue(true)
292
+ args << use_upstream_args
293
+
294
+ # TODO: - expose perimeter depth as an argument
295
+
296
+ return args
297
+ end
298
+
299
+ # define what happens when the measure is run
300
+ def run(model, runner, user_arguments)
301
+ super(model, runner, user_arguments)
302
+
303
+ # method run from os_lib_model_generation.rb
304
+ result = bar_from_space_type_ratios(model, runner, user_arguments)
305
+
306
+ if result == false
307
+ return false
308
+ else
309
+ return true
310
+ end
311
+ end
312
+ end
313
+ # this allows the measure to be use by the application
314
+ CreateBarFromSpaceTypeRatios.new.registerWithApplication