honeybee-openstudio 2.29.0 → 2.30.0

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: 36e1a63a690e85c6c22baf31da94ff11ab277de6d30b274a1454dab2ca11d87f
4
- data.tar.gz: df1209e056ddbb6cbfa1401f15c3332d3e5316553e4593541c5db3c20e5b9448
3
+ metadata.gz: e61c104adc3d8f346115f29cfdc29e268a8668ba11d5bf3e44fdd054f75f95ba
4
+ data.tar.gz: 1d9b02e466124bbf3c72bb15e54308146ad0076d7e98339929fddac8d3018200
5
5
  SHA512:
6
- metadata.gz: 647b3b5ad803b8248b4234cbdb4f31669092adae8c7d7244f68804a73853777ecb97b0028d09fd495f05811e6e7aadb71248d310d4b4cdab46fec860a2127398
7
- data.tar.gz: 3225c1675846d452a31da177533a34d7daa9fbf07a15b0ba2dbd4abb7c139a3e491d3c45658518c0e27c983678a083c70fe4718e16c7361ef94334cca8144a65
6
+ metadata.gz: cdf371172756c14205799e1a476517c64587a261e4331828ddce046082d256e70511ab00cb50275f35ee080deb44f1ce4a7f35bb8a04e21bf8fe94a805c21888
7
+ data.tar.gz: a76dff993fb5fc51ea9d11d1999553d2f8a43fd107cb17864a6c8dc8ceac9999ca00d64b68d0f51261a70e91991952b5fda794d168f98f4f0470a6767dc680e2
@@ -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.29.0'
7
+ spec.version = '2.30.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
 
@@ -40,7 +40,9 @@ module Honeybee
40
40
  hash = {}
41
41
  hash[:type] = 'Door'
42
42
  hash[:identifier] = clean_identifier(sub_surface.nameString)
43
- hash[:display_name] = clean_name(sub_surface.nameString)
43
+ unless sub_surface.displayName.empty?
44
+ hash[:display_name] = (sub_surface.displayName.get).force_encoding("UTF-8")
45
+ end
44
46
  hash[:user_data] = {handle: sub_surface.handle.to_s}
45
47
  hash[:properties] = properties_from_sub_surface(sub_surface)
46
48
  hash[:geometry] = geometry_from_sub_surface(sub_surface, site_transformation)
@@ -38,7 +38,9 @@ module Honeybee
38
38
  hash = {}
39
39
  hash[:type] = 'Face'
40
40
  hash[:identifier] = clean_identifier(surface.nameString)
41
- hash[:display_name] = clean_name(surface.nameString)
41
+ unless surface.displayName.empty?
42
+ hash[:display_name] = (surface.displayName.get).force_encoding("UTF-8")
43
+ end
42
44
  hash[:user_data] = {handle: surface.handle.to_s}
43
45
  hash[:properties] = properties_from_surface(surface)
44
46
  hash[:geometry] = geometry_from_surface(surface, site_transformation)
@@ -38,7 +38,9 @@ module Honeybee
38
38
  hash = {}
39
39
  hash[:type] = 'Room'
40
40
  hash[:identifier] = clean_identifier(space.nameString)
41
- hash[:display_name] = clean_name(space.nameString)
41
+ unless space.displayName.empty?
42
+ hash[:display_name] = (space.displayName.get).force_encoding("UTF-8")
43
+ end
42
44
  hash[:user_data] = {space: space.handle.to_s}
43
45
  hash[:properties] = properties_from_space(space)
44
46
 
@@ -88,7 +90,7 @@ module Honeybee
88
90
  # Check if schedule exists and is of the correct type
89
91
  if !people_def.peopleperSpaceFloorArea.empty? && !people.numberofPeopleSchedule.empty?
90
92
  sch = people.numberofPeopleSchedule.get
91
- if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
93
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
92
94
  hash[:people] = Honeybee::PeopleAbridged.from_load(people)
93
95
  break
94
96
  end
@@ -102,7 +104,7 @@ module Honeybee
102
104
  # Check if schedule exists and is of the correct type
103
105
  if !light_def.wattsperSpaceFloorArea.empty? && !light.schedule.empty?
104
106
  sch = light.schedule.get
105
- if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
107
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
106
108
  hash[:lighting] = Honeybee::LightingAbridged.from_load(light)
107
109
  break
108
110
  end
@@ -116,7 +118,7 @@ module Honeybee
116
118
  # Check if schedule exists and is of the correct type
117
119
  if !electric_eq_def.wattsperSpaceFloorArea.empty? && !electric_eq.schedule.empty?
118
120
  sch = electric_eq.schedule.get
119
- if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
121
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
120
122
  hash[:electric_equipment] = Honeybee::ElectricEquipmentAbridged.from_load(electric_eq)
121
123
  break
122
124
  end
@@ -130,7 +132,7 @@ module Honeybee
130
132
  # Check if schedule exists and is of the correct type
131
133
  if !gas_eq_def.wattsperSpaceFloorArea.empty? && !gas_eq.schedule.empty?
132
134
  sch = gas_eq.schedule.get
133
- if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
135
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
134
136
  hash[:gas_equipment] = Honeybee::GasEquipmentAbridged.from_load(gas_eq)
135
137
  break
136
138
  end
@@ -140,8 +142,12 @@ module Honeybee
140
142
  unless space.otherEquipment.empty?
141
143
  hash[:process_loads] = []
142
144
  space.otherEquipment.each do |other_eq|
143
- unless other_eq.designLevel.empty?
144
- hash[:process_loads] << Honeybee::ProcessAbridged.from_load(other_eq)
145
+ other_eq_def = other_eq.otherEquipmentDefinition
146
+ if !other_eq_def.designLevel.empty? && !other_eq.schedule.empty?
147
+ sch = other_eq.schedule.get
148
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
149
+ hash[:process_loads] << Honeybee::ProcessAbridged.from_load(other_eq)
150
+ end
145
151
  end
146
152
  end
147
153
  end
@@ -151,7 +157,7 @@ module Honeybee
151
157
  # Check if schedule exists and is of the correct type
152
158
  if !infiltration.flowperExteriorSurfaceArea.empty? && !infiltration.schedule.empty?
153
159
  sch = infiltration.schedule.get
154
- if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
160
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
155
161
  hash[:infiltration] = Honeybee::InfiltrationAbridged.from_load(infiltration)
156
162
  break
157
163
  end
@@ -169,9 +175,14 @@ module Honeybee
169
175
  thermal_zone = space.thermalZone.get
170
176
  unless thermal_zone.thermostatSetpointDualSetpoint.empty?
171
177
  hash[:setpoint] = {}
178
+ hash[:setpoint][:type] = 'SetpointAbridged'
172
179
  thermostat = thermal_zone.thermostatSetpointDualSetpoint.get
173
180
  hash[:setpoint][:identifier] = thermostat.nameString
174
- if thermostat.heatingSetpointTemperatureSchedule.empty?
181
+ unless thermostat.displayName.empty?
182
+ hash[:display_name] = (thermostat.displayName.get).force_encoding("UTF-8")
183
+ end
184
+ sch = thermostat.heatingSetpointTemperatureSchedule
185
+ if sch.empty? or !sch.get.to_ScheduleRuleset.is_initialized
175
186
  # if heating setpoint schedule is not specified create a new setpoint schedule and assign to HB thermostat object.
176
187
  # first check if schedule is already created
177
188
  if $heating_setpoint_schedule.nil?
@@ -182,16 +193,17 @@ module Honeybee
182
193
  openstudio_sch_type_lim.setName('Temperature')
183
194
  openstudio_sch_type_lim.setNumericType('Temperature')
184
195
  openstudio_schedule.defaultDaySchedule.setName('Heating Day Default')
185
- openstudio_schedule.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), 100)
196
+ openstudio_schedule.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), -100)
186
197
  openstudio_schedule.defaultDaySchedule.setScheduleTypeLimits(openstudio_sch_type_lim)
187
198
  $heating_setpoint_schedule = Honeybee::ScheduleRulesetAbridged.from_schedule_ruleset(openstudio_schedule)
188
199
  end
189
200
  hash[:setpoint][:heating_schedule] = $heating_setpoint_schedule[:identifier]
190
201
  else
191
- heating_schedule = thermostat.heatingSetpointTemperatureSchedule.get
202
+ heating_schedule = sch.get
192
203
  hash[:setpoint][:heating_schedule] = heating_schedule.nameString
193
204
  end
194
- if thermostat.coolingSetpointTemperatureSchedule.empty?
205
+ sch = thermostat.coolingSetpointTemperatureSchedule
206
+ if sch.empty? or !sch.get.to_ScheduleRuleset.is_initialized
195
207
  # if cooling setpoint schedule is not specified create a new setpoint schedule and assign to HB thermostat object
196
208
  # first check if schedule is already created
197
209
  if $cooling_setpoint_schedule.nil?
@@ -202,25 +214,29 @@ module Honeybee
202
214
  openstudio_sch_type_lim.setName('Temperature')
203
215
  openstudio_sch_type_lim.setNumericType('Temperature')
204
216
  openstudio_schedule.defaultDaySchedule.setName('Cooling Day Default')
205
- openstudio_schedule.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), -100)
217
+ openstudio_schedule.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), 100)
206
218
  openstudio_schedule.defaultDaySchedule.setScheduleTypeLimits(openstudio_sch_type_lim)
207
219
  $cooling_setpoint_schedule = Honeybee::ScheduleRulesetAbridged.from_schedule_ruleset(openstudio_schedule)
208
220
  end
209
221
  hash[:setpoint][:cooling_schedule] = $cooling_setpoint_schedule[:identifier]
210
222
  else
211
- cooling_schedule = thermostat.coolingSetpointTemperatureSchedule.get
223
+ cooling_schedule = sch.get
212
224
  hash[:setpoint][:cooling_schedule] = cooling_schedule.nameString
213
225
  end
214
226
  end
215
227
  unless thermal_zone.zoneControlHumidistat.empty?
216
228
  humidistat = thermal_zone.zoneControlHumidistat.get
217
229
  unless humidistat.humidifyingRelativeHumiditySetpointSchedule.empty?
218
- humidifying_schedule = humidistat.humidifyingRelativeHumiditySetpointSchedule.get
219
- hash[:setpoint][:humidifying_schedule] = humidifying_schedule.nameString
230
+ sch = humidistat.humidifyingRelativeHumiditySetpointSchedule.get
231
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
232
+ hash[:setpoint][:humidifying_schedule] = sch.nameString
233
+ end
220
234
  end
221
235
  unless humidistat.dehumidifyingRelativeHumiditySetpointSchedule.empty?
222
- dehumidifying_schedule = humidistat.dehumidifyingRelativeHumiditySetpointSchedule.get
223
- hash[:setpoint][:dehumidifying_schedule] = dehumidifying_schedule.nameString
236
+ sch = humidistat.dehumidifyingRelativeHumiditySetpointSchedule.get
237
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
238
+ hash[:setpoint][:dehumidifying_schedule] = sch.nameString
239
+ end
224
240
  end
225
241
  end
226
242
  end
@@ -40,7 +40,9 @@ module Honeybee
40
40
  hash = {}
41
41
  hash[:type] = 'Shade'
42
42
  hash[:identifier] = clean_identifier(shading_surface.nameString)
43
- hash[:display_name] = clean_name(shading_surface.nameString)
43
+ unless shading_surface.displayName.empty?
44
+ hash[:display_name] = (shading_surface.displayName.get).force_encoding("UTF-8")
45
+ end
44
46
  hash[:user_data] = {handle: shading_surface.handle.to_s}
45
47
  hash[:properties] = properties_from_shading_surface(shading_surface)
46
48
  hash[:geometry] = geometry_from_shading_surface(shading_surface, site_transformation)
@@ -46,9 +46,7 @@ module Honeybee
46
46
  end
47
47
  unless load.schedule.empty?
48
48
  schedule = load.schedule.get
49
- if schedule.to_ScheduleFixedInterval.is_initialized or schedule.to_ScheduleRuleset.is_initialized
50
- hash[:schedule] = schedule.nameString
51
- end
49
+ hash[:schedule] = schedule.nameString
52
50
  end
53
51
  load_def = load.electricEquipmentDefinition
54
52
  unless load_def.wattsperSpaceFloorArea.empty?
@@ -43,9 +43,7 @@ module Honeybee
43
43
  hash[:identifier] = clean_name(load.nameString)
44
44
  unless load.schedule.empty?
45
45
  schedule = load.schedule.get
46
- if schedule.to_ScheduleFixedInterval.is_initialized or schedule.to_ScheduleRuleset.is_initialized
47
- hash[:schedule] = schedule.nameString
48
- end
46
+ hash[:schedule] = schedule.nameString
49
47
  end
50
48
  load_def = load.gasEquipmentDefinition
51
49
  unless load_def.wattsperSpaceFloorArea.empty?
@@ -38,7 +38,7 @@ module Honeybee
38
38
  def self.from_load(load)
39
39
  # create an empty hash
40
40
  hash = {}
41
- hash[:type] = 'InfiltrationaAridged'
41
+ hash[:type] = 'InfiltrationAbridged'
42
42
  # set hash values from OpenStudio Object
43
43
  hash[:identifier] = clean_name(load.nameString)
44
44
  unless load.displayName.empty?
@@ -47,9 +47,7 @@ module Honeybee
47
47
  hash[:flow_per_exterior_area] = load.flowperExteriorSurfaceArea.get
48
48
  unless load.schedule.empty?
49
49
  schedule = load.schedule.get
50
- if schedule.to_ScheduleFixedInterval.is_initialized or schedule.to_ScheduleRuleset.is_initialized
51
- hash[:schedule] = schedule.nameString
52
- end
50
+ hash[:schedule] = schedule.nameString
53
51
  end
54
52
  hash[:constant_coefficient] = load.constantTermCoefficient
55
53
  hash[:temperature_coefficient] = load.temperatureTermCoefficient
@@ -46,9 +46,7 @@ module Honeybee
46
46
  end
47
47
  unless load.schedule.empty?
48
48
  schedule = load.schedule.get
49
- if schedule.to_ScheduleFixedInterval.is_initialized or schedule.to_ScheduleRuleset.is_initialized
50
- hash[:schedule] = schedule.nameString
51
- end
49
+ hash[:schedule] = schedule.nameString
52
50
  end
53
51
  loads_def = load.lightsDefinition
54
52
  unless loads_def.wattsperSpaceFloorArea.empty?
@@ -48,15 +48,11 @@ module Honeybee
48
48
  #in OS
49
49
  unless load.numberofPeopleSchedule.empty?
50
50
  schedule = load.numberofPeopleSchedule.get
51
- if schedule.to_ScheduleFixedInterval.is_initialized or schedule.to_ScheduleRuleset.is_initialized
52
- hash[:occupancy_schedule] = schedule.nameString
53
- end
51
+ hash[:occupancy_schedule] = schedule.nameString
54
52
  end
55
53
  unless load.activityLevelSchedule.empty?
56
54
  schedule = load.activityLevelSchedule.get
57
- if schedule.to_ScheduleFixedInterval.is_initialized or schedule.to_ScheduleRuleset.is_initialized
58
- hash[:activity_schedule] = schedule.nameString
59
- end
55
+ hash[:activity_schedule] = schedule.nameString
60
56
  end
61
57
  load_def = load.peopleDefinition
62
58
  unless load_def.peopleperSpaceFloorArea.empty?
@@ -66,7 +62,7 @@ module Honeybee
66
62
  unless load_def.isSensibleHeatFractionAutocalculated
67
63
  sensible_fraction = load_def.sensibleHeatFraction
68
64
  unless sensible_fraction.empty
69
- hash[:latent_fraction] = 1 - load_def.sensibleHeatFraction.get
65
+ hash[:latent_fraction] = 1 - sensible_fraction.get
70
66
  end
71
67
  end
72
68
  hash
@@ -45,9 +45,11 @@ module Honeybee
45
45
  unless load_def.displayName.empty?
46
46
  hash[:display_name] = (load_def.displayName.get).force_encoding("UTF-8")
47
47
  end
48
- hash[:watts] = load_def.getDesignLevel
49
- schedule = load.schedule
50
- if schedule.to_ScheduleFixedInterval.is_initialized or schedule.to_ScheduleRuleset.is_initialized
48
+ unless load_def.designLevel.empty?
49
+ hash[:watts] = load_def.designLevel.get
50
+ end
51
+ unless load.schedule.empty?
52
+ schedule = load.schedule.get
51
53
  hash[:schedule] = schedule.nameString
52
54
  end
53
55
  hash[:end_use_category] = load.endUseSubcategory
@@ -46,10 +46,9 @@ module Honeybee
46
46
  hash[:flow_per_person] = load.outdoorAirFlowperPerson
47
47
  hash[:flow_per_area] = load.outdoorAirFlowperFloorArea
48
48
  unless load.outdoorAirFlowRateFractionSchedule.empty?
49
- sch = load.outdoorAirFlowRateFractionSchedule.get.scheduleTypeLimits.get.unitType
50
- # Check if the schedule type is correct
51
- if sch == 'Fractional'
52
- hash[:schedule] = load.name
49
+ sch = load.outdoorAirFlowRateFractionSchedule.get
50
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
51
+ hash[:schedule] = sch.nameString
53
52
  end
54
53
  end
55
54
 
@@ -0,0 +1,89 @@
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/material/vegetation'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class EnergyMaterialVegetation < ModelObject
37
+
38
+ def self.from_material(material)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'EnergyMaterialVegetation'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = clean_name(material.nameString)
44
+ unless material.displayName.empty?
45
+ hash[:display_name] = (material.displayName.get).force_encoding("UTF-8")
46
+ end
47
+ hash[:thickness] = material.thickness
48
+ hash[:conductivity] = material.conductivityofDrySoil
49
+ hash[:density] = material.densityofDrySoil
50
+ hash[:specific_heat] = material.specificHeatofDrySoil
51
+ hash[:plant_height] = material.heightofPlants
52
+ hash[:leaf_area_index] = material.leafAreaIndex
53
+ hash[:leaf_reflectivity] = material.leafReflectivity
54
+ hash[:leaf_emissivity] = material.leafEmissivity
55
+ hash[:min_stomatal_resist] = material.minimumStomatalResistance
56
+ hash[:sat_vol_moist_cont] = material.saturationVolumetricMoistureContent
57
+ hash[:residual_vol_moist_cont] = material.residualVolumetricMoistureContent
58
+ hash[:init_vol_moist_cont] = material.initialVolumetricMoistureContent
59
+ hash[:moist_diff_model] = material.moistureDiffusionCalculationMethod.titleize
60
+ case material.roughness.downcase
61
+ when 'veryrough'
62
+ hash[:roughness] == 'VeryRough'
63
+ when 'mediumrough'
64
+ hash[:roughness] == 'MediumRough'
65
+ when 'mediumsmooth'
66
+ hash[:roughness] == 'MediumSmooth'
67
+ when 'verysmooth'
68
+ hash[:roughness] == 'VerySmooth'
69
+ # In case of Rough or Smooth
70
+ else
71
+ hash[:roughness] = material.roughness.titleize
72
+ end
73
+
74
+ # assign the optional properties
75
+ unless material.thermalAbsorptance.empty?
76
+ hash[:soil_thermal_absorptance] = material.thermalAbsorptance.get
77
+ end
78
+ unless material.solarAbsorptance.empty?
79
+ hash[:soil_solar_absorptance] = material.solarAbsorptance.get
80
+ end
81
+ unless material.visibleAbsorptance.empty?
82
+ hash[:soil_visible_absorptance] = material.visibleAbsorptance.get
83
+ end
84
+
85
+ hash
86
+ end
87
+
88
+ end # EnergyMaterialVegetation
89
+ end # Honeybee
@@ -31,26 +31,6 @@
31
31
 
32
32
  require 'honeybee/model'
33
33
 
34
- require 'from_openstudio/geometry/room'
35
- require 'from_openstudio/geometry/shade'
36
- require 'from_openstudio/material/opaque'
37
- require 'from_openstudio/material/opaque_no_mass'
38
- require 'from_openstudio/material/window_simpleglazsys'
39
- require 'from_openstudio/material/window_glazing'
40
- require 'from_openstudio/material/window_blind'
41
- require 'from_openstudio/material/window_gas'
42
- require 'from_openstudio/material/window_gas_custom'
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'
48
- require 'from_openstudio/construction_set'
49
- require 'from_openstudio/schedule/type_limit'
50
- require 'from_openstudio/schedule/ruleset'
51
- require 'from_openstudio/schedule/fixed_interval'
52
- require 'from_openstudio/program_type'
53
-
54
34
  require 'openstudio'
55
35
 
56
36
  module Honeybee
@@ -188,6 +168,11 @@ module Honeybee
188
168
  result << EnergyMaterialNoMass.from_material(material)
189
169
  end
190
170
 
171
+ # Create HB EnergyMaterialVegetation from OpenStudio RoofVegetation Materials
172
+ openstudio_model.getRoofVegetations.each do |material|
173
+ result << EnergyMaterialVegetation.from_material(material)
174
+ end
175
+
191
176
  # Create HB EnergyMaterialNoMass from OpenStudio AirGap materials
192
177
  openstudio_model.getAirGaps.each do|material|
193
178
  result << EnergyMaterialNoMass.from_material(material)
@@ -239,7 +224,7 @@ module Honeybee
239
224
  unless material.nil?
240
225
  if material.to_StandardGlazing.is_initialized or material.to_SimpleGlazing.is_initialized
241
226
  window_construction = true
242
- elsif material.to_StandardOpaqueMaterial.is_initialized or material.to_MasslessOpaqueMaterial.is_initialized
227
+ elsif material.to_StandardOpaqueMaterial.is_initialized or material.to_MasslessOpaqueMaterial.is_initialized or material.to_RoofVegetation.is_initialized
243
228
  opaque_construction = true
244
229
  end
245
230
  if window_construction == true
@@ -51,7 +51,7 @@ module Honeybee
51
51
  # Check if schedule exists and is of the correct type
52
52
  if !people_def.peopleperSpaceFloorArea.empty? && !people.numberofPeopleSchedule.empty?
53
53
  sch = people.numberofPeopleSchedule.get
54
- if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
54
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
55
55
  hash[:people] = Honeybee::PeopleAbridged.from_load(people)
56
56
  break
57
57
  end
@@ -65,7 +65,7 @@ module Honeybee
65
65
  # Check if schedule exists and is of the correct type
66
66
  if !light_def.wattsperSpaceFloorArea.empty? && !light.schedule.empty?
67
67
  sch = light.schedule.get
68
- if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
68
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
69
69
  hash[:lighting] = Honeybee::LightingAbridged.from_load(light)
70
70
  break
71
71
  end
@@ -79,7 +79,7 @@ module Honeybee
79
79
  # Check if schedule exists and is of the correct type
80
80
  if !electric_eq_def.wattsperSpaceFloorArea.empty? && !electric_eq.schedule.empty?
81
81
  sch = electric_eq.schedule.get
82
- if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
82
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
83
83
  hash[:electric_equipment] = Honeybee::ElectricEquipmentAbridged.from_load(electric_eq)
84
84
  break
85
85
  end
@@ -93,7 +93,7 @@ module Honeybee
93
93
  # Check if schedule exists and is of the correct type
94
94
  if !gas_eq_def.wattsperSpaceFloorArea.empty? && !gas_eq.schedule.empty?
95
95
  sch = gas_eq.schedule.get
96
- if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
96
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
97
97
  hash[:gas_equipment] = Honeybee::GasEquipmentAbridged.from_load(gas_eq)
98
98
  break
99
99
  end
@@ -106,7 +106,7 @@ module Honeybee
106
106
  # Check if schedule exists and is of the correct type
107
107
  if !infiltration.flowperExteriorSurfaceArea.empty? && !infiltration.schedule.empty?
108
108
  sch = infiltration.schedule.get
109
- if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
109
+ if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
110
110
  hash[:infiltration] = Honeybee::InfiltrationAbridged.from_load(infiltration)
111
111
  break
112
112
  end
@@ -53,6 +53,7 @@ require 'from_openstudio/construction/air'
53
53
  # import the material objects
54
54
  require 'from_openstudio/material/opaque'
55
55
  require 'from_openstudio/material/opaque_no_mass'
56
+ require 'from_openstudio/material/vegetation'
56
57
  require 'from_openstudio/material/window_gas'
57
58
  require 'from_openstudio/material/window_gas_mixture'
58
59
  require 'from_openstudio/material/window_gas_custom'
@@ -3,7 +3,7 @@
3
3
  "servers": [],
4
4
  "info": {
5
5
  "description": "Honeybee model schema.",
6
- "version": "1.46.1",
6
+ "version": "1.47.2",
7
7
  "title": "Honeybee Model Schema",
8
8
  "contact": {
9
9
  "name": "Ladybug Tools",
@@ -209,6 +209,11 @@
209
209
  "x-displayName": "EnergyMaterialNoMass",
210
210
  "description": "<SchemaDefinition schemaRef=\"#/components/schemas/EnergyMaterialNoMass\" />\n"
211
211
  },
212
+ {
213
+ "name": "energymaterialvegetation_model",
214
+ "x-displayName": "EnergyMaterialVegetation",
215
+ "description": "<SchemaDefinition schemaRef=\"#/components/schemas/EnergyMaterialVegetation\" />\n"
216
+ },
212
217
  {
213
218
  "name": "energywindowmaterialblind_model",
214
219
  "x-displayName": "EnergyWindowMaterialBlind",
@@ -469,6 +474,11 @@
469
474
  "x-displayName": "ModifierSetAbridged",
470
475
  "description": "<SchemaDefinition schemaRef=\"#/components/schemas/ModifierSetAbridged\" />\n"
471
476
  },
477
+ {
478
+ "name": "moisturediffusionmodel_model",
479
+ "x-displayName": "MoistureDiffusionModel",
480
+ "description": "<SchemaDefinition schemaRef=\"#/components/schemas/MoistureDiffusionModel\" />\n"
481
+ },
472
482
  {
473
483
  "name": "nolimit_model",
474
484
  "x-displayName": "NoLimit",
@@ -971,6 +981,7 @@
971
981
  "electricequipmentabridged_model",
972
982
  "energymaterial_model",
973
983
  "energymaterialnomass_model",
984
+ "energymaterialvegetation_model",
974
985
  "energywindowmaterialblind_model",
975
986
  "energywindowmaterialgas_model",
976
987
  "energywindowmaterialgascustom_model",
@@ -1023,6 +1034,7 @@
1023
1034
  "modelradianceproperties_model",
1024
1035
  "modifierset_model",
1025
1036
  "modifiersetabridged_model",
1037
+ "moisturediffusionmodel_model",
1026
1038
  "nolimit_model",
1027
1039
  "opaqueconstruction_model",
1028
1040
  "opaqueconstructionabridged_model",
@@ -1641,6 +1653,7 @@
1641
1653
  "flow_coefficient_closed": {
1642
1654
  "title": "Flow Coefficient Closed",
1643
1655
  "description": "An optional number in kg/s-m, at 1 Pa per meter of crack length, used to calculate the mass flow rate when the opening is closed; required to run an AirflowNetwork simulation. The DesignBuilder Cracks template defines the flow coefficient for a tight, low-leakage closed external window to be 0.00001, and the flow coefficient for a very poor, high-leakage closed external window to be 0.003.",
1656
+ "default": 0,
1644
1657
  "minimum": 0,
1645
1658
  "type": "number",
1646
1659
  "format": "double"
@@ -4959,7 +4972,7 @@
4959
4972
  },
4960
4973
  "air_boundary_construction": {
4961
4974
  "title": "Air Boundary Construction",
4962
- "description": "The identifier of an AirBoundaryConstruction to set the properties of Faces with an AirBoundary type.",
4975
+ "description": "The identifier of an AirBoundaryConstruction or OpaqueConstruction to set the properties of Faces with an AirBoundary type.",
4963
4976
  "maxLength": 100,
4964
4977
  "minLength": 1,
4965
4978
  "type": "string"
@@ -4970,6 +4983,199 @@
4970
4983
  ],
4971
4984
  "additionalProperties": false
4972
4985
  },
4986
+ "MoistureDiffusionModel": {
4987
+ "title": "MoistureDiffusionModel",
4988
+ "description": "Acceptable values for the moisture diffusion model for vegetation.",
4989
+ "enum": [
4990
+ "Simple",
4991
+ "Advanced"
4992
+ ],
4993
+ "type": "string"
4994
+ },
4995
+ "EnergyMaterialVegetation": {
4996
+ "title": "EnergyMaterialVegetation",
4997
+ "description": "Material representing vegetation on the exterior of an opaque construction.",
4998
+ "type": "object",
4999
+ "properties": {
5000
+ "identifier": {
5001
+ "title": "Identifier",
5002
+ "description": "Text string for a unique object ID. This identifier remains constant as the object is mutated, copied, and serialized to different formats (eg. dict, idf, osm). This identifier is also used to reference the object across a Model. It must be < 100 characters, use only ASCII characters and exclude (, ; ! \\n \\t).",
5003
+ "maxLength": 100,
5004
+ "minLength": 1,
5005
+ "pattern": "^[^,;!\\n\\t]+$",
5006
+ "type": "string"
5007
+ },
5008
+ "display_name": {
5009
+ "title": "Display Name",
5010
+ "description": "Display name of the object with no character restrictions.",
5011
+ "type": "string"
5012
+ },
5013
+ "user_data": {
5014
+ "title": "User Data",
5015
+ "description": "Optional dictionary of user data associated with the object.All keys and values of this dictionary should be of a standard data type to ensure correct serialization of the object (eg. str, float, int, list).",
5016
+ "type": "object"
5017
+ },
5018
+ "type": {
5019
+ "title": "Type",
5020
+ "default": "EnergyMaterialVegetation",
5021
+ "pattern": "^EnergyMaterialVegetation$",
5022
+ "type": "string",
5023
+ "readOnly": true
5024
+ },
5025
+ "roughness": {
5026
+ "default": "MediumRough",
5027
+ "allOf": [
5028
+ {
5029
+ "$ref": "#/components/schemas/Roughness"
5030
+ }
5031
+ ]
5032
+ },
5033
+ "thickness": {
5034
+ "title": "Thickness",
5035
+ "description": "Thickness of the soil layer in meters.",
5036
+ "default": 0.1,
5037
+ "exclusiveMinimum": 0,
5038
+ "maximum": 3,
5039
+ "type": "number",
5040
+ "format": "double"
5041
+ },
5042
+ "conductivity": {
5043
+ "title": "Conductivity",
5044
+ "description": "Thermal conductivity of the dry soil in W/m-K.",
5045
+ "default": 0.35,
5046
+ "exclusiveMinimum": 0,
5047
+ "type": "number",
5048
+ "format": "double"
5049
+ },
5050
+ "density": {
5051
+ "title": "Density",
5052
+ "description": "Density of the dry soil in kg/m3.",
5053
+ "default": 1100,
5054
+ "exclusiveMinimum": 0,
5055
+ "type": "number",
5056
+ "format": "double"
5057
+ },
5058
+ "specific_heat": {
5059
+ "title": "Specific Heat",
5060
+ "description": "Specific heat of the dry soil in J/kg-K.",
5061
+ "default": 1200,
5062
+ "minimum": 100,
5063
+ "type": "number",
5064
+ "format": "double"
5065
+ },
5066
+ "soil_thermal_absorptance": {
5067
+ "title": "Soil Thermal Absorptance",
5068
+ "description": "Fraction of incident long wavelength radiation that is absorbed by the soil. Default: 0.9.",
5069
+ "default": 0.9,
5070
+ "exclusiveMinimum": 0,
5071
+ "maximum": 0.99999,
5072
+ "type": "number",
5073
+ "format": "double"
5074
+ },
5075
+ "soil_solar_absorptance": {
5076
+ "title": "Soil Solar Absorptance",
5077
+ "description": "Fraction of incident solar radiation absorbed by the soil. Default: 0.7.",
5078
+ "default": 0.7,
5079
+ "minimum": 0,
5080
+ "maximum": 1,
5081
+ "type": "number",
5082
+ "format": "double"
5083
+ },
5084
+ "soil_visible_absorptance": {
5085
+ "title": "Soil Visible Absorptance",
5086
+ "description": "Fraction of incident visible wavelength radiation absorbed by the material. Default: 0.7.",
5087
+ "default": 0.7,
5088
+ "minimum": 0,
5089
+ "maximum": 1,
5090
+ "type": "number",
5091
+ "format": "double"
5092
+ },
5093
+ "plant_height": {
5094
+ "title": "Plant Height",
5095
+ "description": "The height of plants in the vegetation in meters.",
5096
+ "default": 0.2,
5097
+ "minimum": 0.005,
5098
+ "maximum": 1.0,
5099
+ "type": "number",
5100
+ "format": "double"
5101
+ },
5102
+ "leaf_area_index": {
5103
+ "title": "Leaf Area Index",
5104
+ "description": "The projected leaf area per unit area of soil surface (aka. Leaf Area Index or LAI). Note that the fraction of vegetation cover is calculated directly from LAI using an empirical relation.",
5105
+ "default": 1.0,
5106
+ "minimum": 0.001,
5107
+ "maximum": 5.0,
5108
+ "type": "number",
5109
+ "format": "double"
5110
+ },
5111
+ "leaf_reflectivity": {
5112
+ "title": "Leaf Reflectivity",
5113
+ "description": "The fraction of incident solar radiation that is reflected by the leaf surfaces. Solar radiation includes the visible spectrum as well as infrared and ultraviolet wavelengths. Typical values are 0.18 to 0.25.",
5114
+ "default": 0.22,
5115
+ "minimum": 0.005,
5116
+ "maximum": 0.5,
5117
+ "type": "number",
5118
+ "format": "double"
5119
+ },
5120
+ "leaf_emissivity": {
5121
+ "title": "Leaf Emissivity",
5122
+ "description": "The ratio of thermal radiation emitted from leaf surfaces to that emitted by an ideal black body at the same temperature.",
5123
+ "default": 0.95,
5124
+ "minimum": 0.8,
5125
+ "maximum": 1.0,
5126
+ "type": "number",
5127
+ "format": "double"
5128
+ },
5129
+ "min_stomatal_resist": {
5130
+ "title": "Min Stomatal Resist",
5131
+ "description": "The resistance of the plants to moisture transport [s/m]. Plants with low values of stomatal resistance will result in higher evapotranspiration rates than plants with high resistance.",
5132
+ "default": 180,
5133
+ "minimum": 50,
5134
+ "maximum": 300,
5135
+ "type": "number",
5136
+ "format": "double"
5137
+ },
5138
+ "sat_vol_moist_cont": {
5139
+ "title": "Sat Vol Moist Cont",
5140
+ "description": "The saturation moisture content of the soil by volume.",
5141
+ "default": 0.3,
5142
+ "minimum": 0.1,
5143
+ "maximum": 0.5,
5144
+ "type": "number",
5145
+ "format": "double"
5146
+ },
5147
+ "residual_vol_moist_cont": {
5148
+ "title": "Residual Vol Moist Cont",
5149
+ "description": "The residual moisture content of the soil by volume.",
5150
+ "default": 0.01,
5151
+ "minimum": 0.01,
5152
+ "maximum": 0.1,
5153
+ "type": "number",
5154
+ "format": "double"
5155
+ },
5156
+ "init_vol_moist_cont": {
5157
+ "title": "Init Vol Moist Cont",
5158
+ "description": "The initial moisture content of the soil by volume.",
5159
+ "default": 0.01,
5160
+ "minimum": 0.05,
5161
+ "maximum": 0.5,
5162
+ "type": "number",
5163
+ "format": "double"
5164
+ },
5165
+ "moist_diff_model": {
5166
+ "default": "Simple",
5167
+ "allOf": [
5168
+ {
5169
+ "$ref": "#/components/schemas/MoistureDiffusionModel"
5170
+ }
5171
+ ]
5172
+ }
5173
+ },
5174
+ "required": [
5175
+ "identifier"
5176
+ ],
5177
+ "additionalProperties": false
5178
+ },
4973
5179
  "OpaqueConstruction": {
4974
5180
  "title": "OpaqueConstruction",
4975
5181
  "description": "Construction for opaque objects (Face, Shade, Door).",
@@ -4996,6 +5202,9 @@
4996
5202
  },
4997
5203
  {
4998
5204
  "$ref": "#/components/schemas/EnergyMaterialNoMass"
5205
+ },
5206
+ {
5207
+ "$ref": "#/components/schemas/EnergyMaterialVegetation"
4999
5208
  }
5000
5209
  ]
5001
5210
  }
@@ -6847,10 +7056,13 @@
6847
7056
  },
6848
7057
  "air_boundary_construction": {
6849
7058
  "title": "Air Boundary Construction",
6850
- "description": "An AirBoundaryConstruction to set the properties of Faces with an AirBoundary type.",
6851
- "allOf": [
7059
+ "description": "An AirBoundaryConstruction or OpaqueConstruction to set the properties of Faces with an AirBoundary type.",
7060
+ "anyOf": [
6852
7061
  {
6853
7062
  "$ref": "#/components/schemas/AirBoundaryConstruction"
7063
+ },
7064
+ {
7065
+ "$ref": "#/components/schemas/OpaqueConstruction"
6854
7066
  }
6855
7067
  ]
6856
7068
  }
@@ -10298,22 +10510,25 @@
10298
10510
  "$ref": "#/components/schemas/EnergyMaterialNoMass"
10299
10511
  },
10300
10512
  {
10301
- "$ref": "#/components/schemas/EnergyWindowMaterialGas"
10513
+ "$ref": "#/components/schemas/EnergyMaterialVegetation"
10302
10514
  },
10303
10515
  {
10304
- "$ref": "#/components/schemas/EnergyWindowMaterialGasCustom"
10516
+ "$ref": "#/components/schemas/EnergyWindowMaterialGlazing"
10305
10517
  },
10306
10518
  {
10307
- "$ref": "#/components/schemas/EnergyWindowMaterialGasMixture"
10519
+ "$ref": "#/components/schemas/EnergyWindowMaterialSimpleGlazSys"
10308
10520
  },
10309
10521
  {
10310
- "$ref": "#/components/schemas/EnergyWindowMaterialSimpleGlazSys"
10522
+ "$ref": "#/components/schemas/EnergyWindowMaterialGas"
10311
10523
  },
10312
10524
  {
10313
- "$ref": "#/components/schemas/EnergyWindowMaterialBlind"
10525
+ "$ref": "#/components/schemas/EnergyWindowMaterialGasMixture"
10314
10526
  },
10315
10527
  {
10316
- "$ref": "#/components/schemas/EnergyWindowMaterialGlazing"
10528
+ "$ref": "#/components/schemas/EnergyWindowMaterialGasCustom"
10529
+ },
10530
+ {
10531
+ "$ref": "#/components/schemas/EnergyWindowMaterialBlind"
10317
10532
  },
10318
10533
  {
10319
10534
  "$ref": "#/components/schemas/EnergyWindowMaterialShade"
@@ -13612,7 +13827,7 @@
13612
13827
  "version": {
13613
13828
  "title": "Version",
13614
13829
  "description": "Text string for the current version of the schema.",
13615
- "default": "1.46.1",
13830
+ "default": "1.47.2",
13616
13831
  "pattern": "([0-9]+)\\.([0-9]+)\\.([0-9]+)",
13617
13832
  "type": "string",
13618
13833
  "readOnly": true
@@ -0,0 +1,42 @@
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/model_object'
33
+
34
+ module Honeybee
35
+ class EnergyMaterialVegetation < ModelObject
36
+
37
+ def defaults
38
+ @@schema[:components][:schemas][:EnergyMaterialVegetation][:properties]
39
+ end
40
+
41
+ end # EnergyMaterialVegetation
42
+ end # Honeybee
data/lib/honeybee.rb CHANGED
@@ -60,6 +60,7 @@ require 'honeybee/construction/air'
60
60
  # import the material objects
61
61
  require 'honeybee/material/opaque'
62
62
  require 'honeybee/material/opaque_no_mass'
63
+ require 'honeybee/material/vegetation'
63
64
  require 'honeybee/material/window_gas'
64
65
  require 'honeybee/material/window_gas_mixture'
65
66
  require 'honeybee/material/window_gas_custom'
@@ -85,7 +85,11 @@ module Honeybee
85
85
  air_loops = openstudio_model.getAirLoopHVACs
86
86
  unless air_loops.length == $air_loop_count # check if any new loops were added
87
87
  $air_loop_count = air_loops.length
88
- os_air_terminal = zones[0].airLoopHVACTerminal
88
+ os_air_terminal = []
89
+ zones.each do |zon|
90
+ os_air_terminal = zon.airLoopHVACTerminal
91
+ break if !os_air_terminal.empty?
92
+ end
89
93
  unless os_air_terminal.empty?
90
94
  os_air_terminal = os_air_terminal.get
91
95
  os_air_loop_opt = os_air_terminal.airLoopHVAC
@@ -40,6 +40,10 @@ module Honeybee
40
40
 
41
41
  # create humidistat openstudio object
42
42
  os_humidistat = OpenStudio::Model::ZoneControlHumidistat.new(openstudio_model)
43
+ os_humidistat.setName(@hash[:identifier])
44
+ unless @hash[:display_name].nil?
45
+ os_humidistat.setDisplayName(@hash[:display_name])
46
+ end
43
47
 
44
48
  # assign humidifying schedule if it exists
45
49
  if @hash[:humidifying_schedule]
@@ -40,6 +40,10 @@ module Honeybee
40
40
 
41
41
  # create thermostat openstudio object
42
42
  os_thermostat = OpenStudio::Model::ThermostatSetpointDualSetpoint.new(openstudio_model)
43
+ os_thermostat.setName(@hash[:identifier])
44
+ unless @hash[:display_name].nil?
45
+ os_thermostat.setDisplayName(@hash[:display_name])
46
+ end
43
47
 
44
48
  # assign heating setpoint temperature schedule
45
49
  heat_sch = openstudio_model.getScheduleByName(@hash[:heating_schedule])
@@ -0,0 +1,176 @@
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/material/vegetation'
33
+
34
+ require 'to_openstudio/model_object'
35
+
36
+ module Honeybee
37
+ class EnergyMaterialVegetation < ModelObject
38
+
39
+ def find_existing_openstudio_object(openstudio_model)
40
+ object = openstudio_model.getRoofVegetationByName(@hash[:identifier])
41
+ return object.get if object.is_initialized
42
+ nil
43
+ end
44
+
45
+ def to_openstudio(openstudio_model)
46
+ # create standard opaque OpenStudio material
47
+ os_veg_mat = OpenStudio::Model::RoofVegetation.new(openstudio_model)
48
+ os_veg_mat.setName(@hash[:identifier])
49
+ unless @hash[:display_name].nil?
50
+ os_veg_mat.setDisplayName(@hash[:display_name])
51
+ end
52
+ os_veg_mat.setSoilLayerName(@hash[:identifier] + '{}_SoilLayer')
53
+
54
+ # assign thickness if it exists
55
+ if @hash[:thickness]
56
+ os_veg_mat.setThickness(@hash[:thickness])
57
+ else
58
+ os_veg_mat.setThickness(defaults[:thickness][:default])
59
+ end
60
+
61
+ # assign conductivity if it exists
62
+ if @hash[:conductivity]
63
+ os_veg_mat.setConductivityofDrySoil(@hash[:conductivity])
64
+ else
65
+ os_veg_mat.setConductivityofDrySoil(defaults[:conductivity][:default])
66
+ end
67
+
68
+ # assign density if it exists
69
+ if @hash[:density]
70
+ os_veg_mat.setDensityofDrySoil(@hash[:density])
71
+ else
72
+ os_veg_mat.setDensityofDrySoil(defaults[:density][:default])
73
+ end
74
+
75
+ # assign specific_heat if it exists
76
+ if @hash[:specific_heat]
77
+ os_veg_mat.setSpecificHeatofDrySoil(@hash[:specific_heat])
78
+ else
79
+ os_veg_mat.setSpecificHeatofDrySoil(defaults[:specific_heat][:default])
80
+ end
81
+
82
+ # assign roughness if it exists
83
+ if @hash[:roughness]
84
+ os_veg_mat.setRoughness(@hash[:roughness])
85
+ else
86
+ os_veg_mat.setRoughness(defaults[:roughness][:default])
87
+ end
88
+
89
+ # assign thermal absorptance if it exists
90
+ if @hash[:soil_thermal_absorptance]
91
+ os_veg_mat.setThermalAbsorptance(@hash[:soil_thermal_absorptance])
92
+ else
93
+ os_veg_mat.setThermalAbsorptance(defaults[:soil_thermal_absorptance][:default])
94
+ end
95
+
96
+ # assign solar absorptance if it exists
97
+ if @hash[:soil_solar_absorptance]
98
+ os_veg_mat.setSolarAbsorptance(@hash[:soil_solar_absorptance])
99
+ else
100
+ os_veg_mat.setSolarAbsorptance(defaults[:soil_solar_absorptance][:default])
101
+ end
102
+
103
+ # assign visible absorptance if it exists
104
+ if @hash[:soil_visible_absorptance]
105
+ os_veg_mat.setVisibleAbsorptance(@hash[:soil_visible_absorptance])
106
+ else
107
+ os_veg_mat.setVisibleAbsorptance(defaults[:soil_visible_absorptance][:default])
108
+ end
109
+
110
+ # assign plant_height if it exists
111
+ if @hash[:plant_height]
112
+ os_veg_mat.setHeightofPlants(@hash[:plant_height])
113
+ else
114
+ os_veg_mat.setHeightofPlants(defaults[:plant_height][:default])
115
+ end
116
+
117
+ # assign leaf_area_index if it exists
118
+ if @hash[:leaf_area_index]
119
+ os_veg_mat.setLeafAreaIndex(@hash[:leaf_area_index])
120
+ else
121
+ os_veg_mat.setLeafAreaIndex(defaults[:leaf_area_index][:default])
122
+ end
123
+
124
+ # assign leaf_reflectivity if it exists
125
+ if @hash[:leaf_reflectivity]
126
+ os_veg_mat.setLeafReflectivity(@hash[:leaf_reflectivity])
127
+ else
128
+ os_veg_mat.setLeafReflectivity(defaults[:leaf_reflectivity][:default])
129
+ end
130
+
131
+ # assign leaf_emissivity if it exists
132
+ if @hash[:leaf_emissivity]
133
+ os_veg_mat.setLeafEmissivity(@hash[:leaf_emissivity])
134
+ else
135
+ os_veg_mat.setLeafEmissivity(defaults[:leaf_emissivity][:default])
136
+ end
137
+
138
+ # assign min_stomatal_resist if it exists
139
+ if @hash[:min_stomatal_resist]
140
+ os_veg_mat.setMinimumStomatalResistance(@hash[:min_stomatal_resist])
141
+ else
142
+ os_veg_mat.setMinimumStomatalResistance(defaults[:min_stomatal_resist][:default])
143
+ end
144
+
145
+ # assign sat_vol_moist_cont if it exists
146
+ if @hash[:sat_vol_moist_cont]
147
+ os_veg_mat.setSaturationVolumetricMoistureContentoftheSoilLayer(@hash[:sat_vol_moist_cont])
148
+ else
149
+ os_veg_mat.setSaturationVolumetricMoistureContentoftheSoilLayer(defaults[:sat_vol_moist_cont][:default])
150
+ end
151
+
152
+ # assign residual_vol_moist_cont if it exists
153
+ if @hash[:residual_vol_moist_cont]
154
+ os_veg_mat.setResidualVolumetricMoistureContentoftheSoilLayer(@hash[:residual_vol_moist_cont])
155
+ else
156
+ os_veg_mat.setResidualVolumetricMoistureContentoftheSoilLayer(defaults[:residual_vol_moist_cont][:default])
157
+ end
158
+
159
+ # assign init_vol_moist_cont if it exists
160
+ if @hash[:init_vol_moist_cont]
161
+ os_veg_mat.setInitialVolumetricMoistureContentoftheSoilLayer(@hash[:init_vol_moist_cont])
162
+ else
163
+ os_veg_mat.setInitialVolumetricMoistureContentoftheSoilLayer(defaults[:init_vol_moist_cont][:default])
164
+ end
165
+
166
+ # assign moist_diff_model if it exists
167
+ if @hash[:moist_diff_model]
168
+ os_veg_mat.setMoistureDiffusionCalculationMethod(@hash[:moist_diff_model])
169
+ else
170
+ os_veg_mat.setMoistureDiffusionCalculationMethod(defaults[:moist_diff_model][:default])
171
+ end
172
+
173
+ os_veg_mat
174
+ end
175
+ end # EnergyMaterialVegetation
176
+ end # Honeybee
@@ -89,7 +89,6 @@ module Honeybee
89
89
  OpenStudio::Model::Model.new
90
90
  end
91
91
 
92
- @openstudio_model.getYearDescription.setCalendarYear(2020)
93
92
  # create all openstudio objects in the model
94
93
  create_openstudio_objects(log_report)
95
94
 
@@ -228,6 +227,8 @@ module Honeybee
228
227
  material_object = EnergyMaterial.new(material)
229
228
  when 'EnergyMaterialNoMass'
230
229
  material_object = EnergyMaterialNoMass.new(material)
230
+ when 'EnergyMaterialVegetation'
231
+ material_object = EnergyMaterialVegetation.new(material)
231
232
  when 'EnergyWindowMaterialGas'
232
233
  material_object = EnergyWindowMaterialGas.new(material)
233
234
  $gas_gap_hash[material[:identifier]] = material_object
@@ -49,8 +49,6 @@ module Honeybee
49
49
  else
50
50
  OpenStudio::Model::Model.new
51
51
  end
52
-
53
- @openstudio_model.getYearDescription.setCalendarYear(2020)
54
52
 
55
53
  create_openstudio_objects
56
54
 
@@ -162,7 +162,7 @@ module Honeybee
162
162
  else
163
163
  slope_ang = 90 - (180 - srf_tilt)
164
164
  end
165
- os_opening = OpenStudio::Model::AirflowNetworkHorizontalOpening .new(
165
+ os_opening = OpenStudio::Model::AirflowNetworkHorizontalOpening.new(
166
166
  openstudio_model, flow_coefficient, flow_exponent, slope_ang, discharge_coeff)
167
167
  end
168
168
  else
data/lib/to_openstudio.rb CHANGED
@@ -60,6 +60,7 @@ require 'to_openstudio/construction/air'
60
60
  # extend the material objects
61
61
  require 'to_openstudio/material/opaque'
62
62
  require 'to_openstudio/material/opaque_no_mass'
63
+ require 'to_openstudio/material/vegetation'
63
64
  require 'to_openstudio/material/window_gas'
64
65
  require 'to_openstudio/material/window_gas_mixture'
65
66
  require 'to_openstudio/material/window_gas_custom'
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.29.0
4
+ version: 2.30.0
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: 2022-01-20 00:00:00.000000000 Z
14
+ date: 2022-02-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -187,6 +187,7 @@ files:
187
187
  - lib/from_openstudio/load/ventilation.rb
188
188
  - lib/from_openstudio/material/opaque.rb
189
189
  - lib/from_openstudio/material/opaque_no_mass.rb
190
+ - lib/from_openstudio/material/vegetation.rb
190
191
  - lib/from_openstudio/material/window_blind.rb
191
192
  - lib/from_openstudio/material/window_gas.rb
192
193
  - lib/from_openstudio/material/window_gas_custom.rb
@@ -235,6 +236,7 @@ files:
235
236
  - lib/honeybee/load/ventilation.rb
236
237
  - lib/honeybee/material/opaque.rb
237
238
  - lib/honeybee/material/opaque_no_mass.rb
239
+ - lib/honeybee/material/vegetation.rb
238
240
  - lib/honeybee/material/window_blind.rb
239
241
  - lib/honeybee/material/window_gas.rb
240
242
  - lib/honeybee/material/window_gas_custom.rb
@@ -315,6 +317,7 @@ files:
315
317
  - lib/to_openstudio/load/ventilation.rb
316
318
  - lib/to_openstudio/material/opaque.rb
317
319
  - lib/to_openstudio/material/opaque_no_mass.rb
320
+ - lib/to_openstudio/material/vegetation.rb
318
321
  - lib/to_openstudio/material/window_blind.rb
319
322
  - lib/to_openstudio/material/window_gas.rb
320
323
  - lib/to_openstudio/material/window_gas_custom.rb