honeybee-openstudio 2.27.0 → 2.28.1

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: 84b66e4746d59f77468d6ab7e342a1c7feb57806e692173dee69ec248f5a4b1f
4
- data.tar.gz: e9e0476441a4f9261292b2d78d49c15c1d113de599b6ef7dcebfb3c79cc72888
3
+ metadata.gz: f46d6897c585ff7082971de6ff24b62e1d4213697bb9e3fb08a9b4eefd069a6d
4
+ data.tar.gz: 4c231dc4b6622e5d9871eddb54e6b6e32ebb5302183372845ea690552f0407f3
5
5
  SHA512:
6
- metadata.gz: a260b02b02b502f29c2cebfa55c9b9938aef96f0b2bcdfe4044cc3a28af14290615ad6e1b9afde6747cd6d11e4e18a0974f793683af251a3d5743ca20450d37b
7
- data.tar.gz: 8022e1f14fb2a5f700e7f5dedfc5d7a26e481b463ebef2cac6b381ee798d3906508edd9508717e07b7dcb6f967a5a9f2ed9bd7c9c85aaafa79d822d6b74fea90
6
+ metadata.gz: 8a9192fca6bf36375576eb5fd7efb3f104e4ed34b2607e8d80c36ce60f272cdd7c62b1badb4a43f1c0daa0e813b63e5dffc407e25032172c045d7523b5f05e7d
7
+ data.tar.gz: e2533183332b489d8ba275feddf184c56f7cdca3a5bb561ce9ae7ad6af3177b9983b57872a1623c316a1d4b3ddea060dec1ab2714429edbe1a450928c5a5bb01
@@ -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.0'
7
+ spec.version = '2.28.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
 
@@ -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
@@ -37,4 +37,4 @@ else
37
37
  end
38
38
 
39
39
  # include the honeybee-openstudio-gem
40
- gem 'honeybee-openstudio', '2.26.0'
40
+ gem 'honeybee-openstudio', '2.27.0'
@@ -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?
@@ -160,5 +160,50 @@ module Honeybee
160
160
 
161
161
  return result
162
162
  end
163
+
164
+ def to_openstudio_shade(openstudio_model, shading_surface_group)
165
+ # get the vertices from the aperture
166
+ if @hash[:geometry][:vertices].nil?
167
+ hb_verts = @hash[:geometry][:boundary]
168
+ else
169
+ hb_verts = @hash[:geometry][:vertices]
170
+ end
171
+
172
+ # create the openstudio shading surface
173
+ os_vertices = OpenStudio::Point3dVector.new
174
+ hb_verts.each do |vertex|
175
+ os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
176
+ end
177
+ reordered_vertices = OpenStudio.reorderULC(os_vertices)
178
+
179
+ os_shading_surface = OpenStudio::Model::ShadingSurface.new(reordered_vertices, openstudio_model)
180
+ os_shading_surface.setName(@hash[:identifier])
181
+ unless @hash[:display_name].nil?
182
+ os_shading_surface.setDisplayName(@hash[:display_name])
183
+ end
184
+
185
+ # get the approriate construction id
186
+ construction_id = nil
187
+ if @hash[:properties][:energy][:construction]
188
+ construction_id = @hash[:properties][:energy][:construction]
189
+ else
190
+ construction_id = 'Generic Double Pane'
191
+ end
192
+
193
+ # assign the construction
194
+ unless construction_id.nil?
195
+ construction = openstudio_model.getConstructionByName(construction_id)
196
+ unless construction.empty?
197
+ os_construction = construction.get
198
+ os_shading_surface.setConstruction(os_construction)
199
+ end
200
+ end
201
+
202
+ # add the shade to the group
203
+ os_shading_surface.setShadingSurfaceGroup(shading_surface_group)
204
+
205
+ os_shading_surface
206
+ end
207
+
163
208
  end # Aperture
164
209
  end # Honeybee
@@ -154,4 +154,51 @@ module Honeybee
154
154
  return result
155
155
  end
156
156
  end # Door
