openstudio-model-articulation 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile +6 -0
- data/Jenkinsfile +1 -0
- data/LICENSE.md +1 -1
- data/doc_templates/LICENSE.md +1 -1
- data/doc_templates/copyright_erb.txt +1 -1
- data/doc_templates/copyright_js.txt +1 -1
- data/doc_templates/copyright_ruby.txt +1 -1
- data/lib/measures/AssignConstructionSetToBuilding/LICENSE.md +1 -1
- data/lib/measures/AssignConstructionSetToBuilding/measure.rb +1 -1
- data/lib/measures/AssignConstructionSetToBuilding/measure.xml +11 -10
- data/lib/measures/AssignSpaceTypeBySpaceName/LICENSE.md +1 -1
- data/lib/measures/AssignSpaceTypeBySpaceName/measure.rb +1 -1
- data/lib/measures/AssignSpaceTypeBySpaceName/measure.xml +11 -10
- data/lib/measures/AssignSpaceTypeToBuilding/LICENSE.md +1 -1
- data/lib/measures/AssignSpaceTypeToBuilding/measure.rb +1 -1
- data/lib/measures/AssignSpaceTypeToBuilding/measure.xml +11 -10
- data/lib/measures/AssignSpacesToStories/LICENSE.md +1 -1
- data/lib/measures/AssignSpacesToStories/measure.rb +1 -1
- data/lib/measures/AssignSpacesToStories/measure.xml +9 -8
- data/lib/measures/BarAspectRatioStudy/LICENSE.md +1 -1
- data/lib/measures/BarAspectRatioStudy/measure.rb +1 -1
- data/lib/measures/BarAspectRatioStudy/measure.xml +8 -7
- data/lib/measures/CleanupSpaceOrigins/LICENSE.md +1 -1
- data/lib/measures/CleanupSpaceOrigins/measure.rb +1 -1
- data/lib/measures/CleanupSpaceOrigins/measure.xml +9 -8
- data/lib/measures/FindAndReplaceObjectNames/LICENSE.md +1 -1
- data/lib/measures/FindAndReplaceObjectNames/measure.rb +1 -1
- data/lib/measures/FindAndReplaceObjectNames/measure.xml +8 -7
- data/lib/measures/InjectOsmGeometryIntoAnExternalIdf/LICENSE.md +1 -1
- data/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.rb +1 -1
- data/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.xml +10 -10
- data/lib/measures/RemoveHardAssignedConstructions/LICENSE.md +1 -1
- data/lib/measures/RemoveHardAssignedConstructions/measure.rb +1 -1
- data/lib/measures/RemoveHardAssignedConstructions/measure.xml +8 -7
- data/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/LICENSE.md +1 -1
- data/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/measure.rb +1 -1
- data/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/measure.xml +9 -8
- data/lib/measures/RotateBuilding/LICENSE.md +1 -1
- data/lib/measures/RotateBuilding/measure.rb +1 -1
- data/lib/measures/RotateBuilding/measure.xml +8 -7
- data/lib/measures/SetExtWallToGroundBoundaryConditionByStory/LICENSE.md +1 -1
- data/lib/measures/SetExtWallToGroundBoundaryConditionByStory/measure.rb +1 -1
- data/lib/measures/SetExtWallToGroundBoundaryConditionByStory/measure.xml +8 -7
- data/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/LICENSE.md +1 -1
- data/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.rb +1 -1
- data/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.xml +8 -7
- data/lib/measures/SetInteriorWallsToSelectedConstruction/LICENSE.md +1 -1
- data/lib/measures/SetInteriorWallsToSelectedConstruction/measure.rb +1 -1
- data/lib/measures/SetInteriorWallsToSelectedConstruction/measure.xml +8 -7
- data/lib/measures/SetWindowToWallRatioByFacade/LICENSE.md +1 -1
- data/lib/measures/SetWindowToWallRatioByFacade/measure.rb +1 -1
- data/lib/measures/SetWindowToWallRatioByFacade/measure.xml +5 -5
- data/lib/measures/SimplifyGeometryToSlicedBar/LICENSE.md +1 -1
- data/lib/measures/SimplifyGeometryToSlicedBar/measure.rb +1 -1
- data/lib/measures/SimplifyGeometryToSlicedBar/measure.xml +8 -8
- data/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_cofee.rb +1 -1
- data/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_geometry.rb +1 -1
- data/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_helper_methods.rb +1 -1
- data/lib/measures/SpaceTypeAndConstructionSetWizard/LICENSE.md +1 -1
- data/lib/measures/SpaceTypeAndConstructionSetWizard/measure.rb +1 -1
- data/lib/measures/SpaceTypeAndConstructionSetWizard/measure.xml +63 -11
- data/lib/measures/SurfaceMatching/LICENSE.md +1 -1
- data/lib/measures/SurfaceMatching/measure.rb +1 -1
- data/lib/measures/SurfaceMatching/measure.xml +8 -7
- data/lib/measures/blended_space_type_from_floor_area_ratios/LICENSE.md +1 -1
- data/lib/measures/blended_space_type_from_floor_area_ratios/measure.rb +1 -1
- data/lib/measures/blended_space_type_from_floor_area_ratios/measure.xml +5 -5
- data/lib/measures/blended_space_type_from_model/LICENSE.md +1 -1
- data/lib/measures/blended_space_type_from_model/measure.rb +1 -1
- data/lib/measures/blended_space_type_from_model/measure.xml +6 -6
- data/lib/measures/blended_space_type_from_model/resources/os_lib_model_simplification.rb +1 -1
- data/lib/measures/clone_building_from_external_model/LICENSE.md +1 -1
- data/lib/measures/clone_building_from_external_model/measure.rb +1 -1
- data/lib/measures/clone_building_from_external_model/measure.xml +5 -5
- data/lib/measures/create_DOE_prototype_building/LICENSE.md +1 -1
- data/lib/measures/create_DOE_prototype_building/measure.rb +2 -1
- data/lib/measures/create_DOE_prototype_building/measure.xml +509 -377
- data/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/LICENSE.md +1 -1
- data/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/measure.rb +1 -1
- data/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/measure.xml +5 -5
- data/lib/measures/create_bar_from_building_type_ratios/LICENSE.md +1 -1
- data/lib/measures/create_bar_from_building_type_ratios/measure.rb +1 -1
- data/lib/measures/create_bar_from_building_type_ratios/measure.xml +117 -5
- data/lib/measures/create_bar_from_deer_building_type_ratios/LICENSE.md +1 -1
- data/lib/measures/create_bar_from_deer_building_type_ratios/measure.rb +1 -1
- data/lib/measures/create_bar_from_deer_building_type_ratios/measure.xml +5 -5
- data/lib/measures/create_bar_from_doe_building_type_ratios/LICENSE.md +1 -1
- data/lib/measures/create_bar_from_doe_building_type_ratios/measure.rb +1 -1
- data/lib/measures/create_bar_from_doe_building_type_ratios/measure.xml +117 -5
- data/lib/measures/create_bar_from_model/LICENSE.md +1 -1
- data/lib/measures/create_bar_from_model/measure.rb +1 -1
- data/lib/measures/create_bar_from_model/measure.xml +5 -5
- data/lib/measures/{BarAspectRatioSlicedBySpaceType → create_bar_from_space_type_ratios}/LICENSE.md +1 -1
- data/lib/measures/create_bar_from_space_type_ratios/README.md +504 -0
- data/lib/measures/create_bar_from_space_type_ratios/README.md.erb +306 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/ar_05.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/ar_1.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/ar_2.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/bar_double_loaded.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/bar_single_core_perim.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/bar_sliced_indiv.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/bar_sliced_simple.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/basement.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/custom_height_false.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/custom_height_true.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/no_party_mult.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/party.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/party_multi.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/perim_mult_2010.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/perim_mult_2012.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/perim_mult_2020.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/sep_05.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/sep_10.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/sep_3.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/story_sort.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/docs/wwr_custom.png +0 -0
- data/lib/measures/create_bar_from_space_type_ratios/measure.rb +309 -0
- data/lib/measures/create_bar_from_space_type_ratios/measure.xml +687 -0
- data/lib/measures/create_baseline_building/LICENSE.md +1 -1
- data/lib/measures/create_baseline_building/measure.rb +1 -1
- data/lib/measures/create_baseline_building/measure.xml +5 -5
- data/lib/measures/create_deer_prototype_building/LICENSE.md +1 -1
- data/lib/measures/create_deer_prototype_building/measure.rb +1 -1
- data/lib/measures/create_deer_prototype_building/measure.xml +6 -6
- data/lib/measures/create_deer_prototype_building/resources/deer_building_types.rb +1 -1
- data/lib/measures/create_parametric_schedules/LICENSE.md +1 -1
- data/lib/measures/create_parametric_schedules/measure.rb +1 -1
- data/lib/measures/create_parametric_schedules/measure.xml +5 -5
- data/lib/measures/create_typical_building_from_model/LICENSE.md +1 -1
- data/lib/measures/create_typical_building_from_model/README.md +1 -1
- data/lib/measures/create_typical_building_from_model/measure.rb +2 -5
- data/lib/measures/create_typical_building_from_model/measure.xml +51 -19
- data/lib/measures/create_typical_building_from_model/resources/Model.hvac.rb +8 -5
- data/lib/measures/create_typical_deer_building_from_model/LICENSE.md +1 -1
- data/lib/measures/create_typical_deer_building_from_model/measure.rb +1 -1
- data/lib/measures/create_typical_deer_building_from_model/measure.xml +7 -7
- data/lib/measures/create_typical_deer_building_from_model/resources/Model.hvac.rb +8 -5
- data/lib/measures/create_typical_doe_building_from_model/LICENSE.md +1 -1
- data/lib/measures/create_typical_doe_building_from_model/measure.rb +1 -1
- data/lib/measures/create_typical_doe_building_from_model/measure.xml +45 -13
- data/lib/measures/create_typical_doe_building_from_model/resources/Model.hvac.rb +8 -5
- data/lib/measures/deer_space_type_and_construction_set_wizard/LICENSE.md +1 -1
- data/lib/measures/deer_space_type_and_construction_set_wizard/measure.rb +1 -1
- data/lib/measures/deer_space_type_and_construction_set_wizard/measure.xml +17 -17
- data/lib/measures/find_and_replace_in_all_thermal_zone_names/LICENSE.md +1 -1
- data/lib/measures/find_and_replace_in_all_thermal_zone_names/measure.rb +1 -1
- data/lib/measures/find_and_replace_in_all_thermal_zone_names/measure.xml +8 -7
- data/lib/measures/make_shading_surfaces_based_on_zone_multipliers/LICENSE.md +1 -1
- data/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.rb +1 -1
- data/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.xml +5 -5
- data/lib/measures/merge_floorspace_js_with_model/LICENSE.md +1 -1
- data/lib/measures/merge_floorspace_js_with_model/measure.rb +1 -1
- data/lib/measures/merge_floorspace_js_with_model/measure.xml +5 -5
- data/lib/measures/merge_spaces_from_external_file/LICENSE.md +1 -1
- data/lib/measures/merge_spaces_from_external_file/measure.rb +1 -1
- data/lib/measures/merge_spaces_from_external_file/measure.xml +6 -6
- data/lib/measures/merge_spaces_from_external_file/resources/ScheduleTranslator.rb +1 -1
- data/lib/measures/radiance_measure/LICENSE.md +1 -1
- data/lib/measures/radiance_measure/measure.rb +1 -1
- data/lib/measures/radiance_measure/measure.xml +11 -11
- data/lib/measures/radiant_slab_with_doas/LICENSE.md +1 -1
- data/lib/measures/radiant_slab_with_doas/measure.rb +1 -1
- data/lib/measures/radiant_slab_with_doas/measure.xml +5 -5
- data/lib/measures/replace_geometry_by_story/LICENSE.md +1 -1
- data/lib/measures/replace_geometry_by_story/measure.rb +1 -1
- data/lib/measures/replace_geometry_by_story/measure.xml +5 -5
- data/lib/measures/scale_geometry/LICENSE.md +1 -1
- data/lib/measures/scale_geometry/measure.rb +1 -1
- data/lib/measures/scale_geometry/measure.xml +5 -5
- data/lib/openstudio-model-articulation.rb +1 -1
- data/lib/openstudio/model_articulation.rb +1 -1
- data/lib/openstudio/model_articulation/extension.rb +1 -1
- data/lib/openstudio/model_articulation/version.rb +2 -2
- data/openstudio-model-articulation.gemspec +3 -3
- metadata +34 -14
- data/lib/measures/BarAspectRatioSlicedBySpaceType/README.md +0 -64
- data/lib/measures/BarAspectRatioSlicedBySpaceType/README.md.erb +0 -42
- data/lib/measures/BarAspectRatioSlicedBySpaceType/measure.rb +0 -184
- data/lib/measures/BarAspectRatioSlicedBySpaceType/measure.xml +0 -130
- data/lib/measures/BarAspectRatioSlicedBySpaceType/resources/os_lib_cofee.rb +0 -252
@@ -1,42 +0,0 @@
|
|
1
|
-
<%#= README.md.erb is used to auto-generate README.md. %>
|
2
|
-
<%#= To manually maintain README.md throw away README.md.erb and manually edit README.md %>
|
3
|
-
###### (Automatically generated documentation)
|
4
|
-
|
5
|
-
# <%= name %>
|
6
|
-
|
7
|
-
## Description
|
8
|
-
<%= description %>
|
9
|
-
|
10
|
-
## Modeler Description
|
11
|
-
<%= modelerDescription %>
|
12
|
-
|
13
|
-
## Measure Type
|
14
|
-
<%= measureType %>
|
15
|
-
|
16
|
-
## Taxonomy
|
17
|
-
<%= taxonomy %>
|
18
|
-
|
19
|
-
## Arguments
|
20
|
-
|
21
|
-
<% arguments.each do |argument| %>
|
22
|
-
### <%= argument[:display_name] %>
|
23
|
-
<%= argument[:description] %>
|
24
|
-
**Name:** <%= argument[:name] %>,
|
25
|
-
**Type:** <%= argument[:type] %>,
|
26
|
-
**Units:** <%= argument[:units] %>,
|
27
|
-
**Required:** <%= argument[:required] %>,
|
28
|
-
**Model Dependent:** <%= argument[:model_dependent] %>
|
29
|
-
<% end %>
|
30
|
-
|
31
|
-
<% if arguments.size == 0 %>
|
32
|
-
<%= "This measure does not have any user arguments" %>
|
33
|
-
<% end %>
|
34
|
-
|
35
|
-
<% if outputs.size > 0 %>
|
36
|
-
## Outputs
|
37
|
-
<% output_names = [] %>
|
38
|
-
<% outputs.each do |output| %>
|
39
|
-
<% output_names << output[:display_name] %>
|
40
|
-
<% end %>
|
41
|
-
<%= output_names.join(", ") %>
|
42
|
-
<% end %>
|
@@ -1,184 +0,0 @@
|
|
1
|
-
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-2020, 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
|
-
# load OpenStudio measure libraries from openstudio-extension gem
|
46
|
-
require 'openstudio-extension'
|
47
|
-
require 'openstudio/extension/core/os_lib_helper_methods'
|
48
|
-
require 'openstudio/extension/core/os_lib_geometry.rb'
|
49
|
-
|
50
|
-
# load OpenStudio measure libraries
|
51
|
-
require "#{File.dirname(__FILE__)}/resources/os_lib_cofee"
|
52
|
-
|
53
|
-
# start the measure
|
54
|
-
class BarAspectRatioSlicedBySpaceType < OpenStudio::Measure::ModelMeasure
|
55
|
-
# define the name that a user will see, this method may be deprecated as
|
56
|
-
# the display name in PAT comes from the name field in measure.xml
|
57
|
-
def name
|
58
|
-
return 'BarAspectRatioSlicedBySpaceType'
|
59
|
-
end
|
60
|
-
|
61
|
-
# define the arguments that the user will input
|
62
|
-
def arguments(model)
|
63
|
-
args = OpenStudio::Measure::OSArgumentVector.new
|
64
|
-
|
65
|
-
# make an argument for total floor area
|
66
|
-
total_bldg_area_ip = OpenStudio::Measure::OSArgument.makeDoubleArgument('total_bldg_area_ip', true)
|
67
|
-
total_bldg_area_ip.setDisplayName('Total Building Floor Area (ft^2).')
|
68
|
-
total_bldg_area_ip.setDefaultValue(10000.0)
|
69
|
-
args << total_bldg_area_ip
|
70
|
-
|
71
|
-
# make an argument for aspect ratio
|
72
|
-
ns_to_ew_ratio = OpenStudio::Measure::OSArgument.makeDoubleArgument('ns_to_ew_ratio', true)
|
73
|
-
ns_to_ew_ratio.setDisplayName('Ratio of North/South Facade Length Relative to East/West Facade Length.')
|
74
|
-
ns_to_ew_ratio.setDefaultValue(2.0)
|
75
|
-
args << ns_to_ew_ratio
|
76
|
-
|
77
|
-
# make an argument for number of floors
|
78
|
-
num_floors = OpenStudio::Measure::OSArgument.makeIntegerArgument('num_floors', true)
|
79
|
-
num_floors.setDisplayName('Number of Floors.')
|
80
|
-
num_floors.setDefaultValue(2)
|
81
|
-
args << num_floors
|
82
|
-
|
83
|
-
# make an argument for floor height
|
84
|
-
floor_to_floor_height_ip = OpenStudio::Measure::OSArgument.makeDoubleArgument('floor_to_floor_height_ip', true)
|
85
|
-
floor_to_floor_height_ip.setDisplayName('Floor to Floor Height (ft).')
|
86
|
-
floor_to_floor_height_ip.setDefaultValue(10.0)
|
87
|
-
args << floor_to_floor_height_ip
|
88
|
-
|
89
|
-
# make an argument for the meter name
|
90
|
-
spaceTypeHashString = OpenStudio::Measure::OSArgument.makeStringArgument('spaceTypeHashString', true)
|
91
|
-
spaceTypeHashString.setDisplayName('Hash of Space Types with Name as Key and Fraction as value.')
|
92
|
-
args << spaceTypeHashString
|
93
|
-
|
94
|
-
return args
|
95
|
-
end
|
96
|
-
|
97
|
-
# define what happens when the measure is run
|
98
|
-
def run(model, runner, user_arguments)
|
99
|
-
super(model, runner, user_arguments)
|
100
|
-
|
101
|
-
# use the built-in error checking
|
102
|
-
if !runner.validateUserArguments(arguments(model), user_arguments)
|
103
|
-
return false
|
104
|
-
end
|
105
|
-
|
106
|
-
# assign the user inputs to variables
|
107
|
-
total_bldg_area_ip = runner.getDoubleArgumentValue('total_bldg_area_ip', user_arguments)
|
108
|
-
ns_to_ew_ratio = runner.getDoubleArgumentValue('ns_to_ew_ratio', user_arguments)
|
109
|
-
num_floors = runner.getIntegerArgumentValue('num_floors', user_arguments)
|
110
|
-
floor_to_floor_height_ip = runner.getDoubleArgumentValue('floor_to_floor_height_ip', user_arguments)
|
111
|
-
spaceTypeHashString = runner.getStringArgumentValue('spaceTypeHashString', user_arguments)
|
112
|
-
|
113
|
-
# test for positive inputs
|
114
|
-
if total_bldg_area_ip <= 0
|
115
|
-
runner.registerError('Enter a total building area greater than 0.')
|
116
|
-
end
|
117
|
-
if ns_to_ew_ratio <= 0
|
118
|
-
runner.registerError('Enter ratio grater than 0.')
|
119
|
-
end
|
120
|
-
if num_floors <= 0
|
121
|
-
runner.registerError('Enter a number of stories 1 or greater.')
|
122
|
-
end
|
123
|
-
if floor_to_floor_height_ip <= 0
|
124
|
-
runner.registerError('Enter a positive floor height.')
|
125
|
-
end
|
126
|
-
if 1 == 1
|
127
|
-
# TODO: - add test for spaceTypeHashString argument
|
128
|
-
end
|
129
|
-
|
130
|
-
# calculate needed variables
|
131
|
-
total_bldg_area_si = OpenStudio.convert(total_bldg_area_ip, 'ft^2', 'm^2').get
|
132
|
-
footprint_ip = total_bldg_area_ip / num_floors
|
133
|
-
footprint_si = OpenStudio.convert(footprint_ip, 'ft^2', 'm^2').get
|
134
|
-
floor_to_floor_height = OpenStudio.convert(floor_to_floor_height_ip, 'ft', 'm').get
|
135
|
-
|
136
|
-
# variables from original rectangle script not exposed in this measure
|
137
|
-
width = Math.sqrt(footprint_si / ns_to_ew_ratio)
|
138
|
-
length = footprint_si / width
|
139
|
-
|
140
|
-
# reporting initial condition of model
|
141
|
-
starting_spaces = model.getSpaces
|
142
|
-
runner.registerInitialCondition("The building started with #{starting_spaces.size} spaces.")
|
143
|
-
|
144
|
-
# convert string argument to hash
|
145
|
-
spaceTypeHashName = {}
|
146
|
-
spaceTypeHashString[1..-2].split(/, /).each { |entry| entryMap = entry.split(/=>/); value_str = entryMap[1]; spaceTypeHashName[entryMap[0].strip[1..-1].to_s] = value_str.nil? ? '' : value_str.strip[1..-2].to_f }
|
147
|
-
|
148
|
-
# sum of hash values
|
149
|
-
hashValues = 0
|
150
|
-
|
151
|
-
spaceTypeHash = {}
|
152
|
-
model.getSpaceTypes.each do |spaceType|
|
153
|
-
if spaceTypeHashName.include?(spaceType.name.to_s)
|
154
|
-
spaceTypeHash[spaceType] = spaceTypeHashName[spaceType.name.to_s] * total_bldg_area_si # converting fractional value to area value to pass into method
|
155
|
-
hashValues += spaceTypeHashName[spaceType.name.to_s]
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
if hashValues != 1.0
|
160
|
-
runner.registerWarning('Fractional hash values do not add up to one. Resulting geometry may not have expected area.')
|
161
|
-
end
|
162
|
-
|
163
|
-
# see which path to take
|
164
|
-
midFloorMultiplier = 1 # show as 1 even on 1 and 2 story buildings where there is no mid floor, in addition to 3 story building
|
165
|
-
if num_floors > 3
|
166
|
-
# use floor multiplier version. Set mid floor multiplier, use adibatic floors/ceilings and set constructions, raise up building
|
167
|
-
midFloorMultiplier = num_floors - 2
|
168
|
-
end
|
169
|
-
|
170
|
-
# run method to create envelope
|
171
|
-
bar_AspectRatio = OsLib_Cofee.createBar(model, spaceTypeHash, length, width, total_bldg_area_si, num_floors, midFloorMultiplier, 0.0, 0.0, length, width, 0.0, floor_to_floor_height * num_floors, true)
|
172
|
-
|
173
|
-
puts "building area #{model.getBuilding.floorArea}"
|
174
|
-
|
175
|
-
# reporting final condition of model
|
176
|
-
finishing_spaces = model.getSpaces
|
177
|
-
runner.registerFinalCondition("The building finished with #{finishing_spaces.size} spaces.")
|
178
|
-
|
179
|
-
return true
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
# this allows the measure to be use by the application
|
184
|
-
BarAspectRatioSlicedBySpaceType.new.registerWithApplication
|
@@ -1,130 +0,0 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
<measure>
|
3
|
-
<schema_version>3.0</schema_version>
|
4
|
-
<name>bar_aspect_ratio_sliced_by_space_type</name>
|
5
|
-
<uid>3e988765-9673-46f8-9b65-99d5b86c2b22</uid>
|
6
|
-
<version_id>ae664185-7251-4abb-b2e0-5a7c1893e519</version_id>
|
7
|
-
<version_modified>20200509T155942Z</version_modified>
|
8
|
-
<xml_checksum>49BEF039</xml_checksum>
|
9
|
-
<class_name>BarAspectRatioSlicedBySpaceType</class_name>
|
10
|
-
<display_name>BarAspectRatioSlicedBySpaceType</display_name>
|
11
|
-
<description>This measure will create a building envelope based on a target floor area, aspect ratio, floor to floor height, and a collectin of space types and fraction of building using that space type.</description>
|
12
|
-
<modeler_description>This is based on the SketchUp Plugin user script to create a rectangular building, but just uses different inputs. The resulting building will have a core and perimeter zoning, unless it is too small, in which case eac floor will have a single zone. This uses a floor multiplier for buildings taller than three stories. Below is an example of what the space tyep hash might look like. Sum of hash values should equal 1.0. "{:189.1-2009 - Office - Corridor - CZ1-3 => '0.3', :189.1-2009 - Office - Conference - CZ1-3 => '0.2', :189.1-2009 - Office - ClosedOffice - CZ1-3 => '0.5' }"</modeler_description>
|
13
|
-
<arguments>
|
14
|
-
<argument>
|
15
|
-
<name>total_bldg_area_ip</name>
|
16
|
-
<display_name>Total Building Floor Area (ft^2).</display_name>
|
17
|
-
<type>Double</type>
|
18
|
-
<required>true</required>
|
19
|
-
<model_dependent>false</model_dependent>
|
20
|
-
<default_value>10000</default_value>
|
21
|
-
</argument>
|
22
|
-
<argument>
|
23
|
-
<name>ns_to_ew_ratio</name>
|
24
|
-
<display_name>Ratio of North/South Facade Length Relative to East/West Facade Length.</display_name>
|
25
|
-
<type>Double</type>
|
26
|
-
<required>true</required>
|
27
|
-
<model_dependent>false</model_dependent>
|
28
|
-
<default_value>2</default_value>
|
29
|
-
</argument>
|
30
|
-
<argument>
|
31
|
-
<name>num_floors</name>
|
32
|
-
<display_name>Number of Floors.</display_name>
|
33
|
-
<type>Integer</type>
|
34
|
-
<required>true</required>
|
35
|
-
<model_dependent>false</model_dependent>
|
36
|
-
<default_value>2</default_value>
|
37
|
-
</argument>
|
38
|
-
<argument>
|
39
|
-
<name>floor_to_floor_height_ip</name>
|
40
|
-
<display_name>Floor to Floor Height (ft).</display_name>
|
41
|
-
<type>Double</type>
|
42
|
-
<required>true</required>
|
43
|
-
<model_dependent>false</model_dependent>
|
44
|
-
<default_value>10</default_value>
|
45
|
-
</argument>
|
46
|
-
<argument>
|
47
|
-
<name>spaceTypeHashString</name>
|
48
|
-
<display_name>Hash of Space Types with Name as Key and Fraction as value.</display_name>
|
49
|
-
<type>String</type>
|
50
|
-
<required>true</required>
|
51
|
-
<model_dependent>false</model_dependent>
|
52
|
-
</argument>
|
53
|
-
</arguments>
|
54
|
-
<outputs />
|
55
|
-
<provenances />
|
56
|
-
<tags>
|
57
|
-
<tag>Envelope.Form</tag>
|
58
|
-
</tags>
|
59
|
-
<attributes>
|
60
|
-
<attribute>
|
61
|
-
<name>Measure Type</name>
|
62
|
-
<value>ModelMeasure</value>
|
63
|
-
<datatype>string</datatype>
|
64
|
-
</attribute>
|
65
|
-
<attribute>
|
66
|
-
<name>Measure Function</name>
|
67
|
-
<value>Measure</value>
|
68
|
-
<datatype>string</datatype>
|
69
|
-
</attribute>
|
70
|
-
<attribute>
|
71
|
-
<name>Requires EnergyPlus Results</name>
|
72
|
-
<value>false</value>
|
73
|
-
<datatype>boolean</datatype>
|
74
|
-
</attribute>
|
75
|
-
<attribute>
|
76
|
-
<name>Uses SketchUp API</name>
|
77
|
-
<value>false</value>
|
78
|
-
<datatype>boolean</datatype>
|
79
|
-
</attribute>
|
80
|
-
</attributes>
|
81
|
-
<files>
|
82
|
-
<file>
|
83
|
-
<filename>Untitled.osm</filename>
|
84
|
-
<filetype>osm</filetype>
|
85
|
-
<usage_type>test</usage_type>
|
86
|
-
<checksum>3FDFD18A</checksum>
|
87
|
-
</file>
|
88
|
-
<file>
|
89
|
-
<filename>README.md</filename>
|
90
|
-
<filetype>md</filetype>
|
91
|
-
<usage_type>readme</usage_type>
|
92
|
-
<checksum>C0E5A870</checksum>
|
93
|
-
</file>
|
94
|
-
<file>
|
95
|
-
<filename>README.md.erb</filename>
|
96
|
-
<filetype>erb</filetype>
|
97
|
-
<usage_type>readmeerb</usage_type>
|
98
|
-
<checksum>703C9964</checksum>
|
99
|
-
</file>
|
100
|
-
<file>
|
101
|
-
<filename>os_lib_cofee.rb</filename>
|
102
|
-
<filetype>rb</filetype>
|
103
|
-
<usage_type>resource</usage_type>
|
104
|
-
<checksum>3C10BF38</checksum>
|
105
|
-
</file>
|
106
|
-
<file>
|
107
|
-
<filename>LICENSE.md</filename>
|
108
|
-
<filetype>md</filetype>
|
109
|
-
<usage_type>license</usage_type>
|
110
|
-
<checksum>E0468DD6</checksum>
|
111
|
-
</file>
|
112
|
-
<file>
|
113
|
-
<filename>BarAspectRatioSlicedBySpaceType_Test.rb</filename>
|
114
|
-
<filetype>rb</filetype>
|
115
|
-
<usage_type>test</usage_type>
|
116
|
-
<checksum>9F6868DA</checksum>
|
117
|
-
</file>
|
118
|
-
<file>
|
119
|
-
<version>
|
120
|
-
<software_program>OpenStudio</software_program>
|
121
|
-
<identifier>2.0.0</identifier>
|
122
|
-
<min_compatible>2.8.0</min_compatible>
|
123
|
-
</version>
|
124
|
-
<filename>measure.rb</filename>
|
125
|
-
<filetype>rb</filetype>
|
126
|
-
<usage_type>script</usage_type>
|
127
|
-
<checksum>11E11D57</checksum>
|
128
|
-
</file>
|
129
|
-
</files>
|
130
|
-
</measure>
|
@@ -1,252 +0,0 @@
|
|
1
|
-
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-2020, 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
|
-
module OsLib_Cofee
|
37
|
-
# create def to use later to make bar
|
38
|
-
def self.createBar(model, spaceTypeHash, lengthXTarget, lengthYTarget, totalFloorArea, numStories, midFloorMultiplier, xmin, ymin, lengthX, lengthY, zmin, zmax, endZones)
|
39
|
-
# floor to floor height
|
40
|
-
floor_to_floor_height = (zmax - zmin) / numStories
|
41
|
-
|
42
|
-
# perimeter depth
|
43
|
-
perimeterDepth = OpenStudio.convert(12, 'ft', 'm').get
|
44
|
-
perimeterBufferFactor = 1.5 # this is a margin below which I won't bother splitting the two largest spaces
|
45
|
-
|
46
|
-
# create an array to control sort order of spaces in bar
|
47
|
-
customSpaceTypeBar = []
|
48
|
-
counter = 0
|
49
|
-
spaceTypeHash.sort_by { |key, value| value }.reverse.each do |k, v|
|
50
|
-
next if v == 0 # this line adds support for fractional values of 0
|
51
|
-
if counter == 1
|
52
|
-
if (lengthXTarget * (v / totalFloorArea) > perimeterDepth * perimeterBufferFactor) && endZones
|
53
|
-
customSpaceTypeBar << [k, totalFloorArea * (perimeterDepth / lengthXTarget)]
|
54
|
-
customSpaceTypeBar << [k, v - (totalFloorArea * (perimeterDepth / lengthXTarget))]
|
55
|
-
else
|
56
|
-
customSpaceTypeBar << [k, v]
|
57
|
-
end
|
58
|
-
elsif counter > 1
|
59
|
-
customSpaceTypeBar << [k, v]
|
60
|
-
end
|
61
|
-
counter += 1
|
62
|
-
end
|
63
|
-
|
64
|
-
# add the largest space type to the end
|
65
|
-
counter = 0
|
66
|
-
spaceTypeHash.sort_by { |key, value| value }.reverse.each do |k, v|
|
67
|
-
if counter == 0
|
68
|
-
# if width is greater than 1.5x perimeter depth then split in half
|
69
|
-
if (lengthXTarget * (v / totalFloorArea) > perimeterDepth * perimeterBufferFactor) && endZones
|
70
|
-
customSpaceTypeBar << [k, v - (totalFloorArea * (perimeterDepth / lengthXTarget))]
|
71
|
-
customSpaceTypeBar << [k, totalFloorArea * (perimeterDepth / lengthXTarget)]
|
72
|
-
else
|
73
|
-
customSpaceTypeBar << [k, v]
|
74
|
-
end
|
75
|
-
end
|
76
|
-
break
|
77
|
-
end
|
78
|
-
|
79
|
-
# starting z level
|
80
|
-
z = zmin
|
81
|
-
storyCounter = 0
|
82
|
-
barSpaceArray = []
|
83
|
-
|
84
|
-
# create new stories and then add spaces
|
85
|
-
[numStories, 3].min.times do # no more than tree loops through this
|
86
|
-
story = OpenStudio::Model::BuildingStory.new(model)
|
87
|
-
story.setNominalFloortoFloorHeight(floor_to_floor_height)
|
88
|
-
story.setNominalZCoordinate(z)
|
89
|
-
|
90
|
-
# starting position for first space
|
91
|
-
x = (lengthX - lengthXTarget) * 0.5 + xmin
|
92
|
-
y = (lengthY - lengthYTarget) * 0.5 + ymin
|
93
|
-
|
94
|
-
# temp array of spaces (this is to change floor boundary when there is mid floor multiplier)
|
95
|
-
tempSpaceArray = []
|
96
|
-
|
97
|
-
# loop through space types making diagram and spaces.
|
98
|
-
# spaceTypeHash.sort_by {|key, value| value}.reverse.each do |k,v|
|
99
|
-
customSpaceTypeBar.each do |object|
|
100
|
-
# get values from what was hash
|
101
|
-
k = object[0]
|
102
|
-
v = object[1]
|
103
|
-
|
104
|
-
# get proper zone multiplier value
|
105
|
-
if (storyCounter == 1) && (midFloorMultiplier > 1)
|
106
|
-
thermalZoneMultiplier = midFloorMultiplier
|
107
|
-
else
|
108
|
-
thermalZoneMultiplier = 1
|
109
|
-
end
|
110
|
-
|
111
|
-
options = {
|
112
|
-
'name' => nil,
|
113
|
-
'spaceType' => k,
|
114
|
-
'story' => story,
|
115
|
-
'makeThermalZone' => true,
|
116
|
-
'thermalZone' => nil,
|
117
|
-
'thermalZoneMultiplier' => thermalZoneMultiplier,
|
118
|
-
'floor_to_floor_height' => floor_to_floor_height
|
119
|
-
}
|
120
|
-
|
121
|
-
# three paths for spaces depending upon building depth (3, 2 or one cross slices)
|
122
|
-
if lengthYTarget > perimeterDepth * 3 # slice into core and perimeter
|
123
|
-
|
124
|
-
# perimeter polygon a
|
125
|
-
perim_polygon_a = OpenStudio::Point3dVector.new
|
126
|
-
perim_origin_a = OpenStudio::Point3d.new(x, y, z)
|
127
|
-
perim_polygon_a << perim_origin_a
|
128
|
-
perim_polygon_a << OpenStudio::Point3d.new(x, y + perimeterDepth, z)
|
129
|
-
perim_polygon_a << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y + perimeterDepth, z)
|
130
|
-
perim_polygon_a << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y, z)
|
131
|
-
|
132
|
-
# create core polygon
|
133
|
-
core_polygon = OpenStudio::Point3dVector.new
|
134
|
-
core_origin = OpenStudio::Point3d.new(x, y + perimeterDepth, z)
|
135
|
-
core_polygon << core_origin
|
136
|
-
core_polygon << OpenStudio::Point3d.new(x, y + lengthYTarget - perimeterDepth, z)
|
137
|
-
core_polygon << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y + lengthYTarget - perimeterDepth, z)
|
138
|
-
core_polygon << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y + perimeterDepth, z)
|
139
|
-
|
140
|
-
# perimeter polygon b w
|
141
|
-
perim_polygon_b = OpenStudio::Point3dVector.new
|
142
|
-
perim_origin_b = OpenStudio::Point3d.new(x, y + lengthYTarget - perimeterDepth, z)
|
143
|
-
perim_polygon_b << perim_origin_b
|
144
|
-
perim_polygon_b << OpenStudio::Point3d.new(x, y + lengthYTarget, z)
|
145
|
-
perim_polygon_b << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y + lengthYTarget, z)
|
146
|
-
perim_polygon_b << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y + lengthYTarget - perimeterDepth, z)
|
147
|
-
|
148
|
-
# run method to make spaces
|
149
|
-
tempSpaceArray << OsLib_Geometry.makeSpaceFromPolygon(model, perim_origin_a, perim_polygon_a, options) # model, origin, polygon, options
|
150
|
-
tempSpaceArray << OsLib_Geometry.makeSpaceFromPolygon(model, core_origin, core_polygon, options) # model, origin, polygon, options
|
151
|
-
tempSpaceArray << OsLib_Geometry.makeSpaceFromPolygon(model, perim_origin_b, perim_polygon_b, options) # model, origin, polygon, options
|
152
|
-
|
153
|
-
elsif lengthYTarget > perimeterDepth * 2 # slice into two peremeter zones but no core
|
154
|
-
|
155
|
-
# perimeter polygon a
|
156
|
-
perim_polygon_a = OpenStudio::Point3dVector.new
|
157
|
-
perim_origin_a = OpenStudio::Point3d.new(x, y, z)
|
158
|
-
perim_polygon_a << perim_origin_a
|
159
|
-
perim_polygon_a << OpenStudio::Point3d.new(x, y + lengthYTarget / 2, z)
|
160
|
-
perim_polygon_a << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y + lengthYTarget / 2, z)
|
161
|
-
perim_polygon_a << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y, z)
|
162
|
-
|
163
|
-
# perimeter polygon b
|
164
|
-
perim_polygon_b = OpenStudio::Point3dVector.new
|
165
|
-
perim_origin_b = OpenStudio::Point3d.new(x, y + lengthYTarget / 2, z)
|
166
|
-
perim_polygon_b << perim_origin_b
|
167
|
-
perim_polygon_b << OpenStudio::Point3d.new(x, y + lengthYTarget, z)
|
168
|
-
perim_polygon_b << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y + lengthYTarget, z)
|
169
|
-
perim_polygon_b << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y + lengthYTarget / 2, z)
|
170
|
-
|
171
|
-
# run method to make spaces
|
172
|
-
tempSpaceArray << OsLib_Geometry.makeSpaceFromPolygon(model, perim_origin_a, perim_polygon_a, options) # model, origin, polygon, options
|
173
|
-
tempSpaceArray << OsLib_Geometry.makeSpaceFromPolygon(model, perim_origin_b, perim_polygon_b, options) # model, origin, polygon, options
|
174
|
-
|
175
|
-
else # don't slice into core and perimeter
|
176
|
-
|
177
|
-
# create polygon
|
178
|
-
core_polygon = OpenStudio::Point3dVector.new
|
179
|
-
core_origin = OpenStudio::Point3d.new(x, y, z)
|
180
|
-
core_polygon << core_origin
|
181
|
-
core_polygon << OpenStudio::Point3d.new(x, y + lengthYTarget, z)
|
182
|
-
core_polygon << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y + lengthYTarget, z)
|
183
|
-
core_polygon << OpenStudio::Point3d.new(x + lengthXTarget * (v / totalFloorArea), y, z)
|
184
|
-
|
185
|
-
# run method to make space
|
186
|
-
tempSpaceArray << OsLib_Geometry.makeSpaceFromPolygon(model, core_origin, core_polygon, options) # model, origin, polygon, options
|
187
|
-
|
188
|
-
end
|
189
|
-
|
190
|
-
# update points for next run
|
191
|
-
x += lengthXTarget * (v / totalFloorArea)
|
192
|
-
end
|
193
|
-
|
194
|
-
# set flags for adiabatic surfaces
|
195
|
-
floorAdiabatic = false
|
196
|
-
ceilingAdiabatic = false
|
197
|
-
|
198
|
-
# update z
|
199
|
-
if midFloorMultiplier == 1
|
200
|
-
z += floor_to_floor_height
|
201
|
-
else
|
202
|
-
z += floor_to_floor_height * midFloorMultiplier - floor_to_floor_height
|
203
|
-
|
204
|
-
if storyCounter == 0
|
205
|
-
ceilingAdiabatic = true
|
206
|
-
elsif storyCounter == 1
|
207
|
-
floorAdiabatic = true
|
208
|
-
ceilingAdiabatic = true
|
209
|
-
else
|
210
|
-
floorAdiabatic = true
|
211
|
-
end
|
212
|
-
|
213
|
-
# alter surfaces boundary conditions and constructions as described above
|
214
|
-
tempSpaceArray.each do |space|
|
215
|
-
space.surfaces.each do |surface|
|
216
|
-
if (surface.surfaceType == 'RoofCeiling') && ceilingAdiabatic
|
217
|
-
construction = surface.construction # TODO: - this isn't really the construction I want since it wasn't an interior one, but will work for now
|
218
|
-
surface.setOutsideBoundaryCondition('Adiabatic')
|
219
|
-
if !construction.empty?
|
220
|
-
surface.setConstruction(construction.get)
|
221
|
-
end
|
222
|
-
end
|
223
|
-
if (surface.surfaceType == 'Floor') && floorAdiabatic
|
224
|
-
construction = surface.construction # TODO: - this isn't really the construction I want since it wasn't an interior one, but will work for now
|
225
|
-
surface.setOutsideBoundaryCondition('Adiabatic')
|
226
|
-
if !construction.empty?
|
227
|
-
surface.setConstruction(construction.get)
|
228
|
-
end
|
229
|
-
end
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
# populate bar space array from temp array
|
234
|
-
barSpaceArray << tempSpaceArray
|
235
|
-
|
236
|
-
end
|
237
|
-
|
238
|
-
# update storyCounter
|
239
|
-
storyCounter += 1
|
240
|
-
end
|
241
|
-
|
242
|
-
# surface matching (seems more complex than necessary)
|
243
|
-
spaces = OpenStudio::Model::SpaceVector.new
|
244
|
-
model.getSpaces.each do |space|
|
245
|
-
spaces << space
|
246
|
-
end
|
247
|
-
OpenStudio::Model.matchSurfaces(spaces)
|
248
|
-
|
249
|
-
result = barSpaceArray
|
250
|
-
return result
|
251
|
-
end
|
252
|
-
end
|