honeybee-openstudio 2.17.3 → 2.19.0

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: 39d9e9597fdf88414ece518ccfb002ef476a41aacebac51cce4cdacddb95996c
4
- data.tar.gz: a28ad4c5138992496d483c63bf57d251f0255434e851f99beb736ba2520c47a5
3
+ metadata.gz: 7f21b28938ef8a323d4777fe9ba4b8533c9b0eb974cc540087774800bf6e8c52
4
+ data.tar.gz: 64f4566ac4f67fafb0a36288e70c74a9e01103c7e0777e28ec315a548a55c019
5
5
  SHA512:
6
- metadata.gz: 6b04294c1ec03887c6be0e0ccf356b2d8f9afb2bfa30b5c26e7061ee61a8d7f31da9cdb4b3314da9414cab578eeac8e78c04c131bc7c4f04f1f52dbf654f31db
7
- data.tar.gz: 0d3a9111ab3ab8956dcedd438223b8f9bf7666d298325713da5d1bc8a03ba5bcd9ee4dac6d88f1d8adf6408e8330de2d54bbcd128ddc8020f30bbff10efc2717
6
+ metadata.gz: 666da49e5e041b1774b07b05a9b62105d0cb1cbf4d2aae714e60b26f042ff302382bccb0022f0d69a39d8d6100714eaa9f71f3381371a6eb9f325c81f56f2d51
7
+ data.tar.gz: 95e9649bdea4f2be63d184daf4a5dc45b406d97049fddcf6f59bcf4f7a4eafcfaaf866d505374d6ebcde974b598f701005ef36b462b2af32b351420c00f65e83
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.3'
7
+ spec.version = '2.19.0'
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
@@ -108,7 +111,7 @@ module Honeybee
108
111
 
109
112
  def self.boundary_condition_from_surface(surface)
110
113
  result = {}
111
- surface_type = surface.surfaceType
114
+ surface_bc = surface.outsideBoundaryCondition
112
115
  adjacent_surface = surface.adjacentSurface
113
116
  if !adjacent_surface.empty?
114
117
  adjacent_space = clean_identifier(adjacent_surface.get.space.get.nameString)
@@ -116,7 +119,7 @@ module Honeybee
116
119
  result = {type: 'Surface', boundary_condition_objects: [adjacent_surface, adjacent_space]}
117
120
  elsif surface.isGroundSurface
118
121
  result = {type: 'Ground'}
119
- elsif surface_type == 'Adiabatic'
122
+ elsif surface_bc == 'Adiabatic'
120
123
  result = {type: 'Adiabatic'}
121
124
  else
122
125
  sun_exposure = (surface.sunExposure == 'SunExposed')
@@ -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
@@ -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