honeybee-openstudio 2.27.2 → 2.28.3

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: ff7d0e37c330a44d6397e17757c1908eab92d37e5f04a82362e9391276e13c00
4
- data.tar.gz: 8d3c5348477b29a53bd9d0e1175f110a05e1ef2b213e0a692618308c00f4dfa2
3
+ metadata.gz: 53c3d385d80c233e1b9f69f9391be9fd50af80d09cad0e1651b12857a7b88e3c
4
+ data.tar.gz: 3fdbe6500fcd586709bea31286c761e9412c9e45458698ee337aaaadc79bbf78
5
5
  SHA512:
6
- metadata.gz: 9344fb8b49dbf2c45faba9451840968208115ca401ead34d338dc27c9b391ff56c8f2bb4eaab0bcf688620bc99427dc2dabf79d468abece155d5d459c04eb330
7
- data.tar.gz: 8af9d9bc6f29fea997ee68c357a9bdb6684b54cd45769cc5aa7fb214aa7658f91362704f34f52b9599a8d9b146796a04d5eb5bd959e06927da10659211912151
6
+ metadata.gz: 5f7fb7d3c64ed249eabbba8609ac45e5fbb54c406ce3064aa7b4bf534c9af7a2c2b57bd61dab1ec8ae2826ee9e433d7282810ae1fd7d05a5db31ebe8133e88b3
7
+ data.tar.gz: 38ba645339bb374f8b5c20e5c1cc1f77253ae4a2b8eb23c167ec5449b154faf0d391bb3fa902bcbcb099d3614efaf588fc70d56204de294fb4c2108465f7ca45
@@ -15,8 +15,8 @@ jobs:
15
15
  run: |
16
16
  echo $(pwd)
17
17
  echo $(ls)
18
- docker pull nrel/openstudio:3.2.0
19
- docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.2.0
18
+ docker pull nrel/openstudio:3.3.0
19
+ docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.3.0
20
20
  docker exec -t test pwd
21
21
  docker exec -t test ls
22
22
  docker exec -t test bundle update
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gemspec
7
7
  if File.exist?('../OpenStudio-extension-gem') # local development copy
8
8
  gem 'openstudio-extension', path: '../OpenStudio-extension-gem'
9
9
  else # get it from rubygems.org
10
- gem 'openstudio-extension', '0.4.3'
10
+ gem 'openstudio-extension', '0.5.1'
11
11
  end
12
12
 
13
13
  # coveralls gem is used to generate coverage reports through CI
@@ -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.27.2'
7
+ spec.version = '2.28.3'
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
 
@@ -33,6 +33,6 @@ Gem::Specification.new do |spec|
33
33
  end
34
34
 
35
35
  spec.add_dependency 'json_pure'
36
- spec.add_dependency 'openstudio-extension', '0.4.3'
37
- spec.add_dependency 'openstudio-standards', '~> 0.2.14'
36
+ spec.add_dependency 'openstudio-extension', '0.5.1'
37
+ spec.add_dependency 'openstudio-standards', '~> 0.2.15'
38
38
  end
@@ -40,7 +40,7 @@ module Honeybee
40
40
  hash = {}
41
41
  hash[:type] = 'ShadeConstruction'
42
42
  # set hash values from OpenStudio Object
43
- hash[:identifier] = clean_name(construction.nameString)
43
+ hash[:identifier] = clean_name(construction.nameString) + ' Shade'
44
44
  unless construction.displayName.empty?
45
45
  hash[:display_name] = (construction.displayName.get).force_encoding("UTF-8")
46
46
  end
@@ -72,7 +72,7 @@ module Honeybee
72
72
  unless sub_surface.isConstructionDefaulted
73
73
  construction = sub_surface.construction
74
74
  if !construction.empty?
75
- constr_id = clean_identifier(construction.get.nameString)
75
+ constr_id = clean_name(construction.get.nameString)
76
76
  unless $window_constructions[constr_id].nil?
77
77
  hash[:construction] = constr_id
78
78
  end
@@ -72,7 +72,7 @@ module Honeybee
72
72
  unless sub_surface.isConstructionDefaulted
73
73
  construction = sub_surface.construction
74
74
  if !construction.empty?
75
- constr_id = clean_identifier(construction.get.nameString)
75
+ constr_id = clean_name(construction.get.nameString)
76
76
  if hash[:is_glass] && !$window_constructions[constr_id].nil?
77
77
  hash[:construction] = constr_id
78
78
  elsif !hash[:is_glass] && !$opaque_constructions[constr_id].nil?
@@ -74,7 +74,7 @@ module Honeybee
74
74
  unless surface.isConstructionDefaulted
75
75
  construction = surface.construction
76
76
  if !construction.empty?
77
- constr_id = clean_identifier(construction.get.nameString)
77
+ constr_id = clean_name(construction.get.nameString)
78
78
  unless $opaque_constructions[constr_id].nil?
79
79
  hash[:construction] = constr_id
80
80
  end
@@ -62,7 +62,7 @@ module Honeybee
62
62
  unless shading_surface.isConstructionDefaulted
63
63
  construction = shading_surface.construction
64
64
  if !construction.empty?
65
- const_name = clean_identifier(construction.get.nameString)
65
+ const_name = clean_name(construction.get.nameString) + ' Shade'
66
66
  hash[:construction] = const_name
67
67
  unless $shade_constructions.has_key?(const_name)
68
68
  const_obj = construction.get
@@ -74,7 +74,7 @@ module Honeybee
74
74
 
75
75
  transmittance_schedule = shading_surface.transmittanceSchedule
76
76
  if !transmittance_schedule.empty?
77
- trans_sch_name = clean_identifier(transmittance_schedule.get.nameString)
77
+ trans_sch_name = clean_name(transmittance_schedule.get.nameString)
78
78
  # Check whether schedules other than schedule ruleset or schedule fixed interval are
79
79
  # being assigned
80
80
  unless $schedules[trans_sch_name].nil?
@@ -91,13 +91,6 @@ class FromHoneybeeModelToGbxml < OpenStudio::Measure::ModelMeasure
91
91
  os_model = honeybee_model.to_openstudio_model(model)
92
92
  STDOUT.flush
93
93
 
94
- # make sure the zone name is different from the space name to comply with gbXML
95
- zones = os_model.getThermalZones()
96
- zones.each do |zone|
97
- zone_name = zone.name.to_s + '_Zone'
98
- zone.setName(zone_name)
99
- end
100
-
101
94
  # convert the OpenStudio model into a gbXML Model
102
95
  output_file_path = runner.getStringArgumentValue('output_file_path', user_arguments)
103
96
  if output_file_path && !output_file_path.empty?
@@ -48,14 +48,13 @@ module Honeybee
48
48
  @hash[:geometry][:boundary].each do |vertex|
49
49
  os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
50
50
  end
51
- reordered_vertices = OpenStudio.reorderULC(os_vertices)
52
51
 
53
52
  # triangulate subsurface if neccesary
54
53
  triangulated = false
55
54
  final_vertices_list = []
56
55
  matching_os_subsurfaces = []
57
56
  matching_os_subsurface_indices = []
58
- if reordered_vertices.size > 4
57
+ if os_vertices.size > 4
59
58
 
60
59
  # if this apeture has a matched apeture, see if the other one has already been created
61
60
  # the matched apeture should have been converted to multiple subsurfaces
@@ -75,9 +74,9 @@ module Honeybee
75
74
  if final_vertices_list.empty?
76
75
 
77
76
  # transform to face coordinates
78
- t = OpenStudio::Transformation::alignFace(reordered_vertices)
77
+ t = OpenStudio::Transformation::alignFace(os_vertices)
79
78
  tInv = t.inverse
80
- face_vertices = OpenStudio::reverse(tInv*reordered_vertices)
79
+ face_vertices = OpenStudio::reverse(tInv*os_vertices)
81
80
 
82
81
  # no holes in the subsurface
83
82
  holes = OpenStudio::Point3dVectorVector.new
@@ -85,7 +84,7 @@ module Honeybee
85
84
  # triangulate surface
86
85
  triangles = OpenStudio::computeTriangulation(face_vertices, holes)
87
86
  if triangles.empty?
88
- raise "Failed to triangulate aperture #{@hash[:identifier]} with #{reordered_vertices.size} vertices"
87
+ raise "Failed to triangulate aperture #{@hash[:identifier]} with #{os_vertices.size} vertices"
89
88
  end
90
89
 
91
90
  # create new list of surfaces
@@ -98,13 +97,13 @@ module Honeybee
98
97
  end
99
98
 
100
99
  else
101
- # reordered_vertices are good as is
102
- final_vertices_list << reordered_vertices
100
+ # os_vertices are good as is
101
+ final_vertices_list << os_vertices
103
102
  end
104
103
 
105
104
  result = []
106
- final_vertices_list.each_with_index do |reordered_vertices, index|
107
- os_subsurface = OpenStudio::Model::SubSurface.new(reordered_vertices, openstudio_model)
105
+ final_vertices_list.each_with_index do |os_vertices, index|
106
+ os_subsurface = OpenStudio::Model::SubSurface.new(os_vertices, openstudio_model)
108
107
 
109
108
  if !matching_os_subsurfaces.empty?
110
109
  os_subsurface.setName(@hash[:identifier] + "..#{matching_os_subsurface_indices[index]}")
@@ -160,5 +159,49 @@ module Honeybee
160
159
 
161
160
  return result
162
161
  end
162
+
163
+ def to_openstudio_shade(openstudio_model, shading_surface_group)
164
+ # get the vertices from the aperture
165
+ if @hash[:geometry][:vertices].nil?
166
+ hb_verts = @hash[:geometry][:boundary]
167
+ else
168
+ hb_verts = @hash[:geometry][:vertices]
169
+ end
170
+
171
+ # create the openstudio shading surface
172
+ os_vertices = OpenStudio::Point3dVector.new
173
+ hb_verts.each do |vertex|
174
+ os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
175
+ end
176
+
177
+ os_shading_surface = OpenStudio::Model::ShadingSurface.new(os_vertices, openstudio_model)
178
+ os_shading_surface.setName(@hash[:identifier])
179
+ unless @hash[:display_name].nil?
180
+ os_shading_surface.setDisplayName(@hash[:display_name])
181
+ end
182
+
183
+ # get the approriate construction id
184
+ construction_id = nil
185
+ if @hash[:properties][:energy][:construction]
186
+ construction_id = @hash[:properties][:energy][:construction]
187
+ else
188
+ construction_id = 'Generic Double Pane'
189
+ end
190
+
191
+ # assign the construction
192
+ unless construction_id.nil?
193
+ construction = openstudio_model.getConstructionByName(construction_id)
194
+ unless construction.empty?
195
+ os_construction = construction.get
196
+ os_shading_surface.setConstruction(os_construction)
197
+ end
198
+ end
199
+
200
+ # add the shade to the group
201
+ os_shading_surface.setShadingSurfaceGroup(shading_surface_group)
202
+
203
+ os_shading_surface
204
+ end
205
+
163
206
  end # Aperture
164
207
  end # Honeybee
@@ -48,14 +48,13 @@ module Honeybee
48
48
  @hash[:geometry][:boundary].each do |vertex|
49
49
  os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
50
50
  end
51
- reordered_vertices = OpenStudio.reorderULC(os_vertices)
52
51
 
53
52
  # triangulate subsurface if neccesary
54
53
  triangulated = false
55
54
  final_vertices_list = []
56
55
  matching_os_subsurfaces = []
57
56
  matching_os_subsurface_indices = []
58
- if reordered_vertices.size > 4
57
+ if os_vertices.size > 4
59
58
 
60
59
  # if this door has a matched door, see if the other one has already been created
61
60
  # the matched door should have been converted to multiple subsurfaces
@@ -75,9 +74,9 @@ module Honeybee
75
74
  if final_vertices_list.empty?
76
75
 
77
76
  # transform to face coordinates
78
- t = OpenStudio::Transformation::alignFace(reordered_vertices)
77
+ t = OpenStudio::Transformation::alignFace(os_vertices)
79
78
  tInv = t.inverse
80
- face_vertices = OpenStudio::reverse(tInv*reordered_vertices)
79
+ face_vertices = OpenStudio::reverse(tInv*os_vertices)
81
80
 
82
81
  # no holes in the subsurface
83
82
  holes = OpenStudio::Point3dVectorVector.new
@@ -85,7 +84,7 @@ module Honeybee
85
84
  # triangulate surface
86
85
  triangles = OpenStudio::computeTriangulation(face_vertices, holes)
87
86
  if triangles.empty?
88
- raise "Failed to triangulate door #{@hash[:identifier]} with #{reordered_vertices.size} vertices"
87
+ raise "Failed to triangulate door #{@hash[:identifier]} with #{os_vertices.size} vertices"
89
88
  end
90
89
 
91
90
  # create new list of surfaces
@@ -98,13 +97,13 @@ module Honeybee
98
97
  end
99
98
 
100
99
  else
101
- # reordered_vertices are good as is
102
- final_vertices_list << reordered_vertices
100
+ # os_vertices are good as is
101
+ final_vertices_list << os_vertices
103
102
  end
104
103
 
105
104
  result = []
106
- final_vertices_list.each_with_index do |reordered_vertices, index|
107
- os_subsurface = OpenStudio::Model::SubSurface.new(reordered_vertices, openstudio_model)
105
+ final_vertices_list.each_with_index do |os_vertices, index|
106
+ os_subsurface = OpenStudio::Model::SubSurface.new(os_vertices, openstudio_model)
108
107
 
109
108
  if !matching_os_subsurfaces.empty?
110
109
  os_subsurface.setName(@hash[:identifier] + "..#{matching_os_subsurface_indices[index]}")
@@ -154,4 +153,50 @@ module Honeybee
154
153
  return result
155
154
  end
156
155
  end # Door
156
+
157
+ def to_openstudio_shade(openstudio_model, shading_surface_group)
158
+ # get the vertices from the door
159
+ if @hash[:geometry][:vertices].nil?
160
+ hb_verts = @hash[:geometry][:boundary]
161
+ else
162
+ hb_verts = @hash[:geometry][:vertices]
163
+ end
164
+
165
+ # create the openstudio shading surface
166
+ os_vertices = OpenStudio::Point3dVector.new
167
+ hb_verts.each do |vertex|
168
+ os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
169
+ end
170
+
171
+ os_shading_surface = OpenStudio::Model::ShadingSurface.new(os_vertices, openstudio_model)
172
+ os_shading_surface.setName(@hash[:identifier])
173
+ unless @hash[:display_name].nil?
174
+ os_shading_surface.setDisplayName(@hash[:display_name])
175
+ end
176
+
177
+ # get the approriate construction id
178
+ construction_id = nil
179
+ if @hash[:properties][:energy][:construction]
180
+ construction_id = @hash[:properties][:energy][:construction]
181
+ elsif @hash[:is_glass] == true
182
+ construction_id = 'Generic Double Pane'
183
+ else
184
+ construction_id = 'Generic Exterior Door'
185
+ end
186
+
187
+ # assign the construction
188
+ unless construction_id.nil?
189
+ construction = openstudio_model.getConstructionByName(construction_id)
190
+ unless construction.empty?
191
+ os_construction = construction.get
192
+ os_shading_surface.setConstruction(os_construction)
193
+ end
194
+ end
195
+
196
+ # add the shade to the group
197
+ os_shading_surface.setShadingSurfaceGroup(shading_surface_group)
198
+
199
+ os_shading_surface
200
+ end
201
+
157
202
  end # Honeybee
@@ -55,10 +55,9 @@ module Honeybee
55
55
  hb_verts.each do |vertex|
56
56
  os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
57
57
  end
58
- reordered_vertices = OpenStudio.reorderULC(os_vertices)
59
58
 
60
59
  # create the openstudio surface and assign the type
61
- os_surface = OpenStudio::Model::Surface.new(reordered_vertices, openstudio_model)
60
+ os_surface = OpenStudio::Model::Surface.new(os_vertices, openstudio_model)
62
61
  os_surface.setName(@hash[:identifier])
63
62
  unless @hash[:display_name].nil?
64
63
  os_surface.setDisplayName(@hash[:display_name])
@@ -184,5 +183,69 @@ module Honeybee
184
183
 
185
184
  os_surface
186
185
  end
186
+
187
+ def to_openstudio_shade(openstudio_model, shading_surface_group)
188
+ # get the vertices from the face
189
+ if @hash[:geometry][:vertices].nil?
190
+ hb_verts = @hash[:geometry][:boundary]
191
+ else
192
+ hb_verts = @hash[:geometry][:vertices]
193
+ end
194
+
195
+ # create the openstudio shading surface
196
+ os_vertices = OpenStudio::Point3dVector.new
197
+ hb_verts.each do |vertex|
198
+ os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
199
+ end
200
+
201
+ os_shading_surface = OpenStudio::Model::ShadingSurface.new(os_vertices, openstudio_model)
202
+ os_shading_surface.setName(@hash[:identifier])
203
+ unless @hash[:display_name].nil?
204
+ os_shading_surface.setDisplayName(@hash[:display_name])
205
+ end
206
+
207
+ # get the approriate construction id
208
+ construction_id = nil
209
+ if @hash[:properties][:energy][:construction]
210
+ construction_id = @hash[:properties][:energy][:construction]
211
+ elsif @hash[:face_type] == 'Wall'
212
+ construction_id = 'Generic Exterior Wall'
213
+ elsif @hash[:face_type] == 'RoofCeiling'
214
+ construction_id = 'Generic Roof'
215
+ elsif @hash[:face_type] == 'Floor'
216
+ construction_id = 'Generic Exposed Floor'
217
+ end
218
+
219
+ # assign the construction
220
+ unless construction_id.nil?
221
+ construction = openstudio_model.getConstructionByName(construction_id)
222
+ unless construction.empty?
223
+ os_construction = construction.get
224
+ os_shading_surface.setConstruction(os_construction)
225
+ end
226
+ end
227
+
228
+ # add the shade to the group
229
+ os_shading_surface.setShadingSurfaceGroup(shading_surface_group)
230
+
231
+ # convert the apertures to shade objects
232
+ if @hash[:apertures]
233
+ @hash[:apertures].each do |aperture|
234
+ hb_aperture = Aperture.new(aperture)
235
+ os_subsurface_aperture = hb_aperture.to_openstudio_shade(openstudio_model, shading_surface_group)
236
+ end
237
+ end
238
+
239
+ # convert the apertures to shade objects
240
+ if @hash[:doors]
241
+ @hash[:doors].each do |door|
242
+ hb_door = Door.new(door)
243
+ os_subsurface_door = hb_door.to_openstudio_shade(openstudio_model, shading_surface_group)
244
+ end
245
+ end
246
+
247
+ os_shading_surface
248
+ end
249
+
187
250
  end # Face
188
251
  end # Honeybee
@@ -39,7 +39,7 @@ module Honeybee
39
39
  attr_reader :unique_space_type
40
40
 
41
41
  def find_existing_openstudio_object(openstudio_model)
42
- model_space = openstudio_model.getSpaceByName(@hash[:identifier])
42
+ model_space = openstudio_model.getSpaceByName(@hash[:identifier] + '_Space')
43
43
  return model_space.get unless model_space.empty?
44
44
  nil
45
45
  end
@@ -75,7 +75,7 @@ module Honeybee
75
75
  def to_openstudio(openstudio_model)
76
76
  # create the space and thermal zone
77
77
  os_space = OpenStudio::Model::Space.new(openstudio_model)
78
- os_space.setName(@hash[:identifier])
78
+ os_space.setName(@hash[:identifier] + '_Space')
79
79
  unless @hash[:display_name].nil?
80
80
  os_space.setDisplayName(@hash[:display_name])
81
81
  end
@@ -189,6 +189,7 @@ module Honeybee
189
189
  end
190
190
  end
191
191
 
192
+ # assign interior constructions for adiabatic Faces
192
193
  if !face[:properties][:energy][:construction]
193
194
  if face[:boundary_condition][:type] == 'Adiabatic'
194
195
  # assign default interior construction for Adiabatic Faces
@@ -198,28 +199,34 @@ module Honeybee
198
199
  os_surface.setConstruction(interior_construction)
199
200
  end
200
201
  end
201
- elsif face[:face_type] == 'AirBoundary'
202
- # assign default air boundary construction for AirBoundary face types
203
- air_construction = closest_air_construction(openstudio_model, os_space)
202
+ end
203
+ end
204
+
205
+ # assign air boundaries
206
+ if face[:face_type] == 'AirBoundary'
207
+ # assign default air boundary construction for AirBoundary face types
208
+ air_construction = closest_air_construction(openstudio_model, os_space)
209
+ if !face[:properties][:energy][:construction]
204
210
  unless air_construction.nil?
205
211
  os_surface.setConstruction(air_construction)
206
212
  end
