honeybee-openstudio 2.28.9 → 2.29.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/honeybee-openstudio.gemspec +1 -1
- data/lib/from_openstudio/geometry/room.rb +168 -0
- data/lib/from_openstudio/load/daylight.rb +60 -0
- data/lib/from_openstudio/load/electric_equipment.rb +64 -0
- data/lib/from_openstudio/load/gas_equipment.rb +60 -0
- data/lib/from_openstudio/load/infiltration.rb +60 -0
- data/lib/from_openstudio/load/lighting.rb +64 -0
- data/lib/from_openstudio/load/people.rb +71 -0
- data/lib/from_openstudio/load/process.rb +65 -0
- data/lib/from_openstudio/load/ventilation.rb +59 -0
- data/lib/from_openstudio/model.rb +27 -15
- data/lib/from_openstudio/program_type.rb +124 -0
- data/lib/from_openstudio.rb +14 -0
- data/lib/to_openstudio/construction/dynamic.rb +1 -1
- data/lib/to_openstudio/hvac/template.rb +5 -1
- data/lib/to_openstudio/load/daylight.rb +1 -1
- data/lib/to_openstudio/load/gas_equipment.rb +0 -1
- data/lib/to_openstudio/load/setpoint_humidistat.rb +4 -0
- data/lib/to_openstudio/load/setpoint_thermostat.rb +4 -0
- data/lib/to_openstudio/model.rb +1 -1
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1273a8ca924cc672cc9bbb60c33221350c8069fde83657537a8d362beddf85c6
|
4
|
+
data.tar.gz: 3312a6bf523470cdc434c00b1e9d1576b3381dd54c684b1950f132617b68b00e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b385e8c6520fbd226b608315d9dcdaf9ec285ba05898aa08cd242ad05d7aa177c59b353ec356f24a1e081b8e5be22ef67c6d64eaff8f75dab6daac111680532
|
7
|
+
data.tar.gz: 3b3f64faed0f5c16c7b00d13b8deb8c624b53c5faba5a05aaa8b8e4367822a8cfa0a72dfef2915f781c2a786d0abe822486e6f7174387ce27e673d2a3e3f9349
|
data/honeybee-openstudio.gemspec
CHANGED
@@ -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.
|
7
|
+
spec.version = '2.29.3'
|
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,180 @@ 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_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.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_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.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_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.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_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.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
|
+
other_eq_def = other_eq.otherEquipmentDefinition
|
144
|
+
if !other_eq_def.designLevel.empty? && !other_eq.schedule.empty?
|
145
|
+
sch = other_eq.schedule.get
|
146
|
+
if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
|
147
|
+
hash[:process_loads] << Honeybee::ProcessAbridged.from_load(other_eq)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
unless space.spaceInfiltrationDesignFlowRates.empty?
|
153
|
+
space.spaceInfiltrationDesignFlowRates.each do |infiltration|
|
154
|
+
# Only translate if flow per exterior area is specified
|
155
|
+
# Check if schedule exists and is of the correct type
|
156
|
+
if !infiltration.flowperExteriorSurfaceArea.empty? && !infiltration.schedule.empty?
|
157
|
+
sch = infiltration.schedule.get
|
158
|
+
if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
|
159
|
+
hash[:infiltration] = Honeybee::InfiltrationAbridged.from_load(infiltration)
|
160
|
+
break
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
unless space.designSpecificationOutdoorAir.empty?
|
166
|
+
hash[:ventilation] = Honeybee::VentilationAbridged.from_load(space.designSpecificationOutdoorAir.get)
|
167
|
+
end
|
168
|
+
unless space.daylightingControls.empty?
|
169
|
+
hash[:daylighting_control] = Honeybee::DaylightingControl.from_load(space.daylightingControls[0])
|
170
|
+
end
|
171
|
+
thermal_zone = space.thermalZone
|
172
|
+
unless thermal_zone.empty?
|
173
|
+
thermal_zone = space.thermalZone.get
|
174
|
+
unless thermal_zone.thermostatSetpointDualSetpoint.empty?
|
175
|
+
hash[:setpoint] = {}
|
176
|
+
hash[:setpoint][:type] = 'SetpointAbridged'
|
177
|
+
thermostat = thermal_zone.thermostatSetpointDualSetpoint.get
|
178
|
+
hash[:setpoint][:identifier] = thermostat.nameString
|
179
|
+
unless thermostat.displayName.empty?
|
180
|
+
hash[:display_name] = (thermostat.displayName.get).force_encoding("UTF-8")
|
181
|
+
end
|
182
|
+
sch = thermostat.heatingSetpointTemperatureSchedule
|
183
|
+
if sch.empty? or !sch.get.to_ScheduleRuleset.is_initialized
|
184
|
+
# if heating setpoint schedule is not specified create a new setpoint schedule and assign to HB thermostat object.
|
185
|
+
# first check if schedule is already created
|
186
|
+
if $heating_setpoint_schedule.nil?
|
187
|
+
openstudio_model = OpenStudio::Model::Model.new
|
188
|
+
openstudio_schedule = OpenStudio::Model::ScheduleRuleset.new(openstudio_model)
|
189
|
+
openstudio_schedule.setName('Heating Schedule Default')
|
190
|
+
openstudio_sch_type_lim = OpenStudio::Model::ScheduleTypeLimits.new(openstudio_model)
|
191
|
+
openstudio_sch_type_lim.setName('Temperature')
|
192
|
+
openstudio_sch_type_lim.setNumericType('Temperature')
|
193
|
+
openstudio_schedule.defaultDaySchedule.setName('Heating Day Default')
|
194
|
+
openstudio_schedule.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), -100)
|
195
|
+
openstudio_schedule.defaultDaySchedule.setScheduleTypeLimits(openstudio_sch_type_lim)
|
196
|
+
$heating_setpoint_schedule = Honeybee::ScheduleRulesetAbridged.from_schedule_ruleset(openstudio_schedule)
|
197
|
+
end
|
198
|
+
hash[:setpoint][:heating_schedule] = $heating_setpoint_schedule[:identifier]
|
199
|
+
else
|
200
|
+
heating_schedule = sch.get
|
201
|
+
hash[:setpoint][:heating_schedule] = heating_schedule.nameString
|
202
|
+
end
|
203
|
+
sch = thermostat.coolingSetpointTemperatureSchedule
|
204
|
+
if sch.empty? or !sch.get.to_ScheduleRuleset.is_initialized
|
205
|
+
# if cooling setpoint schedule is not specified create a new setpoint schedule and assign to HB thermostat object
|
206
|
+
# first check if schedule is already created
|
207
|
+
if $cooling_setpoint_schedule.nil?
|
208
|
+
openstudio_model = OpenStudio::Model::Model.new
|
209
|
+
openstudio_schedule = OpenStudio::Model::ScheduleRuleset.new(openstudio_model)
|
210
|
+
openstudio_schedule.setName('Cooling Schedule Default')
|
211
|
+
openstudio_sch_type_lim = OpenStudio::Model::ScheduleTypeLimits.new(openstudio_model)
|
212
|
+
openstudio_sch_type_lim.setName('Temperature')
|
213
|
+
openstudio_sch_type_lim.setNumericType('Temperature')
|
214
|
+
openstudio_schedule.defaultDaySchedule.setName('Cooling Day Default')
|
215
|
+
openstudio_schedule.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), 100)
|
216
|
+
openstudio_schedule.defaultDaySchedule.setScheduleTypeLimits(openstudio_sch_type_lim)
|
217
|
+
$cooling_setpoint_schedule = Honeybee::ScheduleRulesetAbridged.from_schedule_ruleset(openstudio_schedule)
|
218
|
+
end
|
219
|
+
hash[:setpoint][:cooling_schedule] = $cooling_setpoint_schedule[:identifier]
|
220
|
+
else
|
221
|
+
cooling_schedule = sch.get
|
222
|
+
hash[:setpoint][:cooling_schedule] = cooling_schedule.nameString
|
223
|
+
end
|
224
|
+
end
|
225
|
+
unless thermal_zone.zoneControlHumidistat.empty?
|
226
|
+
humidistat = thermal_zone.zoneControlHumidistat.get
|
227
|
+
unless humidistat.humidifyingRelativeHumiditySetpointSchedule.empty?
|
228
|
+
sch = humidistat.humidifyingRelativeHumiditySetpointSchedule.get
|
229
|
+
if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
|
230
|
+
hash[:setpoint][:humidifying_schedule] = sch.nameString
|
231
|
+
end
|
232
|
+
end
|
233
|
+
unless humidistat.dehumidifyingRelativeHumiditySetpointSchedule.empty?
|
234
|
+
sch = humidistat.dehumidifyingRelativeHumiditySetpointSchedule.get
|
235
|
+
if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
|
236
|
+
hash[:setpoint][:dehumidifying_schedule] = sch.nameString
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
73
241
|
hash
|
74
242
|
end
|
75
243
|
|
@@ -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,64 @@
|
|
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
|
+
hash[:schedule] = schedule.nameString
|
50
|
+
end
|
51
|
+
load_def = load.electricEquipmentDefinition
|
52
|
+
unless load_def.wattsperSpaceFloorArea.empty?
|
53
|
+
hash[:watts_per_area] = load_def.wattsperSpaceFloorArea.get
|
54
|
+
end
|
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
|
+
|
63
|
+
end #ElectricEquipmentAbridged
|
64
|
+
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/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
|
+
hash[:schedule] = schedule.nameString
|
47
|
+
end
|
48
|
+
load_def = load.gasEquipmentDefinition
|
49
|
+
unless load_def.wattsperSpaceFloorArea.empty?
|
50
|
+
hash[:watts_per_area] = load_def.wattsperSpaceFloorArea.get
|
51
|
+
end
|
52
|
+
hash[:radiant_fraction] = load_def.fractionRadiant.to_f
|
53
|
+
hash[:latent_fraction] = load_def.fractionLatent.to_f
|
54
|
+
hash[:lost_fraction] = load_def.fractionLost.to_f
|
55
|
+
|
56
|
+
hash
|
57
|
+
end
|
58
|
+
|
59
|
+
end # GasEquipmentAbridged
|
60
|
+
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/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] = 'InfiltrationAbridged'
|
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
|
+
hash[:schedule] = schedule.nameString
|
51
|
+
end
|
52
|
+
hash[:constant_coefficient] = load.constantTermCoefficient
|
53
|
+
hash[:temperature_coefficient] = load.temperatureTermCoefficient
|
54
|
+
hash[:velocity_coefficient] = load.velocityTermCoefficient
|
55
|
+
|
56
|
+
hash
|
57
|
+
end
|
58
|
+
|
59
|
+
end #InfiltrationAbridged
|
60
|
+
end #Honeybee
|
@@ -0,0 +1,64 @@
|
|
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
|
+
hash[:schedule] = schedule.nameString
|
50
|
+
end
|
51
|
+
loads_def = load.lightsDefinition
|
52
|
+
unless loads_def.wattsperSpaceFloorArea.empty?
|
53
|
+
hash[:watts_per_area] = loads_def.wattsperSpaceFloorArea.get
|
54
|
+
end
|
55
|
+
#TODO: user_data?
|
56
|
+
#TODO: baseline_watts_per_area
|
57
|
+
hash[:visible_fraction] = loads_def.fractionVisible
|
58
|
+
hash[:radiant_fraction] = loads_def.fractionRadiant
|
59
|
+
hash[:return_air_fraction] = loads_def.returnAirFraction
|
60
|
+
|
61
|
+
hash
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,71 @@
|
|
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
|
+
hash[:occupancy_schedule] = schedule.nameString
|
52
|
+
end
|
53
|
+
unless load.activityLevelSchedule.empty?
|
54
|
+
schedule = load.activityLevelSchedule.get
|
55
|
+
hash[:activity_schedule] = schedule.nameString
|
56
|
+
end
|
57
|
+
load_def = load.peopleDefinition
|
58
|
+
unless load_def.peopleperSpaceFloorArea.empty?
|
59
|
+
hash[:people_per_area] = load_def.peopleperSpaceFloorArea.to_f
|
60
|
+
end
|
61
|
+
hash[:radiant_fraction] = load_def.fractionRadiant
|
62
|
+
unless load_def.isSensibleHeatFractionAutocalculated
|
63
|
+
sensible_fraction = load_def.sensibleHeatFraction
|
64
|
+
unless sensible_fraction.empty
|
65
|
+
hash[:latent_fraction] = 1 - sensible_fraction.get
|
66
|
+
end
|
67
|
+
end
|
68
|
+
hash
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,65 @@
|
|
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
|
+
unless load_def.designLevel.empty?
|
49
|
+
hash[:watts] = load_def.designLevel.get
|
50
|
+
end
|
51
|
+
unless load.schedule.empty?
|
52
|
+
schedule = load.schedule.get
|
53
|
+
hash[:schedule] = schedule.nameString
|
54
|
+
end
|
55
|
+
hash[:end_use_category] = load.endUseSubcategory
|
56
|
+
hash[:fuel_type] = load.fuelType
|
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
|
+
end # ProcessAbridged
|
65
|
+
end # Honeybee
|
@@ -0,0 +1,59 @@
|
|
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
|
50
|
+
if sch.to_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.is_initialized
|
51
|
+
hash[:schedule] = sch.nameString
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
hash
|
56
|
+
end
|
57
|
+
|
58
|
+
end # VentilationAbridged
|
59
|
+
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
|
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] =
|
138
|
-
hash[:
|
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
|
-
|
268
|
-
|
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
|
-
|
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_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.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_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.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_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.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_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.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_ScheduleRuleset.is_initialized or sch.to_ScheduleFixedInterval.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
|
data/lib/from_openstudio.rb
CHANGED
@@ -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'
|
@@ -68,7 +68,7 @@ module Honeybee
|
|
68
68
|
@@program_manager = OpenStudio::Model::EnergyManagementSystemProgramCallingManager.new(
|
69
69
|
openstudio_model)
|
70
70
|
@@program_manager.setName('Dynamic_Window_Constructions')
|
71
|
-
@@program_manager.setCallingPoint('
|
71
|
+
@@program_manager.setCallingPoint('BeginZoneTimestepBeforeInitHeatBalance')
|
72
72
|
end
|
73
73
|
@@program_manager
|
74
74
|
end
|
@@ -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 =
|
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
|
@@ -73,7 +73,7 @@ module Honeybee
|
|
73
73
|
end
|
74
74
|
|
75
75
|
# assign light output fraction if it exists
|
76
|
-
if @hash[:
|
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])
|
@@ -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])
|
data/lib/to_openstudio/model.rb
CHANGED
@@ -454,7 +454,7 @@ module Honeybee
|
|
454
454
|
end
|
455
455
|
end
|
456
456
|
|
457
|
-
# for rooms with setpoint objects
|
457
|
+
# for rooms with setpoint objects defined in the ProgramType, make a new thermostat
|
458
458
|
if room[:properties][:energy][:program_type] && !room[:properties][:energy][:setpoint]
|
459
459
|
thermal_zone = openstudio_room.thermalZone()
|
460
460
|
unless thermal_zone.empty?
|
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.
|
4
|
+
version: 2.29.3
|
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-
|
14
|
+
date: 2022-01-27 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
|