honeybee-openstudio 2.27.1 → 2.28.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9db2d95ead18900489d537bcc21a24e804b1f58a1ca441f1b41cb49021b1a7d7
4
- data.tar.gz: 93aac46ba539ec68a0285b849db359621b40a4dde85a1353b643a57a0abba73d
3
+ metadata.gz: 1c3f02cf48f4c9d6c3b519513a9602452d044c24287ba8b3ad9d9317e2cb869b
4
+ data.tar.gz: 5a08ac81d335c8ca9862dbf84a2e918480b594cf4e2e2cc495ef78d26b3e6256
5
5
  SHA512:
6
- metadata.gz: 859377cf4caee885db4eb6b01210b2e60687c5ca75c6d3171b7c4294c38fe8cd61ab0708f0ae382017a2d52cac6203c10e52798c90b287582382ce2d6d6c1652
7
- data.tar.gz: 9ae642724f71c3b54b99ef5d64f14718d957674066c6ccdcfb7b8848e53346728c456382abf3da2a52513508b84330ba15a4dcfff2897b36c2450fce7d875091
6
+ metadata.gz: 8b94674ad176a8846d1a2b10bfc11f3da312ff7e9adb186eac9c93a4bbc66d87d76bc1b41e730d49d9f93cd1d409e6f38b1256e9a5fb5dd4bdb08e077bb4b482
7
+ data.tar.gz: 30daf7224ae75f43219a0e9566146a045d5d86f074079ee29157455373804967b639a820f328777e71b69982a0392bbc4f97c0a24fdef55d2bff0c8a04ef5a46
@@ -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.1'
7
+ spec.version = '2.28.2'
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
@@ -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
 
@@ -591,28 +591,43 @@ module Honeybee
591
591
  shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(@openstudio_model)
592
592
  shading_surface_group.setShadingSurfaceType('Building')
593
593
  @hash[:orphaned_shades].each do |shade|
594
- shade_object = Shade.new(shade)
595
- openstudio_shade = shade_object.to_openstudio(@openstudio_model)
596
- 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)
597
597
  end
598
598
  end
599
599
  end
600
600
 
601
601
  def create_orphaned_faces
602
602
  if @hash[:orphaned_faces]
603
- 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
604
609
  end
605
610
  end
606
611
 
607
612
  def create_orphaned_apertures
608
613
  if @hash[:orphaned_apertures]
609
- 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
610
620
  end
611
621
  end
612
622
 
613
623
  def create_orphaned_doors
614
624
  if @hash[:orphaned_doors]
615
- 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
616
631
  end
617
632
  end
618
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.1
4
+ version: 2.28.2
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-23 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: