honeybee-openstudio 2.33.7 → 2.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 851a084f0894099724dc078d840065a7cdc937cb35b95cbce8987531ad3d0832
4
- data.tar.gz: bbc0285689ba78e3edaaa00bab9ec0124cd61b99e505ea95a530c5b98ce56703
3
+ metadata.gz: a4dfa78bd619d4e0ee96bedcae85ed99bce737a61516a8abf6d3be8ad1fa2b7b
4
+ data.tar.gz: 0eae35ad7865b835097a4454215d965ee76499c9174162bb3865e7ce9d768c15
5
5
  SHA512:
6
- metadata.gz: 0ee011f3f35beed0b80fc15ee4108c9516806b93db9ca0b6f5c188a943ff62571271f384281ec5b2746dfb19696eea84488a68e71a2df660094d90988f1b15b2
7
- data.tar.gz: 9fbb52f03d60d499b035ff0a639304d1b4e478724c20152b9c72defbddff004664729254260af1215d2825b2660b96ee06faeceeca2b8a0358791fbf93e71652
6
+ metadata.gz: 6aed2c7158f039c171832d76e3d791bca8fffb5a0d2710d534afe4cc20959e993b8de3ce8747b0fefd30933eadb64b896d554c3d64cb135ac88d9f890e3e435d
7
+ data.tar.gz: 4b0ea7396722cd43895fc8a79cdae978135f747fc5e34b533b1409be7a8fcef48579352df59c571b26df8e0cf535c13fb770c4055ed3daf20b861e324dc44ea8
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'honeybee-openstudio'
7
- spec.version = '2.33.7'
7
+ spec.version = '2.34.1'
8
8
  spec.authors = ['Tanushree Charan', 'Dan Macumber', 'Chris Mackey', 'Mostapha Sadeghipour Roudsari']
9
9
  spec.email = ['tanushree.charan@nrel.gov', 'chris@ladybug.tools']
10
10
 
@@ -153,6 +153,42 @@ class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
153
153
  end
154
154
  end
155
155
 
156
+ # if an efficiency standard has been set on the model, then run sizing and set everything
157
+ building = model.getBuilding
158
+ unless building.standardsTemplate.empty?
159
+ puts 'Autosizing HVAC systems and assigning efficiencies'
160
+ standard_id = building.standardsTemplate.get
161
+ require 'openstudio-standards'
162
+ standard = Standard.build(standard_id)
163
+ # Set the heating and cooling sizing parameters
164
+ standard.model_apply_prm_sizing_parameters(model)
165
+ # Perform a sizing run
166
+ if standard.model_run_sizing_run(model, "#{Dir.pwd}/SR1") == false
167
+ log_messages_to_runner(runner, debug = true)
168
+ return false
169
+ end
170
+ # If there are any multizone systems, reset damper positions
171
+ # to achieve a 60% ventilation effectiveness minimum for the system
172
+ # following the ventilation rate procedure from 62.1
173
+ standard.model_apply_multizone_vav_outdoor_air_sizing(model)
174
+ # get the climate zone
175
+ climate_zone_obj = model.getClimateZones.getClimateZone('ASHRAE', 2006)
176
+ if climate_zone_obj.empty
177
+ climate_zone_obj = model.getClimateZones.getClimateZone('ASHRAE', 2013)
178
+ end
179
+ climate_zone = climate_zone_obj.value
180
+ # get the building type
181
+ bldg_type = nil
182
+ unless building.standardsBuildingType.empty?
183
+ bldg_type = building.standardsBuildingType.get
184
+ end
185
+ # Apply the prototype HVAC assumptions
186
+ standard.model_apply_prototype_hvac_assumptions(model, bldg_type, climate_zone)
187
+ # Apply the HVAC efficiency standard
188
+ standard.model_apply_hvac_efficiency_standard(model, climate_zone)
189
+ puts 'Done with autosizing HVAC systems!'
190
+ end
191
+
156
192
  puts 'Done with Model translation!'
157
193
 
158
194
  # copy the CSV schedules into the directory where EnergyPlus can find them
@@ -60,6 +60,13 @@ module Honeybee
60
60
  os_constr_set.setDefaultInteriorSubSurfaceConstructions(int_subsurf_const)
61
61
  os_constr_set.setDefaultExteriorSubSurfaceConstructions(ext_subsurf_const)
62
62
 
63
+ # determine the frame type for measure tags
64
+ frame_type = 'Metal Framing with Thermal Break'
65
+ id_str = @hash[:identifier].to_s
66
+ if id_str.scan(/(?=WoodFramed)/).count > 0
67
+ frame_type = 'Non-Metal Framing'
68
+ end
69
+
63
70
  # assign any constructions in the wall set
64
71
  if @hash[:wall_set]
65
72
  if @hash[:wall_set][:interior_construction]
@@ -138,18 +145,34 @@ module Honeybee
138
145
  window_aperture = get_window_construction(openstudio_model, @hash[:aperture_set][:window_construction])
139
146
  unless window_aperture.nil?
140
147
  ext_subsurf_const.setFixedWindowConstruction(window_aperture)
148
+ std_info = window_aperture.standardsInformation
149
+ std_info.setFenestrationType('Fixed Window')
150
+ std_info.setFenestrationFrameType(frame_type)
151
+ std_info.setIntendedSurfaceType('ExteriorWindow')
141
152
  end
142
153
  end
143
154
  if @hash[:aperture_set][:skylight_construction]
144
155
  skylight_aperture = get_window_construction(openstudio_model, @hash[:aperture_set][:skylight_construction])
145
156
  unless skylight_aperture.nil?
146
157
  ext_subsurf_const.setSkylightConstruction(skylight_aperture)
158
+ std_info = skylight_aperture.standardsInformation
159
+ std_info.setFenestrationType('Fixed Window')
160
+ std_info.setFenestrationFrameType(frame_type)
161
+ if std_info.intendedSurfaceType.empty?
162
+ std_info.setIntendedSurfaceType('Skylight')
163
+ end
147
164
  end
148
165
  end
149
166
  if @hash[:aperture_set][:operable_construction]
150
167
  operable_aperture = get_window_construction(openstudio_model, @hash[:aperture_set][:operable_construction])
151
168
  unless operable_aperture.nil?
152
169
  ext_subsurf_const.setOperableWindowConstruction(operable_aperture)
170
+ std_info = operable_aperture.standardsInformation
171
+ if std_info.fenestrationType.empty?
172
+ std_info.setFenestrationType('Operable Window')
173
+ end
174
+ std_info.setFenestrationFrameType(frame_type)
175
+ std_info.setIntendedSurfaceType('ExteriorWindow')
153
176
  end
154
177
  end
155
178
  end
@@ -170,6 +193,10 @@ module Honeybee
170
193
  unless ext_door_ref.empty?
171
194
  exterior_door = ext_door_ref.get
172
195
  ext_subsurf_const.setDoorConstruction(exterior_door)
196
+ std_info = exterior_door.standardsInformation
197
+ if std_info.intendedSurfaceType.empty?
198
+ std_info.setIntendedSurfaceType('ExteriorDoor')
199
+ end
173
200
  end
174
201
  end
175
202
  if @hash[:door_set][:overhead_construction]
@@ -178,12 +205,24 @@ module Honeybee
178
205
  unless overhead_door_ref.empty?
179
206
  overhead_door = overhead_door_ref.get
180
207
  ext_subsurf_const.setOverheadDoorConstruction(overhead_door)
208
+ std_info = overhead_door.standardsInformation
209
+ if std_info.intendedSurfaceType.empty?
210
+ std_info.setIntendedSurfaceType('OverheadDoor')
211
+ end
181
212
  end
182
213
  end
183
214
  if @hash[:door_set][:exterior_glass_construction]
184
215
  exterior_glass_door = get_window_construction(openstudio_model, @hash[:door_set][:exterior_glass_construction])
185
216
  unless exterior_glass_door.nil?
186
217
  ext_subsurf_const.setGlassDoorConstruction(exterior_glass_door)
218
+ std_info = exterior_glass_door.standardsInformation
219
+ if std_info.fenestrationType.empty?
220
+ std_info.setFenestrationType('Glazed Door')
221
+ end
222
+ std_info.setFenestrationFrameType(frame_type)
223
+ if std_info.intendedSurfaceType.empty?
224
+ std_info.setIntendedSurfaceType('GlassDoor')
225
+ end
187
226
  end
188
227
  end
189
228
  if @hash[:door_set][:interior_glass_construction]
@@ -308,6 +308,10 @@ class OpenStudio::Model::Model
308
308
  when 'Furnace'
309
309
  # includes ventilation, whereas residential forced air furnace does not.
310
310
  standard.model_add_hvac_system(self, 'Forced Air Furnace', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)
311
+
312
+ when 'Furnace_Electric'
313
+ # includes ventilation, whereas residential forced air furnace does not.
314
+ standard.model_add_hvac_system(self, 'Forced Air Furnace', ht = 'Electricity', znht = nil, cl = nil, heated_zones)
311
315
 
312
316
  when 'GasHeaters'
313
317
  standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)
@@ -90,26 +90,28 @@ module Honeybee
90
90
 
91
91
  # Get the air loops and assign the display name to the air loop name if it exists
92
92
  os_air_loops = []
93
- air_loops = openstudio_model.getAirLoopHVACs
94
- unless air_loops.length == $air_loop_count # check if any new loops were added
95
- $air_loop_count = air_loops.length
96
- zones.each do |zon|
97
- os_air_terminal = zon.airLoopHVACTerminal
98
- unless os_air_terminal.empty?
99
- os_air_terminal = os_air_terminal.get
100
- os_air_loop_opt = os_air_terminal.airLoopHVAC
101
- unless os_air_loop_opt.empty?
102
- os_air_loop = os_air_loop_opt.get
103
- os_air_loops << os_air_loop
104
- loop_name = os_air_loop.name
105
- unless loop_name.empty?
106
- # set the name of the air loop to align with the HVAC name
107
- if @hash[:display_name]
108
- clean_name = @hash[:display_name].to_s.gsub(/[^.A-Za-z0-9_-] /, " ")
109
- os_air_loop.setName(clean_name + ' - ' + loop_name.get)
93
+ unless equipment_type.to_s.include? 'Furnace'
94
+ air_loops = openstudio_model.getAirLoopHVACs
95
+ unless air_loops.length == $air_loop_count
96
+ $air_loop_count = air_loops.length
97
+ zones.each do |zon|
98
+ os_air_terminal = zon.airLoopHVACTerminal
99
+ unless os_air_terminal.empty?
100
+ os_air_terminal = os_air_terminal.get
101
+ os_air_loop_opt = os_air_terminal.airLoopHVAC
102
+ unless os_air_loop_opt.empty?
103
+ os_air_loop = os_air_loop_opt.get
104
+ os_air_loops << os_air_loop
105
+ loop_name = os_air_loop.name
106
+ unless loop_name.empty?
107
+ # set the name of the air loop to align with the HVAC name
108
+ if @hash[:display_name]
109
+ clean_name = @hash[:display_name].to_s.gsub(/[^.A-Za-z0-9_-] /, " ")
110
+ os_air_loop.setName(clean_name + ' - ' + loop_name.get)
111
+ end
110
112
  end
113
+ break if !equipment_type.include? 'PSZ' # multiple air loops have been added
111
114
  end
112
- break if !equipment_type.include? 'PSZ' # multiple air loops have been added
113
115
  end
114
116
  end
115
117
  end
@@ -197,6 +199,21 @@ module Honeybee
197
199
  end
198
200
  end
199
201
 
202
+ # change furnace to electric if specified
203
+ if equipment_type.to_s.include? 'Furnace_Electric'
204
+ openstudio_model.getAirLoopHVACUnitarySystems.sort.each do |obj|
205
+ unless obj.heatingCoil.empty?
206
+ old_coil = obj.heatingCoil.get
207
+ heat_coil = OpenStudio::Model::CoilHeatingElectric.new(openstudio_model)
208
+ unless old_coil.name.empty?
209
+ heat_coil.setName(old_coil.name.get)
210
+ end
211
+ obj.setHeatingCoil(heat_coil)
212
+ old_coil.remove()
213
+ end
214
+ end
215
+ end
216
+
200
217
  # assign the economizer type if there's an air loop and the economizer is specified
201
218
  if @hash[:economizer_type] && !os_air_loops.empty?
202
219
  os_air_loops.each do |os_air_loop|
@@ -101,7 +101,9 @@ module Honeybee
101
101
  def create_openstudio_objects(log_report=true)
102
102
  # assign a standards building type so that David's measures can run
103
103
  building = @openstudio_model.getBuilding
104
- building.setStandardsBuildingType('MediumOffice')
104
+ if building.standardsBuildingType.empty?
105
+ building.setStandardsBuildingType('MediumOffice')
106
+ end
105
107
 
106
108
  # initialize a global variable for whether the AFN is used instead of simple ventilation
107
109
  $use_simple_vent = true
@@ -49,6 +49,15 @@ module Honeybee
49
49
  unless @hash[:display_name].nil?
50
50
  os_space_type.setDisplayName(@hash[:display_name])
51
51
  end
52
+
53
+ # if the program is from honeybee-energy-standards, also set the measure tag
54
+ id_str = @hash[:identifier].to_s
55
+ if id_str.scan(/(?=::)/).count == 2
56
+ std_spc_type = id_str.split('::')[2]
57
+ std_spc_type = std_spc_type.split('_')[0]
58
+ os_space_type.setStandardsSpaceType(std_spc_type)
59
+ end
60
+
52
61
  # assign people
53
62
  if @hash[:people]
54
63
  people = PeopleAbridged.new(@hash[:people])
@@ -35,6 +35,16 @@ require 'openstudio'
35
35
 
36
36
  module Honeybee
37
37
  class SimulationParameter
38
+ @@standard_mapper = {
39
+ DOE_Ref_Pre_1980: 'DOE Ref Pre-1980',
40
+ DOE_Ref_1980_2004: 'DOE Ref 1980-2004',
41
+ ASHRAE_2004: '90.1-2004',
42
+ ASHRAE_2007: '90.1-2007',
43
+ ASHRAE_2010: '90.1-2010',
44
+ ASHRAE_2013: '90.1-2013',
45
+ ASHRAE_2016: '90.1-2016',
46
+ ASHRAE_2019: '90.1-2019'
47
+ }
38
48
 
39
49
  # convert to openstudio model, clears errors and warnings
40
50
  def to_openstudio_model(openstudio_model=nil, log_report=false)
@@ -226,6 +236,22 @@ module Honeybee
226
236
  climate_zone_objs.setClimateZone('ASHRAE', cz)
227
237
  end
228
238
 
239
+ # note any efficency standards that have been assigned to the
240
+ if @hash[:sizing_parameter]
241
+ if @hash[:sizing_parameter][:efficiency_standard]
242
+ std_gem_standard = @@standard_mapper[@hash[:sizing_parameter][:efficiency_standard].to_sym]
243
+ building = @openstudio_model.getBuilding
244
+ building.setStandardsTemplate(std_gem_standard)
245
+ end
246
+ if @hash[:sizing_parameter][:climate_zone]
247
+ climate_zone_objs.setClimateZone('ASHRAE', @hash[:sizing_parameter][:climate_zone])
248
+ end
249
+ if @hash[:sizing_parameter][:building_type]
250
+ building = @openstudio_model.getBuilding
251
+ building.setStandardsBuildingType(@hash[:sizing_parameter][:building_type])
252
+ end
253
+ end
254
+
229
255
  # set Outputs for the simulation
230
256
  if @hash[:output]
231
257
  if @hash[:output][:outputs]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybee-openstudio
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.33.7
4
+ version: 2.34.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanushree Charan
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2023-01-27 00:00:00.000000000 Z
14
+ date: 2023-02-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json_pure