honeybee-openstudio 2.17.4 → 2.19.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: 1186d2bbbf3f03e945a82ae14f61b1529715930086e4e33a196650b9e3c0cf7b
4
- data.tar.gz: f68521a43fa529cf678eb8acb14895558244d896b09f1349bb033fab3cf91d2b
3
+ metadata.gz: c0eef1a93d808c013a2940a86c57362e8eaf8351b3f17be46472b3bf4369fa96
4
+ data.tar.gz: 7d0cc499fa57dba16782d3b36e6ab2ec84fbd6e83c2b50e90f7f8552441ff272
5
5
  SHA512:
6
- metadata.gz: f344d6880203249bffdb96dd677db64a64b1f9dd025bdf1992bab9b04c09449e2d3e63cbf8ddb3e12b4df89b975da693a021fb91dd130bee2225d7f61e638e8e
7
- data.tar.gz: 14d6d0470bf0323c7d37753d8f53f6314ad928618deac469d0515b9ba6311f25c1129f4b71d6f5ba3b4565536fbaaa3ea43ae0d7f699079c67469781bc8c2b1c
6
+ metadata.gz: 94773eda8ad2683003c60a8c3bf55dae393a91c6f131620f190d82afeaf22f3a04605fd6acc32565df51b626a0528fe48be7e9d3f5f0fe0736198bec16eb55e1
7
+ data.tar.gz: 202bee1bd7374d2b6a682b4457b218c4a6b3da7ae570377b0823ae4a0efbdd9426de237264b4c75a0b4b03084c35e94d1d7f4b9807c7ba5b48df06a397d08af0
data/README.md CHANGED
@@ -7,7 +7,6 @@
7
7
 
8
8
  Library and measures for translating between Honeybee JSON schema and OpenStudio Model schema (OSM).
9
9
 
10
-
11
10
  ## Run the measures of this repo using OpenStudio CLI
12
11
 
13
12
  Running the measures using OpenStudio CLI requires no installation other than cloning
@@ -42,8 +41,8 @@ where the items in parentheses should be replaced with specific file paths:
42
41
 
43
42
  ```
44
43
 
45
-
46
44
  ## Local Development
45
+
47
46
  1. Clone this repo locally
48
47
  ```
49
48
  git clone git@github.com:ladybug-tools/honeybee-openstudio-gem
@@ -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.17.4'
7
+ spec.version = '2.19.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
 
@@ -43,6 +43,22 @@ require 'from_openstudio/geometry/face'
43
43
  require 'from_openstudio/geometry/room'
44
44
  require 'from_openstudio/geometry/shade'
45
45
 
46
+ # extend the construction objects
47
+ require 'from_openstudio/construction/opaque'
48
+ require 'from_openstudio/construction/window'
49
+ require 'from_openstudio/construction/shade'
50
+ require 'from_openstudio/construction/air'
51
+
52
+ # import the material objects
53
+ require 'from_openstudio/material/opaque'
54
+ require 'from_openstudio/material/opaque_no_mass'
55
+ require 'from_openstudio/material/window_gas'
56
+ require 'from_openstudio/material/window_gas_mixture'
57
+ require 'from_openstudio/material/window_gas_custom'
58
+ require 'from_openstudio/material/window_blind'
59
+ require 'from_openstudio/material/window_glazing'
60
+ require 'from_openstudio/material/window_simpleglazsys'
61
+
46
62
  # extend the simulation objects
47
63
  require 'from_openstudio/simulation/design_day'
48
64
  require 'from_openstudio/simulation/parameter_model'
@@ -0,0 +1,55 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/construction/air'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class AirBoundaryConstructionAbridged < ModelObject
37
+
38
+ def self.from_construction(construction)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'AirBoundaryConstructionAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = construction.nameString
44
+ # check if boost optional object is empty
45
+ unless construction.simpleMixingSchedule.empty?
46
+ schedule = construction.simpleMixingSchedule.get
47
+ hash[:air_mixing_schedule] = schedule.nameString
48
+ end
49
+ #TODO: Add air_mixing_per_area
50
+
51
+ hash
52
+ end
53
+
54
+ end # AirBoundaryConstructionAbridged
55
+ end # Honeybee
@@ -0,0 +1,56 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/construction/opaque'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class OpaqueConstructionAbridged < ModelObject
37
+
38
+ def self.from_construction(construction)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'OpaqueConstructionAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = construction.nameString
44
+ hash[:materials] = []
45
+ # get construction layers
46
+ layers = construction.layers
47
+ layers.each do |layer|
48
+ name = layer.nameString
49
+ hash[:materials] << name
50
+ end
51
+
52
+ hash
53
+ end
54
+
55
+ end # OpaqueConstructionAbridged
56
+ end # Honeybee
@@ -0,0 +1,82 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/construction/shade'
33
+ require 'from_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class ShadeConstruction < ModelObject
37
+
38
+ def self.from_construction(construction)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'ShadeConstruction'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = construction.nameString
44
+ # get outermost construction layers
45
+ layer = construction.layers[0]
46
+ if layer.to_StandardGlazing.is_initialized
47
+ layer = layer.to_StandardGlazing.get
48
+ hash[:is_specular] = true
49
+ # set reflectance properties from outermost layer
50
+ unless layer.frontSideSolarReflectanceatNormalIncidence.empty?
51
+ hash[:solar_reflectance] = layer.frontSideSolarReflectanceatNormalIncidence.get
52
+ end
53
+ unless layer.frontSideVisibleReflectanceatNormalIncidence.empty?
54
+ hash[:visible_reflectance] = layer.frontSideVisibleReflectanceatNormalIncidence.get
55
+ end
56
+ elsif layer.to_StandardOpaqueMaterial.is_initialized
57
+ layer = layer.to_StandardOpaqueMaterial.get
58
+ hash[:is_specular] = false
59
+ # set reflectance properties from outermost layer
60
+ unless layer.solarReflectance.empty?
61
+ hash[:solar_reflectance] = layer.solarReflectance.get
62
+ end
63
+ unless layer.visibleReflectance.empty?
64
+ hash[:visible_reflectance] = layer.visibleReflectance
65
+ end
66
+ elsif layer.to_MasslessOpaqueMaterial.is_initialized
67
+ layer = layer.to_MasslessOpaqueMaterial.get
68
+ hash[:is_specular] = false
69
+ # set reflectance properties from outermost layer
70
+ unless layer.solarAbsorptance.empty?
71
+ hash[:solar_reflectance] = 1 - layer.solarAbsorptance.get
72
+ end
73
+ unless layer.visibleAbsorptance.empty?
74
+ hash[:visible_reflectance] = 1 - layer.visibleAbsorptance.get
75
+ end
76
+ end
77
+
78
+ hash
79
+ end
80
+
81
+ end # ShadeConstruction
82
+ end # Honeybee
@@ -0,0 +1,56 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/construction/window'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class WindowConstructionAbridged
37
+
38
+ def self.from_construction(construction)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'WindowConstructionAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = construction.nameString
44
+ hash[:materials] = []
45
+ # get construction layers
46
+ layers = construction.layers
47
+ layers.each do |layer|
48
+ name = layer.nameString
49
+ hash[:materials] << name
50
+ end
51
+
52
+ hash
53
+ end
54
+
55
+ end # WindowConstructionAbridged
56
+ end # Honeybee
@@ -71,7 +71,10 @@ module Honeybee
71
71
 
72
72
  construction = sub_surface.construction
73
73
  if !construction.empty?
74
- hash[:construction] = construction.get.nameString
74
+ constr_id = construction.get.nameString
75
+ unless $window_constructions[constr_id].nil?
76
+ hash[:construction] = constr_id
77
+ end
75
78
  end
76
79
 
77
80
  hash
@@ -71,7 +71,12 @@ module Honeybee
71
71
 
72
72
  construction = sub_surface.construction
73
73
  if !construction.empty?
74
- hash[:construction] = construction.get.nameString
74
+ constr_id = construction.get.nameString
75
+ if hash[:is_glass] && !$window_constructions[constr_id].nil?
76
+ hash[:construction] = constr_id
77
+ elsif !hash[:is_glass] && !$opaque_constructions[constr_id].nil?
78
+ hash[:construction] = constr_id
79
+ end
75
80
  end
76
81
 
77
82
  hash
@@ -73,7 +73,10 @@ module Honeybee
73
73
 
74
74
  construction = surface.construction
75
75
  if !construction.empty?
76
- hash[:construction] = construction.get.nameString
76
+ constr_id = construction.get.nameString
77
+ unless $opaque_constructions[constr_id].nil?
78
+ hash[:construction] = constr_id
79
+ end
77
80
  end
78
81
 
79
82
  hash
@@ -61,7 +61,13 @@ module Honeybee
61
61
 
62
62
  construction = shading_surface.construction
63
63
  if !construction.empty?
64
- hash[:construction] = construction.get.nameString
64
+ const_name = construction.get.nameString
65
+ hash[:construction] = const_name
66
+ unless $shade_constructions.has_key?(const_name)
67
+ const_obj = construction.get
68
+ const = const_obj.to_LayeredConstruction.get
69
+ $shade_constructions[const_name] = const
70
+ end
65
71
  end
66
72
 
67
73
  transmittance_schedule = shading_surface.transmittanceSchedule
@@ -42,18 +42,23 @@ module Honeybee
42
42
  # set hash values from OpenStudio Object
43
43
  hash[:identifier] = material.nameString
44
44
  hash[:r_value] = material.thermalResistance
45
- hash[:roughness] = material.roughness
46
- # check if boost optional object is empty
47
- unless material.thermalAbsorptance.empty?
48
- hash[:thermal_absorptance] = material.thermalAbsorptance.get
49
- end
50
- # check if boost optional object is empty
51
- unless material.solarAbsorptance.empty?
52
- hash[:solar_absorptance] = material.solarAbsorptance.get
53
- end
54
- # check if boost optional object is empty
55
- unless material.visibleAbsorptance.empty?
56
- hash[:visible_absorptance] = material.visibleAbsorptance.get
45
+
46
+ if material.to_MasslessOpaqueMaterial.is_initialized
47
+ # Roughness is a required property for OS MasslessOpaqueMaterial but isn't a listed
48
+ # property for OS AirGap
49
+ hash[:roughness] = material.roughness
50
+ # check if boost optional object is empty
51
+ unless material.thermalAbsorptance.empty?
52
+ hash[:thermal_absorptance] = material.thermalAbsorptance.get
53
+ end
54
+ # check if boost optional object is empty
55
+ unless material.solarAbsorptance.empty?
56
+ hash[:solar_absorptance] = material.solarAbsorptance.get
57
+ end
58
+ # check if boost optional object is empty
59
+ unless material.visibleAbsorptance.empty?
60
+ hash[:visible_absorptance] = material.visibleAbsorptance.get
61
+ end
57
62
  end
58
63
 
59
64
  hash
@@ -61,7 +61,7 @@ module Honeybee
61
61
  end
62
62
  # check if boost optional object is empty
63
63
  unless material.backSideVisibleReflectanceatNormalIncidence.empty?
64
- hash[:visible_reflectance_back] = material.backSideVisibleReflectanceatNormalIncidence
64
+ hash[:visible_reflectance_back] = material.backSideVisibleReflectanceatNormalIncidence.get
65
65
  end
66
66
  hash[:infrared_transmittance] = material.infraredTransmittance
67
67
  hash[:emissivity] = material.frontSideInfraredHemisphericalEmissivity
@@ -41,6 +41,10 @@ require 'from_openstudio/material/window_blind'
41
41
  require 'from_openstudio/material/window_gas'
42
42
  require 'from_openstudio/material/window_gas_custom'
43
43
  require 'from_openstudio/material/window_gas_mixture'
44
+ require 'from_openstudio/construction/air'
45
+ require 'from_openstudio/construction/opaque'
46
+ require 'from_openstudio/construction/window'
47
+ require 'from_openstudio/construction/shade'
44
48
 
45
49
  require 'openstudio'
46
50
 
@@ -57,6 +61,10 @@ module Honeybee
57
61
  hash[:tolerance] = 0.01
58
62
  hash[:angle_tolerance] = 1.0
59
63
 
64
+ # Hashes for all constructions in the model
65
+ $opaque_constructions = {}
66
+ $window_constructions = {}
67
+ $shade_constructions = {}
60
68
  hash[:properties] = properties_from_model(openstudio_model)
61
69
 
62
70
  rooms = rooms_from_model(openstudio_model)
@@ -65,6 +73,12 @@ module Honeybee
65
73
  orphaned_shades = orphaned_shades_from_model(openstudio_model)
66
74
  hash[:orphaned_shades] = orphaned_shades if !orphaned_shades.empty?
67
75
 
76
+ unless $shade_constructions.empty?
77
+ shade_constructions_from_model($shade_constructions).each do |shade_const|
78
+ hash[:properties][:energy][:constructions] << shade_const
79
+ end
80
+ end
81
+
68
82
  Model.new(hash)
69
83
  end
70
84
 
@@ -103,13 +117,17 @@ module Honeybee
103
117
  def self.properties_from_model(openstudio_model)
104
118
  hash = {}
105
119
  hash[:type] = 'ModelProperties'
120
+ hash[:energy] = energy_properties_from_model(openstudio_model)
106
121
  hash
107
122
  end
108
123
 
109
124
  def self.energy_properties_from_model(openstudio_model)
110
125
  hash = {}
111
126
  hash[:type] = 'ModelEnergyProperties'
112
- hash[:energy] = energy_properties_from_model(openstudio_model)
127
+ hash[:constructions] = []
128
+ hash[:constructions] = constructions_from_model(openstudio_model)
129
+ hash[:materials] = materials_from_model(openstudio_model)
130
+
113
131
  hash
114
132
  end
115
133
 
@@ -145,10 +163,17 @@ module Honeybee
145
163
  openstudio_model.getStandardOpaqueMaterials.each do |material|
146
164
  result << EnergyMaterial.from_material(material)
147
165
  end
148
- # Create HB EnergyMaterialNoMass from OpenStudio Material
166
+
167
+ # Create HB EnergyMaterialNoMass from OpenStudio MasslessOpaque Materials
149
168
  openstudio_model.getMasslessOpaqueMaterials.each do |material|
150
169
  result << EnergyMaterialNoMass.from_material(material)
151
170
  end
171
+
172
+ # Create HB EnergyMaterialNoMass from OpenStudio AirGap materials
173
+ openstudio_model.getAirGaps.each do|material|
174
+ result << EnergyMaterialNoMass.from_material(material)
175
+ end
176
+
152
177
  # Create HB WindowMaterialSimpleGlazSys from OpenStudio Material
153
178
  openstudio_model.getSimpleGlazings.each do |material|
154
179
  result << EnergyWindowMaterialSimpleGlazSys.from_material(material)
@@ -178,5 +203,51 @@ module Honeybee
178
203
  result
179
204
  end
180
205
 
206
+ # Create HB Construction from OpenStudio Materials
207
+ def self.constructions_from_model(openstudio_model)
208
+ result = []
209
+
210
+ # Create HB AirConstruction from OpenStudio Construction
211
+ openstudio_model.getConstructionAirBoundarys.each do |construction|
212
+ result << AirBoundaryConstructionAbridged.from_construction(construction)
213
+ end
214
+
215
+ # Create HB WindowConstruction from OpenStudio Construction
216
+ openstudio_model.getConstructions.each do |construction|
217
+ window_construction = false
218
+ opaque_construction = false
219
+ material = construction.layers[0]
220
+ unless material.nil?
221
+ if material.to_StandardGlazing.is_initialized or material.to_SimpleGlazing.is_initialized
222
+ window_construction = true
223
+ elsif material.to_StandardOpaqueMaterial.is_initialized or material.to_MasslessOpaqueMaterial.is_initialized
224
+ opaque_construction = true
225
+ end
226
+ if window_construction == true
227
+ constr_hash = WindowConstructionAbridged.from_construction(construction)
228
+ $window_constructions[constr_hash[:identifier]] = constr_hash
229
+ result << constr_hash
230
+ end
231
+ if opaque_construction == true
232
+ constr_hash = OpaqueConstructionAbridged.from_construction(construction)
233
+ $opaque_constructions[constr_hash[:identifier]] = constr_hash
234
+ result << constr_hash
235
+ end
236
+ end
237
+ end
238
+
239
+ result
240
+ end
241
+
242
+ def self.shade_constructions_from_model(shade_constructions)
243
+ result = []
244
+
245
+ shade_constructions.each do |key, value|
246
+ result << ShadeConstruction.from_construction(value)
247
+ end
248
+
249
+ result
250
+ end
251
+
181
252
  end # Model
182
253
  end # Honeybee