207
- # add air mixing properties to the global list that tracks them
208
- if $use_simple_vent # only use air mixing objects when simple ventilation is requested
209
- air_hash = $air_boundary_hash[air_construction.name.to_s]
210
- if air_hash[:air_mixing_per_area]
211
- air_mix_area = air_hash[:air_mixing_per_area]
212
- else
213
- air_default = @@schema[:components][:schemas][:AirBoundaryConstructionAbridged]
214
- air_mix_area = air_default[:properties][:air_mixing_per_area][:default]
215
- end
216
- flow_rate = os_surface.netArea * air_mix_area
217
- flow_sch_id = air_hash[:air_mixing_schedule]
218
- adj_zone_id = face[:boundary_condition][:boundary_condition_objects][-1]
219
- $air_mxing_array << [os_thermal_zone, flow_rate, flow_sch_id, adj_zone_id]
213
+ end
214
+ # add air mixing properties to the global list that tracks them
215
+ if $use_simple_vent # only use air mixing objects when simple ventilation is requested
216
+ air_hash = $air_boundary_hash[air_construction.name.to_s]
217
+ if air_hash[:air_mixing_per_area]
218
+ air_mix_area = air_hash[:air_mixing_per_area]
219
+ else
220
+ air_default = @@schema[:components][:schemas][:AirBoundaryConstructionAbridged]
221
+ air_mix_area = air_default[:properties][:air_mixing_per_area][:default]
220
222
  end
223
+ flow_rate = os_surface.netArea * air_mix_area
224
+ flow_sch_id = air_hash[:air_mixing_schedule]
225
+ adj_zone_id = face[:boundary_condition][:boundary_condition_objects][-1]
226
+ $air_mxing_array << [os_thermal_zone, flow_rate, flow_sch_id, adj_zone_id]
221
227
  end
222
228
  end
229
+
223
230
  end
224
231
 
225
232
  # assign any room-level outdoor shades if they exist
@@ -55,9 +55,8 @@ module Honeybee
55
55
  hb_verts.each do |vertex|
56
56
  os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
57
57
  end
58
- reordered_vertices = OpenStudio.reorderULC(os_vertices)
59
58
 
60
- os_shading_surface = OpenStudio::Model::ShadingSurface.new(reordered_vertices, openstudio_model)
59
+ os_shading_surface = OpenStudio::Model::ShadingSurface.new(os_vertices, openstudio_model)
61
60
  os_shading_surface.setName(@hash[:identifier])
62
61
  unless @hash[:display_name].nil?
63
62
  os_shading_surface.setDisplayName(@hash[:display_name])
@@ -234,7 +234,7 @@ module Honeybee
234
234
  # create water use equipment + connection and set identifier
235
235
  os_shw_def = OpenStudio::Model::WaterUseEquipmentDefinition.new(openstudio_model)
236
236
  os_shw = OpenStudio::Model::WaterUseEquipment.new(os_shw_def)
237
- unique_id = @hash[:identifier] + '..' + os_space.nameString
237
+ unique_id = @hash[:identifier] + '..' + os_space.nameString[0...-6]
238
238
  os_shw_def.setName(unique_id)
239
239
  os_shw.setName(unique_id)
240
240
 
@@ -203,6 +203,9 @@ module Honeybee
203
203
  puts 'Translating Context Shade Geometry'
204
204
  end
205
205
  create_orphaned_shades
206
+ create_orphaned_faces
207
+ create_orphaned_apertures
208
+ create_orphaned_doors
206
209
  end
207
210
 
208
211
  def create_materials(material_dicts, check_existing=false)
@@ -588,28 +591,43 @@ module Honeybee
588
591
  shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(@openstudio_model)
589
592
  shading_surface_group.setShadingSurfaceType('Building')
590
593
  @hash[:orphaned_shades].each do |shade|
591
- shade_object = Shade.new(shade)
592
- openstudio_shade = shade_object.to_openstudio(@openstudio_model)
593
- openstudio_shade.setShadingSurfaceGroup(shading_surface_group)
594
+ shade_object = Shade.new(shade)
595
+ openstudio_shade = shade_object.to_openstudio(@openstudio_model)
596
+ openstudio_shade.setShadingSurfaceGroup(shading_surface_group)
594
597
  end
595
598
  end
596
599
  end
597
600
 
598
601
  def create_orphaned_faces
599
602
  if @hash[:orphaned_faces]
600
- raise "Orphaned Faces are not translatable to OpenStudio."
603
+ shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(@openstudio_model)
604
+ shading_surface_group.setShadingSurfaceType('Building')
605
+ @hash[:orphaned_faces].each do |face|
606
+ face_object = Face.new(face)
607
+ openstudio_shade = face_object.to_openstudio_shade(@openstudio_model, shading_surface_group)
608
+ end
601
609
  end