157
+
158
+ def to_openstudio_shade(openstudio_model, shading_surface_group)
159
+ # get the vertices from the door
160
+ if @hash[:geometry][:vertices].nil?
161
+ hb_verts = @hash[:geometry][:boundary]
162
+ else
163
+ hb_verts = @hash[:geometry][:vertices]
164
+ end
165
+
166
+ # create the openstudio shading surface
167
+ os_vertices = OpenStudio::Point3dVector.new
168
+ hb_verts.each do |vertex|
169
+ os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
170
+ end
171
+ reordered_vertices = OpenStudio.reorderULC(os_vertices)
172
+
173
+ os_shading_surface = OpenStudio::Model::ShadingSurface.new(reordered_vertices, openstudio_model)
174
+ os_shading_surface.setName(@hash[:identifier])
175
+ unless @hash[:display_name].nil?
176
+ os_shading_surface.setDisplayName(@hash[:display_name])
177
+ end
178
+
179
+ # get the approriate construction id
180
+ construction_id = nil
181
+ if @hash[:properties][:energy][:construction]
182
+ construction_id = @hash[:properties][:energy][:construction]
183
+ elsif @hash[:is_glass] == true
184
+ construction_id = 'Generic Double Pane'
185
+ else
186
+ construction_id = 'Generic Exterior Door'
187
+ end
188
+
189
+ # assign the construction
190
+ unless construction_id.nil?
191
+ construction = openstudio_model.getConstructionByName(construction_id)
192
+ unless construction.empty?
193
+ os_construction = construction.get
194
+ os_shading_surface.setConstruction(os_construction)
195
+ end
196
+ end
197
+
198
+ # add the shade to the group
199
+ os_shading_surface.setShadingSurfaceGroup(shading_surface_group)
200
+
201
+ os_shading_surface
202
+ end
203
+
157
204
  end # Honeybee
@@ -184,5 +184,70 @@ module Honeybee
184
184
 
185
185
  os_surface
186
186
  end
187
+
188
+ def to_openstudio_shade(openstudio_model, shading_surface_group)
189
+ # get the vertices from the face
190
+ if @hash[:geometry][:vertices].nil?
191
+ hb_verts = @hash[:geometry][:boundary]
192
+ else
193
+ hb_verts = @hash[:geometry][:vertices]
194
+ end
195
+
196
+ # create the openstudio shading surface
197
+ os_vertices = OpenStudio::Point3dVector.new
198
+ hb_verts.each do |vertex|
199
+ os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
200
+ end
201
+ reordered_vertices = OpenStudio.reorderULC(os_vertices)
202
+
203
+ os_shading_surface = OpenStudio::Model::ShadingSurface.new(reordered_vertices, openstudio_model)
204
+ os_shading_surface.setName(@hash[:identifier])
205
+ unless @hash[:display_name].nil?
206
+ os_shading_surface.setDisplayName(@hash[:display_name])
207
+ end
208
+
209
+ # get the approriate construction id
210
+ construction_id = nil
211
+ if @hash[:properties][:energy][:construction]
212
+ construction_id = @hash[:properties][:energy][:construction]
213
+ elsif @hash[:face_type] == 'Wall'
214
+ construction_id = 'Generic Exterior Wall'
215
+ elsif @hash[:face_type] == 'RoofCeiling'
216
+ construction_id = 'Generic Roof'
217
+ elsif @hash[:face_type] == 'Floor'
218
+ construction_id = 'Generic Exposed Floor'
219
+ end
220
+
221
+ # assign the construction
222
+ unless construction_id.nil?
223
+ construction = openstudio_model.getConstructionByName(construction_id)
224
+ unless construction.empty?
225
+ os_construction = construction.get
226
+ os_shading_surface.setConstruction(os_construction)
227
+ end
228
+ end
229
+
230
+ # add the shade to the group
231
+ os_shading_surface.setShadingSurfaceGroup(shading_surface_group)
232
+
233
+ # convert the apertures to shade objects
234
+ if @hash[:apertures]
235
+ @hash[:apertures].each do |aperture|
236
+ hb_aperture = Aperture.new(aperture)
237
+ os_subsurface_aperture = hb_aperture.to_openstudio_shade(openstudio_model, shading_surface_group)
238
+ end
239
+ end
240
+
241
+ # convert the apertures to shade objects
242
+ if @hash[:doors]
243
+ @hash[:doors].each do |door|
244
+ hb_door = Door.new(door)
245
+ os_subsurface_door = hb_door.to_openstudio_shade(openstudio_model, shading_surface_group)
246
+ end
247
+ end
248
+
249
+ os_shading_surface
250
+ end
251
+
187
252
  end # Face
188
253
  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
@@ -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.0
4
+ version: 2.28.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: 2021-11-16 00:00:00.000000000 Z
14
+ date: 2021-12-06 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: