honeybee-openstudio 2.28.6 → 2.29.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: 4ca37d07a3be814cdd3142149cd708f3970248b60602cb258e198f78c03ea9e4
4
- data.tar.gz: 867481f07dde60d48f5f60d2e4e15200911c7362e632fd746e0512a8e5af605c
3
+ metadata.gz: 36e1a63a690e85c6c22baf31da94ff11ab277de6d30b274a1454dab2ca11d87f
4
+ data.tar.gz: df1209e056ddbb6cbfa1401f15c3332d3e5316553e4593541c5db3c20e5b9448
5
5
  SHA512:
6
- metadata.gz: 31926e2a3a6db328f6c1a34d2ecf77e4010f03756f21949ee64f4c6e62a1ef1274aa0bf48631333c0e0350fa8ae8621b5c2f10f470de34ee3317148ccf3670ff
7
- data.tar.gz: afb29e454546acf687bfb171c878f2dc51a5515d81a1dd9d2afef94b59bfe92d5ba1aa53dba5a0d94cd0f6c2ada8f24b3aea00a41b6861736117c9f2784463f6
6
+ metadata.gz: 647b3b5ad803b8248b4234cbdb4f31669092adae8c7d7244f68804a73853777ecb97b0028d09fd495f05811e6e7aadb71248d310d4b4cdab46fec860a2127398
7
+ data.tar.gz: 3225c1675846d452a31da177533a34d7daa9fbf07a15b0ba2dbd4abb7c139a3e491d3c45658518c0e27c983678a083c70fe4718e16c7361ef94334cca8144a65
@@ -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.28.6'
7
+ spec.version = '2.29.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
 
@@ -64,12 +64,166 @@ module Honeybee
64
64
  hash = {}
65
65
  hash[:type] = 'RoomPropertiesAbridged'
66
66
  hash[:energy] = self.energy_properties_from_space(space)
67
+
67
68
  hash
68
69
  end
69
70
 
70
71
  def self.energy_properties_from_space(space)
71
72
  hash = {}
72
73
  hash[:type] = 'RoomEnergyPropertiesAbridged'
74
+ # set room energy properties
75
+ unless space.defaultConstructionSet.empty?
76
+ const_set = space.defaultConstructionSet.get
77
+ hash[:construction_set] = const_set.nameString
78
+ end
79
+ unless space.spaceType.empty?
80
+ space_type = space.spaceType.get
81
+ hash[:program_type] = space_type.nameString
82
+ end
83
+ # TODO: These are loads assigned to the space directly. How should duplicates created in programtype, if any, be handled?
84
+ unless space.people.empty?
85
+ space.people.each do |people|
86
+ people_def = people.peopleDefinition
87
+ # Only translate if people per floor area is specified
88
+ # Check if schedule exists and is of the correct type
89
+ if !people_def.peopleperSpaceFloorArea.empty? && !people.numberofPeopleSchedule.empty?
90
+ sch = people.numberofPeopleSchedule.get
91
+ if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
92
+ hash[:people] = Honeybee::PeopleAbridged.from_load(people)
93
+ break
94
+ end
95
+ end
96
+ end
97
+ end
98
+ unless space.lights.empty?
99
+ space.lights.each do |light|
100
+ light_def = light.lightsDefinition
101
+ # Only translate if watts per floor area is specified
102
+ # Check if schedule exists and is of the correct type
103
+ if !light_def.wattsperSpaceFloorArea.empty? && !light.schedule.empty?
104
+ sch = light.schedule.get
105
+ if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
106
+ hash[:lighting] = Honeybee::LightingAbridged.from_load(light)
107
+ break
108
+ end
109
+ end
110
+ end
111
+ end
112
+ unless space.electricEquipment.empty?
113
+ space.electricEquipment.each do |electric_eq|
114
+ electric_eq_def = electric_eq.electricEquipmentDefinition
115
+ # Only translate if watts per floor area is specified
116
+ # Check if schedule exists and is of the correct type
117
+ if !electric_eq_def.wattsperSpaceFloorArea.empty? && !electric_eq.schedule.empty?
118
+ sch = electric_eq.schedule.get
119
+ if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
120
+ hash[:electric_equipment] = Honeybee::ElectricEquipmentAbridged.from_load(electric_eq)
121
+ break
122
+ end
123
+ end
124
+ end
125
+ end
126
+ unless space.gasEquipment.empty?
127
+ space.gasEquipment.each do |gas_eq|
128
+ gas_eq_def = gas_eq.gasEquipmentDefinition
129
+ # Only translate if watts per floor area is specified
130
+ # Check if schedule exists and is of the correct type
131
+ if !gas_eq_def.wattsperSpaceFloorArea.empty? && !gas_eq.schedule.empty?
132
+ sch = gas_eq.schedule.get
133
+ if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
134
+ hash[:gas_equipment] = Honeybee::GasEquipmentAbridged.from_load(gas_eq)
135
+ break
136
+ end
137
+ end
138
+ end
139
+ end
140
+ unless space.otherEquipment.empty?
141
+ hash[:process_loads] = []
142
+ space.otherEquipment.each do |other_eq|
143
+ unless other_eq.designLevel.empty?
144
+ hash[:process_loads] << Honeybee::ProcessAbridged.from_load(other_eq)
145
+ end
146
+ end
147
+ end
148
+ unless space.spaceInfiltrationDesignFlowRates.empty?
149
+ space.spaceInfiltrationDesignFlowRates.each do |infiltration|
150
+ # Only translate if flow per exterior area is specified
151
+ # Check if schedule exists and is of the correct type
152
+ if !infiltration.flowperExteriorSurfaceArea.empty? && !infiltration.schedule.empty?
153
+ sch = infiltration.schedule.get
154
+ if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
155
+ hash[:infiltration] = Honeybee::InfiltrationAbridged.from_load(infiltration)
156
+ break
157
+ end
158
+ end
159
+ end
160
+ end
161
+ unless space.designSpecificationOutdoorAir.empty?
162
+ hash[:ventilation] = Honeybee::VentilationAbridged.from_load(space.designSpecificationOutdoorAir.get)
163
+ end
164
+ unless space.daylightingControls.empty?
165
+ hash[:daylighting_control] = Honeybee::DaylightingControl.from_load(space.daylightingControls[0])
166
+ end
167
+ thermal_zone = space.thermalZone
168
+ unless thermal_zone.empty?
169
+ thermal_zone = space.thermalZone.get
170
+ unless thermal_zone.thermostatSetpointDualSetpoint.empty?
171
+ hash[:setpoint] = {}
172
+ thermostat = thermal_zone.thermostatSetpointDualSetpoint.get
173
+ hash[:setpoint][:identifier] = thermostat.nameString
174
+ if thermostat.heatingSetpointTemperatureSchedule.empty?
175
+ # if heating setpoint schedule is not specified create a new setpoint schedule and assign to HB thermostat object.
176
+ # first check if schedule is already created
177
+ if $heating_setpoint_schedule.nil?
178
+ openstudio_model = OpenStudio::Model::Model.new
179
+ openstudio_schedule = OpenStudio::Model::ScheduleRuleset.new(openstudio_model)
180
+ openstudio_schedule.setName('Heating Schedule Default')
181
+ openstudio_sch_type_lim = OpenStudio::Model::ScheduleTypeLimits.new(openstudio_model)
182
+ openstudio_sch_type_lim.setName('Temperature')
183
+ openstudio_sch_type_lim.setNumericType('Temperature')
184
+ openstudio_schedule.defaultDaySchedule.setName('Heating Day Default')
185
+ openstudio_schedule.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), 100)
186
+ openstudio_schedule.defaultDaySchedule.setScheduleTypeLimits(openstudio_sch_type_lim)
187
+ $heating_setpoint_schedule = Honeybee::ScheduleRulesetAbridged.from_schedule_ruleset(openstudio_schedule)
188
+ end
189
+ hash[:setpoint][:heating_schedule] = $heating_setpoint_schedule[:identifier]
190
+ else
191
+ heating_schedule = thermostat.heatingSetpointTemperatureSchedule.get
192
+ hash[:setpoint][:heating_schedule] = heating_schedule.nameString
193
+ end
194
+ if thermostat.coolingSetpointTemperatureSchedule.empty?
195
+ # if cooling setpoint schedule is not specified create a new setpoint schedule and assign to HB thermostat object
196
+ # first check if schedule is already created
197
+ if $cooling_setpoint_schedule.nil?
198
+ openstudio_model = OpenStudio::Model::Model.new
199
+ openstudio_schedule = OpenStudio::Model::ScheduleRuleset.new(openstudio_model)
200
+ openstudio_schedule.setName('Cooling Schedule Default')
201
+ openstudio_sch_type_lim = OpenStudio::Model::ScheduleTypeLimits.new(openstudio_model)
202
+ openstudio_sch_type_lim.setName('Temperature')
203
+ openstudio_sch_type_lim.setNumericType('Temperature')
204
+ openstudio_schedule.defaultDaySchedule.setName('Cooling Day Default')
205
+ openstudio_schedule.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), -100)
206
+ openstudio_schedule.defaultDaySchedule.setScheduleTypeLimits(openstudio_sch_type_lim)
207
+ $cooling_setpoint_schedule = Honeybee::ScheduleRulesetAbridged.from_schedule_ruleset(openstudio_schedule)
208
+ end
209
+ hash[:setpoint][:cooling_schedule] = $cooling_setpoint_schedule[:identifier]
210
+ else
211
+ cooling_schedule = thermostat.coolingSetpointTemperatureSchedule.get
212
+ hash[:setpoint][:cooling_schedule] = cooling_schedule.nameString
213
+ end
214
+ end
215
+ unless thermal_zone.zoneControlHumidistat.empty?
216
+ humidistat = thermal_zone.zoneControlHumidistat.get
217
+ unless humidistat.humidifyingRelativeHumiditySetpointSchedule.empty?
218
+ humidifying_schedule = humidistat.humidifyingRelativeHumiditySetpointSchedule.get
219
+ hash[:setpoint][:humidifying_schedule] = humidifying_schedule.nameString
220
+ end
221
+ unless humidistat.dehumidifyingRelativeHumiditySetpointSchedule.empty?
222
+ dehumidifying_schedule = humidistat.dehumidifyingRelativeHumiditySetpointSchedule.get
223
+ hash[:setpoint][:dehumidifying_schedule] = dehumidifying_schedule.nameString
224
+ end
225
+ end
226
+ end
73
227
  hash
74
228
  end
75
229
 
@@ -0,0 +1,60 @@
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/load/daylight'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class DaylightingControl < ModelObject
37
+
38
+ def self.from_load(load)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'DaylightingControl'
42
+ # set hash values from OpenStudio Object
43
+ unless load.displayName.empty?
44
+ hash[:display_name] = (load.displayName.get).force_encoding("UTF-8")
45
+ end
46
+ hash[:illuminance_setpoint] = load.illuminanceSetpoint
47
+ # TODO: set control fraction property
48
+ hash[:min_power_input] = load.minimumInputPowerFractionforContinuousDimmingControl
49
+ hash[:min_light_output] = load.minimumLightOutputFractionforContinuousDimmingControl
50
+ # TODO: set off at minimum property
51
+ hash[:sensor_position] = []
52
+ hash[:sensor_position] << load.positionXCoordinate
53
+ hash[:sensor_position] << load.positionYCoordinate
54
+ hash[:sensor_position] << load.positionZCoordinate
55
+
56
+ hash
57
+ end
58
+
59
+ end #DaylightingControl
60
+ end #Honeybee
@@ -0,0 +1,66 @@
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/load/electric_equipment'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class ElectricEquipmentAbridged < ModelObject
37
+
38
+ def self.from_load(load)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'ElectricEquipmentAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = clean_name(load.nameString)
44
+ unless load.displayName.empty?
45
+ hash[:display_name] = (load.displayName.get).force_encoding("UTF-8")
46
+ end
47
+ unless load.schedule.empty?
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
52
+ end
53
+ load_def = load.electricEquipmentDefinition
54
+ unless load_def.wattsperSpaceFloorArea.empty?
55
+ hash[:watts_per_area] = load_def.wattsperSpaceFloorArea.get
56
+ end
57
+ hash[:radiant_fraction] = load_def.fractionRadiant
58
+ hash[:latent_fraction] = load_def.fractionLatent
59
+ hash[:lost_fraction] = load_def.fractionLost
60
+
61
+ hash
62
+ end
63
+
64
+
65
+ end #ElectricEquipmentAbridged
66
+ end #Honeybee
@@ -0,0 +1,62 @@
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/load/gas_equipment'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class GasEquipmentAbridged
37
+
38
+ def self.from_load(load)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'GasEquipmentAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = clean_name(load.nameString)
44
+ unless load.schedule.empty?
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
49
+ end
50
+ load_def = load.gasEquipmentDefinition
51
+ unless load_def.wattsperSpaceFloorArea.empty?
52
+ hash[:watts_per_area] = load_def.wattsperSpaceFloorArea.get
53
+ end
54
+ hash[:radiant_fraction] = load_def.fractionRadiant.to_f
55
+ hash[:latent_fraction] = load_def.fractionLatent.to_f
56
+ hash[:lost_fraction] = load_def.fractionLost.to_f
57
+
58
+ hash
59
+ end
60
+
61
+ end # GasEquipmentAbridged
62
+ end # Honeybee
@@ -0,0 +1,62 @@
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/load/infiltration'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class InfiltrationAbridged
37
+
38
+ def self.from_load(load)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'InfiltrationaAridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = clean_name(load.nameString)
44
+ unless load.displayName.empty?
45
+ hash[:display_name] = (load.displayName.get).force_encoding("UTF-8")
46
+ end
47
+ hash[:flow_per_exterior_area] = load.flowperExteriorSurfaceArea.get
48
+ unless load.schedule.empty?
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
53
+ end
54
+ hash[:constant_coefficient] = load.constantTermCoefficient
55
+ hash[:temperature_coefficient] = load.temperatureTermCoefficient
56
+ hash[:velocity_coefficient] = load.velocityTermCoefficient
57
+
58
+ hash
59
+ end
60
+
61
+ end #InfiltrationAbridged
62
+ end #Honeybee
@@ -0,0 +1,66 @@
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/load/lighting'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class LightingAbridged < ModelObject
37
+
38
+ def self.from_load(load)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'LightingAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = clean_name(load.nameString)
44
+ unless load.displayName.empty?
45
+ hash[:display_name] = (load.displayName.get).force_encoding("UTF-8")
46
+ end
47
+ unless load.schedule.empty?
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
52
+ end
53
+ loads_def = load.lightsDefinition
54
+ unless loads_def.wattsperSpaceFloorArea.empty?
55
+ hash[:watts_per_area] = loads_def.wattsperSpaceFloorArea.get
56
+ end
57
+ #TODO: user_data?
58
+ #TODO: baseline_watts_per_area
59
+ hash[:visible_fraction] = loads_def.fractionVisible
60
+ hash[:radiant_fraction] = loads_def.fractionRadiant
61
+ hash[:return_air_fraction] = loads_def.returnAirFraction
62
+
63
+ hash
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,75 @@
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/load/people'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class PeopleAbridged < ModelObject
37
+
38
+ def self.from_load(load)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'PeopleAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = clean_name(load.nameString)
44
+ unless load.displayName.empty?
45
+ hash[:display_name] = (load.displayName.get).force_encoding("UTF-8")
46
+ end
47
+ #TODO: Is there a default occupancy schedule since it is a required field in HB but not
48
+ #in OS
49
+ unless load.numberofPeopleSchedule.empty?
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
54
+ end
55
+ unless load.activityLevelSchedule.empty?
56
+ 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
60
+ end
61
+ load_def = load.peopleDefinition
62
+ unless load_def.peopleperSpaceFloorArea.empty?
63
+ hash[:people_per_area] = load_def.peopleperSpaceFloorArea.to_f
64
+ end
65
+ hash[:radiant_fraction] = load_def.fractionRadiant
66
+ unless load_def.isSensibleHeatFractionAutocalculated
67
+ sensible_fraction = load_def.sensibleHeatFraction
68
+ unless sensible_fraction.empty
69
+ hash[:latent_fraction] = 1 - load_def.sensibleHeatFraction.get
70
+ end
71
+ end
72
+ hash
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,63 @@
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/load/process'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class ProcessAbridged
37
+
38
+ def self.from_load(load)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'ProcessAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = clean_name(load.nameString)
44
+ load_def = load.otherEquipmentDefinition
45
+ unless load_def.displayName.empty?
46
+ hash[:display_name] = (load_def.displayName.get).force_encoding("UTF-8")
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
51
+ hash[:schedule] = schedule.nameString
52
+ end
53
+ hash[:end_use_category] = load.endUseSubcategory
54
+ hash[:fuel_type] = load.fuelType
55
+ hash[:radiant_fraction] = load_def.fractionRadiant
56
+ hash[:latent_fraction] = load_def.fractionLatent
57
+ hash[:lost_fraction] = load_def.fractionLost
58
+
59
+ hash
60
+ end
61
+
62
+ end # ProcessAbridged
63
+ end # Honeybee
@@ -0,0 +1,60 @@
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/load/ventilation'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class VentilationAbridged < ModelObject
37
+
38
+ def self.from_load(load)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'VentilationAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = clean_name(load.nameString)
44
+ hash[:air_changes_per_hour] = load.outdoorAirFlowAirChangesperHour
45
+ hash[:flow_per_zone] = load.outdoorAirFlowRate
46
+ hash[:flow_per_person] = load.outdoorAirFlowperPerson
47
+ hash[:flow_per_area] = load.outdoorAirFlowperFloorArea
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
53
+ end
54
+ end
55
+
56
+ hash
57
+ end
58
+
59
+ end # VentilationAbridged
60
+ end # Honeybee
@@ -49,6 +49,7 @@ require 'from_openstudio/construction_set'
49
49
  require 'from_openstudio/schedule/type_limit'
50
50
  require 'from_openstudio/schedule/ruleset'
51
51
  require 'from_openstudio/schedule/fixed_interval'
52
+ require 'from_openstudio/program_type'
52
53
 
53
54
  require 'openstudio'
54
55
 
@@ -65,7 +66,7 @@ module Honeybee
65
66
  hash[:tolerance] = 0.01
66
67
  hash[:angle_tolerance] = 1.0
67
68
 
68
- # Hashes for all shcedules and constructions in the model
69
+ # Hashes for various model properties
69
70
  $schedules = {}
70
71
  $opaque_constructions = {}
71
72
  $window_constructions = {}
@@ -76,6 +77,15 @@ module Honeybee
76
77
  rooms = rooms_from_model(openstudio_model)
77
78
  hash[:rooms] = rooms if !rooms.empty?
78
79
 
80
+ # Add schedule created at the room level to the array of schedules in the model
81
+ unless $heating_setpoint_schedule.nil?
82
+ hash[:properties][:energy][:schedules] << $heating_setpoint_schedule
83
+ end
84
+ # Add schedule created at the room level to the array of schedules in the model
85
+ unless $cooling_setpoint_schedule.nil?
86
+ hash[:properties][:energy][:schedules] << $cooling_setpoint_schedule
87
+ end
88
+
79
89
  orphaned_shades = orphaned_shades_from_model(openstudio_model)
80
90
  hash[:orphaned_shades] = orphaned_shades if !orphaned_shades.empty?
81
91
 
@@ -134,8 +144,8 @@ module Honeybee
134
144
  hash[:materials] = materials_from_model(openstudio_model)
135
145
  hash[:construction_sets] = constructionsets_from_model(openstudio_model)
136
146
  hash[:schedule_type_limits] = schedtypelimits_from_model(openstudio_model)
137
- hash[:schedules] = scheduleruleset_from_model(openstudio_model)
138
- hash[:schedules] = schedulefixedinterval_from_model(openstudio_model)
147
+ hash[:schedules] = schedules_from_model(openstudio_model)
148
+ hash[:program_types] = programtype_from_model(openstudio_model)
139
149
 
140
150
  hash
141
151
  end
@@ -263,10 +273,9 @@ module Honeybee
263
273
 
264
274
  def self.shade_constructions_from_model(shade_constructions)
265
275
  result = []
266
-
267
- shade_constructions.each do |key, value|
268
- result << ShadeConstruction.from_construction(value)
269
- end
276
+ shade_constructions.each do |key, value|
277
+ result << ShadeConstruction.from_construction(value)
278
+ end
270
279
 
271
280
  result
272
281
  end
@@ -281,20 +290,13 @@ module Honeybee
281
290
  result
282
291
  end
283
292
 
284
- # Create HB Schedule Ruleset from OpenStudio Ruleset
285
- def self.scheduleruleset_from_model(openstudio_model)
293
+ def self.schedules_from_model(openstudio_model)
286
294
  result = []
287
295
  openstudio_model.getScheduleRulesets.each do |sch_ruleset|
288
296
  sched_hash = ScheduleRulesetAbridged.from_schedule_ruleset(sch_ruleset)
289
297
  $schedules[sched_hash[:identifier]] = sched_hash
290
298
  result << sched_hash
291
299
  end
292
- result
293
- end
294
-
295
- # Create HB Schedule Fixed Interval from OpenStudio Schedule Fixed Interval
296
- def self.schedulefixedinterval_from_model(openstudio_model)
297
- result = []
298
300
  # check if it is a leap year
299
301
  is_leap_year = openstudio_model.getYearDescription.isLeapYear
300
302
  openstudio_model.getScheduleFixedIntervals.each do |sch_fix_int|
@@ -302,6 +304,16 @@ module Honeybee
302
304
  $schedules[sched_fixed_hash[:identifier]] = sched_fixed_hash
303
305
  result << sched_fixed_hash
304
306
  end
307
+
308
+ result
309
+ end
310
+
311
+ # Create HB Program Type from OpenStudio Space Type
312
+ def self.programtype_from_model(openstudio_model)
313
+ result = []
314
+ openstudio_model.getSpaceTypes.each do |space_type|
315
+ result << ProgramTypeAbridged.from_programtype(space_type)
316
+ end
305
317
  result
306
318
  end
307
319
 
@@ -0,0 +1,124 @@
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/program_type'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class ProgramTypeAbridged < ModelObject
37
+
38
+ def self.from_programtype(programtype)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'ProgramTypeAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = clean_name(programtype.nameString)
44
+ unless programtype.displayName.empty?
45
+ hash[:display_name] = (programtype.displayName.get).force_encoding("UTF-8")
46
+ end
47
+ unless programtype.people.empty?
48
+ programtype.people.each do |people|
49
+ people_def = people.peopleDefinition
50
+ # Only translate if people per floor area is specified
51
+ # Check if schedule exists and is of the correct type
52
+ if !people_def.peopleperSpaceFloorArea.empty? && !people.numberofPeopleSchedule.empty?
53
+ sch = people.numberofPeopleSchedule.get
54
+ if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
55
+ hash[:people] = Honeybee::PeopleAbridged.from_load(people)
56
+ break
57
+ end
58
+ end
59
+ end
60
+ end
61
+ unless programtype.lights.empty?
62
+ programtype.lights.each do |light|
63
+ light_def = light.lightsDefinition
64
+ # Only translate if watts per floor area is specified
65
+ # Check if schedule exists and is of the correct type
66
+ if !light_def.wattsperSpaceFloorArea.empty? && !light.schedule.empty?
67
+ sch = light.schedule.get
68
+ if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
69
+ hash[:lighting] = Honeybee::LightingAbridged.from_load(light)
70
+ break
71
+ end
72
+ end
73
+ end
74
+ end
75
+ unless programtype.electricEquipment.empty?
76
+ programtype.electricEquipment.each do |electric_eq|
77
+ electric_eq_def = electric_eq.electricEquipmentDefinition
78
+ # Only translate if watts per floor area is specified
79
+ # Check if schedule exists and is of the correct type
80
+ if !electric_eq_def.wattsperSpaceFloorArea.empty? && !electric_eq.schedule.empty?
81
+ sch = electric_eq.schedule.get
82
+ if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
83
+ hash[:electric_equipment] = Honeybee::ElectricEquipmentAbridged.from_load(electric_eq)
84
+ break
85
+ end
86
+ end
87
+ end
88
+ end
89
+ unless programtype.gasEquipment.empty?
90
+ programtype.gasEquipment.each do |gas_eq|
91
+ gas_eq_def = gas_eq.gasEquipmentDefinition
92
+ # Only translate if watts per floor area is specified
93
+ # Check if schedule exists and is of the correct type
94
+ if !gas_eq_def.wattsperSpaceFloorArea.empty? && !gas_eq.schedule.empty?
95
+ sch = gas_eq.schedule.get
96
+ if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
97
+ hash[:gas_equipment] = Honeybee::GasEquipmentAbridged.from_load(gas_eq)
98
+ break
99
+ end
100
+ end
101
+ end
102
+ end
103
+ unless programtype.spaceInfiltrationDesignFlowRates.empty?
104
+ programtype.spaceInfiltrationDesignFlowRates.each do |infiltration|
105
+ # Only translate if flow per exterior area is specified
106
+ # Check if schedule exists and is of the correct type
107
+ if !infiltration.flowperExteriorSurfaceArea.empty? && !infiltration.schedule.empty?
108
+ sch = infiltration.schedule.get
109
+ if sch.to_ScheduleFixedInterval.is_initialized or sch.to_ScheduleRuleset.is_initialized
110
+ hash[:infiltration] = Honeybee::InfiltrationAbridged.from_load(infiltration)
111
+ break
112
+ end
113
+ end
114
+ end
115
+ end
116
+ unless programtype.designSpecificationOutdoorAir.empty?
117
+ hash[:ventilation] = Honeybee::VentilationAbridged.from_load(programtype.designSpecificationOutdoorAir.get)
118
+ end
119
+
120
+ hash
121
+ end
122
+
123
+ end # ProgramTypeAbridged
124
+ end # Honeybee
@@ -68,3 +68,17 @@ require 'from_openstudio/simulation/simulation_output'
68
68
  # extend the schedule objects
69
69
  require 'from_openstudio/schedule/type_limit'
70
70
  require 'from_openstudio/schedule/ruleset'
71
+ require 'from_openstudio/schedule/fixed_interval'
72
+
73
+ # extend the load objects
74
+ require 'from_openstudio/load/electric_equipment'
75
+ require 'from_openstudio/load/people'
76
+ require 'from_openstudio/load/gas_equipment'
77
+ require 'from_openstudio/load/lighting'
78
+ require 'from_openstudio/load/infiltration'
79
+ require 'from_openstudio/load/ventilation'
80
+ require 'from_openstudio/load/daylight'
81
+ require 'from_openstudio/load/process'
82
+
83
+ # extend the program type objects
84
+ require 'from_openstudio/program_type'
@@ -76,12 +76,13 @@ module Honeybee
76
76
  # create the space and thermal zone
77
77
  os_space = OpenStudio::Model::Space.new(openstudio_model)
78
78
  os_space.setName(@hash[:identifier] + '_Space')
79
- unless @hash[:display_name].nil?
80
- os_space.setDisplayName(@hash[:display_name])
81
- end
82
79
  os_thermal_zone = OpenStudio::Model::ThermalZone.new(openstudio_model)
83
80
  os_thermal_zone.setName(@hash[:identifier])
84
81
  os_space.setThermalZone(os_thermal_zone)
82
+ unless @hash[:display_name].nil?
83
+ os_space.setDisplayName(@hash[:display_name])
84
+ os_thermal_zone.setDisplayName(@hash[:display_name])
85
+ end
85
86
 
86
87
  # assign the programtype
87
88
  if @hash[:properties][:energy][:program_type]
@@ -226,8 +227,14 @@ module Honeybee
226
227
  else
227
228
  flow_sch_id = 'Always On'
228
229
  end
229
- adj_zone_id = face[:boundary_condition][:boundary_condition_objects][-1]
230
- $air_mxing_array << [os_thermal_zone, flow_rate, flow_sch_id, adj_zone_id]
230
+ begin
231
+ adj_zone_id = face[:boundary_condition][:boundary_condition_objects][-1]
232
+ rescue Exception
233
+ msg = 'ERROR: Air Boundary Faces must be adjacent to a neighboring Room and have a Surface boundary condition.'
234
+ puts msg
235
+ else
236
+ $air_mxing_array << [os_thermal_zone, flow_rate, flow_sch_id, adj_zone_id]
237
+ end
231
238
  end
232
239
  end
233
240
 
@@ -73,7 +73,7 @@ module Honeybee
73
73
  end
74
74
 
75
75
  # assign light output fraction if it exists
76
- if @hash[:min_power_input]
76
+ if @hash[:min_light_output]
77
77
  os_dl_control.setMinimumLightOutputFractionforContinuousDimmingControl(@hash[:min_light_output])
78
78
  else
79
79
  os_dl_control.setMinimumLightOutputFractionforContinuousDimmingControl(defaults[:min_light_output][:default])
@@ -30,7 +30,6 @@
30
30
  # *******************************************************************************
31
31
 
32
32
  require 'honeybee/load/gas_equipment'
33
-
34
33
  require 'to_openstudio/model_object'
35
34
 
36
35
  module Honeybee
@@ -89,6 +89,7 @@ module Honeybee
89
89
  OpenStudio::Model::Model.new
90
90
  end
91
91
 
92
+ @openstudio_model.getYearDescription.setCalendarYear(2020)
92
93
  # create all openstudio objects in the model
93
94
  create_openstudio_objects(log_report)
94
95
 
@@ -454,7 +455,7 @@ module Honeybee
454
455
  end
455
456
  end
456
457
 
457
- # for rooms with setpoint objects definied in the ProgramType, make a new thermostat
458
+ # for rooms with setpoint objects defined in the ProgramType, make a new thermostat
458
459
  if room[:properties][:energy][:program_type] && !room[:properties][:energy][:setpoint]
459
460
  thermal_zone = openstudio_room.thermalZone()
460
461
  unless thermal_zone.empty?
@@ -49,6 +49,8 @@ module Honeybee
49
49
  else
50
50
  OpenStudio::Model::Model.new
51
51
  end
52
+
53
+ @openstudio_model.getYearDescription.setCalendarYear(2020)
52
54
 
53
55
  create_openstudio_objects
54
56
 
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.28.6
4
+ version: 2.29.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-03 00:00:00.000000000 Z
14
+ date: 2022-01-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -177,6 +177,14 @@ files:
177
177
  - lib/from_openstudio/geometry/face.rb
178
178
  - lib/from_openstudio/geometry/room.rb
179
179
  - lib/from_openstudio/geometry/shade.rb
180
+ - lib/from_openstudio/load/daylight.rb
181
+ - lib/from_openstudio/load/electric_equipment.rb
182
+ - lib/from_openstudio/load/gas_equipment.rb
183
+ - lib/from_openstudio/load/infiltration.rb
184
+ - lib/from_openstudio/load/lighting.rb
185
+ - lib/from_openstudio/load/people.rb
186
+ - lib/from_openstudio/load/process.rb
187
+ - lib/from_openstudio/load/ventilation.rb
180
188
  - lib/from_openstudio/material/opaque.rb
181
189
  - lib/from_openstudio/material/opaque_no_mass.rb
182
190
  - lib/from_openstudio/material/window_blind.rb
@@ -187,6 +195,7 @@ files:
187
195
  - lib/from_openstudio/material/window_simpleglazsys.rb
188
196
  - lib/from_openstudio/model.rb
189
197
  - lib/from_openstudio/model_object.rb
198
+ - lib/from_openstudio/program_type.rb
190
199
  - lib/from_openstudio/schedule/fixed_interval.rb
191
200
  - lib/from_openstudio/schedule/ruleset.rb
192
201
  - lib/from_openstudio/schedule/type_limit.rb