602
610
  end
603
611
 
604
612
  def create_orphaned_apertures
605
613
  if @hash[:orphaned_apertures]
606
- raise "Orphaned Apertures are not translatable to OpenStudio."
614
+ shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(@openstudio_model)
615
+ shading_surface_group.setShadingSurfaceType('Building')
616
+ @hash[:orphaned_apertures].each do |ap|
617
+ ap_object = Aperture.new(ap)
618
+ openstudio_shade = ap_object.to_openstudio_shade(@openstudio_model, shading_surface_group)
619
+ end
607
620
  end
608
621
  end
609
622
 
610
623
  def create_orphaned_doors
611
624
  if @hash[:orphaned_doors]
612
- raise "Orphaned Doors are not translatable to OpenStudio."
625
+ shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(@openstudio_model)
626
+ shading_surface_group.setShadingSurfaceType('Building')
627
+ @hash[:orphaned_doors].each do |dr|
628
+ dr_object = Door.new(dr)
629
+ openstudio_shade = dr_object.to_openstudio_shade(@openstudio_model, shading_surface_group)
630
+ end
613
631
  end
614
632
  end
615
633
 
@@ -145,13 +145,24 @@ module Honeybee
145
145
  os_sizing_par.setCoolingSizingFactor(@hash[:sizing_parameter][:cooling_factor])
146
146
  end
147
147
  # set any design days
148
+ db_temps = []
148
149
  if @hash[:sizing_parameter][:design_days]
149
150
  @hash[:sizing_parameter][:design_days].each do |des_day|
150
151
  des_day_object = DesignDay.new(des_day)
151
152
  os_des_day = des_day_object.to_openstudio(@openstudio_model)
153
+ db_temps << des_day[:dry_bulb_condition][:dry_bulb_max]
152
154
  end
153
155
  end
154
156
  end
157
+ # use the average of design day temperatures to set the water mains temperature
158
+ os_water_mains = @openstudio_model.getSiteWaterMainsTemperature
159
+ os_water_mains.setCalculationMethod('Correlation')
160
+ if db_temps.length > 0
161
+ os_water_mains.setAnnualAverageOutdoorAirTemperature((db_temps.max + db_temps.min) / 2)
162
+ else # just use some dummy values so that the simulation does not fail
163
+ os_water_mains.setAnnualAverageOutdoorAirTemperature(12)
164
+ end
165
+ os_water_mains.setMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures(4)
155
166
 
156
167
  # set Outputs for the simulation
157
168
  if @hash[:output]
@@ -238,9 +249,6 @@ module Honeybee
238
249
  os_site.setTerrain(@hash[:terrain_type])
239
250
  end
240
251
 
241
- # ensure water mains temperatures are written
242
- os_water_mains = @openstudio_model.getSiteWaterMainsTemperature
243
- os_water_mains.setCalculationMethod('CorrelationFromWeatherFile')
244
252
  end
245
253
 
246
254
  end #SimulationParameter
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.27.2
4
+ version: 2.28.3
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: 2021-11-25 00:00:00.000000000 Z
14
+ date: 2021-12-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -117,28 +117,28 @@ dependencies:
117
117
  requirements:
118
118
  - - '='
119
119
  - !ruby/object:Gem::Version
120
- version: 0.4.3
120
+ version: 0.5.1
121
121
  type: :runtime
122
122
  prerelease: false
123
123
  version_requirements: !ruby/object:Gem::Requirement
124
124
  requirements:
125
125
  - - '='
126
126
  - !ruby/object:Gem::Version
127
- version: 0.4.3
127
+ version: 0.5.1
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: openstudio-standards
130
130
  requirement: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - "~>"
133
133
  - !ruby/object:Gem::Version
134
- version: 0.2.14
134
+ version: 0.2.15
135
135
  type: :runtime
136
136
  prerelease: false
137
137
  version_requirements: !ruby/object:Gem::Requirement
138
138
  requirements:
139
139
  - - "~>"
140
140
  - !ruby/object:Gem::Version
141
- version: 0.2.14
141
+ version: 0.2.15
142
142
  description: Library and measures for translating between Honeybee JSON schema and
143
143
  OpenStudio Model schema (OSM).
144
144
  email: