honeybee-openstudio 2.11.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/honeybee-openstudio.gemspec +1 -1
- data/lib/files/Honeybee.rb +28 -17
- data/lib/files/urbanopt_Gemfile +1 -1
- data/lib/honeybee.rb +1 -0
- data/lib/honeybee/_defaults/model.json +278 -175
- data/lib/honeybee/_defaults/simulation-parameter.json +1 -1
- data/lib/honeybee/load/daylight.rb +42 -0
- data/lib/to_openstudio.rb +1 -0
- data/lib/to_openstudio/geometry/room.rb +6 -0
- data/lib/to_openstudio/hvac/Model.hvac.rb +124 -166
- data/lib/to_openstudio/hvac/template.rb +47 -3
- data/lib/to_openstudio/load/daylight.rb +100 -0
- metadata +10 -93
@@ -35,6 +35,14 @@ require 'to_openstudio/model_object'
|
|
35
35
|
|
36
36
|
module Honeybee
|
37
37
|
class TemplateHVAC
|
38
|
+
@@vintage_mapper = {
|
39
|
+
DOE_Ref_Pre_1980: 'DOE Ref Pre-1980',
|
40
|
+
DOE_Ref_1980_2004: 'DOE Ref 1980-2004',
|
41
|
+
ASHRAE_2004: '90.1-2004',
|
42
|
+
ASHRAE_2007: '90.1-2007',
|
43
|
+
ASHRAE_2010: '90.1-2010',
|
44
|
+
ASHRAE_2013: '90.1-2013'
|
45
|
+
}
|
38
46
|
|
39
47
|
def to_openstudio(openstudio_model, room_ids)
|
40
48
|
|
@@ -47,9 +55,9 @@ module Honeybee
|
|
47
55
|
|
48
56
|
# make the standard applier
|
49
57
|
if @hash[:vintage]
|
50
|
-
standard = Standard.build(@hash[:vintage])
|
58
|
+
standard = Standard.build(@@vintage_mapper[@hash[:vintage].to_sym])
|
51
59
|
else
|
52
|
-
standard = Standard.build(hvac_defaults[:vintage][:default])
|
60
|
+
standard = Standard.build(@@vintage_mapper[hvac_defaults[:vintage][:default].to_sym])
|
53
61
|
end
|
54
62
|
|
55
63
|
# get the default equipment type
|
@@ -120,7 +128,43 @@ module Honeybee
|
|
120
128
|
erv.setLatentEffectivenessat75HeatingAirFlow(@hash[:latent_heat_recovery])
|
121
129
|
end
|
122
130
|
|
123
|
-
#
|
131
|
+
# if the systems are PTAC and there is ventilation, ensure the system includes it
|
132
|
+
if equipment_type.include?('PTAC') || equipment_type.include?('PTHP')
|
133
|
+
always_on = openstudio_model.getScheduleByName('Always On').get
|
134
|
+
zones.each do |zone|
|
135
|
+
# check if the space type has ventilation assigned to it
|
136
|
+
out_air = zone.spaces[0].designSpecificationOutdoorAir
|
137
|
+
unless out_air.empty?
|
138
|
+
# get any ventilation schedules
|
139
|
+
vent_sched = always_on
|
140
|
+
out_air = out_air.get
|
141
|
+
air_sch = out_air.outdoorAirFlowRateFractionSchedule
|
142
|
+
unless air_sch.empty?
|
143
|
+
vent_sched = air_sch.get
|
144
|
+
end
|
145
|
+
# get the PTAC object
|
146
|
+
ptac = nil
|
147
|
+
zone.equipment.each do |equip|
|
148
|
+
e_name = equip.name
|
149
|
+
unless e_name.empty?
|
150
|
+
e_name = e_name.get
|
151
|
+
if e_name.include? 'PTAC'
|
152
|
+
ptac = openstudio_model.getZoneHVACPackagedTerminalAirConditioner(equip.handle)
|
153
|
+
elsif e_name.include? 'PTHP'
|
154
|
+
ptac = openstudio_model.getZoneHVACPackagedTerminalHeatPump(equip.handle)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
# assign the schedule to the PTAC object
|
159
|
+
unless ptac.nil? || ptac.empty?
|
160
|
+
ptac = ptac.get
|
161
|
+
ptac.setSupplyAirFanOperatingModeSchedule(vent_sched)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# set all plants to non-coincident sizing to avoid simualtion control issues on design days
|
124
168
|
openstudio_model.getPlantLoops.each do |loop|
|
125
169
|
sizing = loop.sizingPlant
|
126
170
|
sizing.setSizingOption('NonCoincident')
|
@@ -0,0 +1,100 @@
|
|
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
|
+
|
34
|
+
require 'to_openstudio/model_object'
|
35
|
+
|
36
|
+
module Honeybee
|
37
|
+
class DaylightingControl
|
38
|
+
|
39
|
+
def find_existing_openstudio_object(openstudio_model, parent_space_name)
|
40
|
+
dl_cntrl_name = parent_space_name + '_Daylighting'
|
41
|
+
model_dl_cntrl = openstudio_model.getDaylightingControlByName(dl_cntrl_name)
|
42
|
+
return model_dl_cntrl.get unless model_dl_cntrl.empty?
|
43
|
+
nil
|
44
|
+
end
|
45
|
+
|
46
|
+
def to_openstudio(openstudio_model, parent_zone, parent_space)
|
47
|
+
# create daylighting control openstudio object and set identifier
|
48
|
+
os_dl_control = OpenStudio::Model::DaylightingControl.new(openstudio_model)
|
49
|
+
space_name = parent_space.name
|
50
|
+
unless space_name.empty?
|
51
|
+
os_dl_control.setName(parent_space.name.get + '_Daylighting')
|
52
|
+
end
|
53
|
+
os_dl_control.setSpace(parent_space)
|
54
|
+
parent_zone.setPrimaryDaylightingControl(os_dl_control)
|
55
|
+
|
56
|
+
# assign the position of the sensor point
|
57
|
+
os_dl_control.setPositionXCoordinate(@hash[:sensor_position][0])
|
58
|
+
os_dl_control.setPositionYCoordinate(@hash[:sensor_position][1])
|
59
|
+
os_dl_control.setPositionZCoordinate(@hash[:sensor_position][2])
|
60
|
+
|
61
|
+
# assign the illuminance setpoint if it exists
|
62
|
+
if @hash[:illuminance_setpoint]
|
63
|
+
os_dl_control.setIlluminanceSetpoint(@hash[:illuminance_setpoint])
|
64
|
+
else
|
65
|
+
os_dl_control.setIlluminanceSetpoint(defaults[:illuminance_setpoint][:default])
|
66
|
+
end
|
67
|
+
|
68
|
+
# assign power fraction if it exists
|
69
|
+
if @hash[:min_power_input]
|
70
|
+
os_dl_control.setMinimumInputPowerFractionforContinuousDimmingControl(@hash[:min_power_input])
|
71
|
+
else
|
72
|
+
os_dl_control.setMinimumInputPowerFractionforContinuousDimmingControl(defaults[:min_power_input][:default])
|
73
|
+
end
|
74
|
+
|
75
|
+
# assign light output fraction if it exists
|
76
|
+
if @hash[:min_power_input]
|
77
|
+
os_dl_control.setMinimumLightOutputFractionforContinuousDimmingControl(@hash[:min_light_output])
|
78
|
+
else
|
79
|
+
os_dl_control.setMinimumLightOutputFractionforContinuousDimmingControl(defaults[:min_light_output][:default])
|
80
|
+
end
|
81
|
+
|
82
|
+
# set whether the lights go off when they reach their minimum
|
83
|
+
if @hash[:off_at_minimum]
|
84
|
+
os_dl_control.setLightingControlType('Continuous/Off')
|
85
|
+
else
|
86
|
+
os_dl_control.setLightingControlType('Continuous')
|
87
|
+
end
|
88
|
+
|
89
|
+
# set the fraction of the zone lights that are dimmed
|
90
|
+
if @hash[:control_fraction]
|
91
|
+
parent_zone.setFractionofZoneControlledbyPrimaryDaylightingControl(@hash[:control_fraction])
|
92
|
+
else
|
93
|
+
parent_zone.setFractionofZoneControlledbyPrimaryDaylightingControl(defaults[:control_fraction][:default])
|
94
|
+
end
|
95
|
+
|
96
|
+
os_dl_control
|
97
|
+
end
|
98
|
+
|
99
|
+
end #DaylightingControl
|
100
|
+
end #Honeybee
|
metadata
CHANGED
@@ -1,102 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeybee-openstudio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanushree Charan
|
8
8
|
- Dan Macumber
|
9
9
|
- Chris Mackey
|
10
10
|
- Mostapha Sadeghipour Roudsari
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-
|
14
|
+
date: 2021-03-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
17
|
-
name: bundler
|
18
|
-
requirement: !ruby/object:Gem::Requirement
|
19
|
-
requirements:
|
20
|
-
- - "~>"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '2.1'
|
23
|
-
type: :development
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '2.1'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: public_suffix
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
requirements:
|
34
|
-
- - "~>"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 3.1.1
|
37
|
-
type: :development
|
38
|
-
prerelease: false
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - "~>"
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 3.1.1
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
|
-
name: json-schema
|
46
|
-
requirement: !ruby/object:Gem::Requirement
|
47
|
-
requirements:
|
48
|
-
- - "~>"
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 2.8.1
|
51
|
-
type: :development
|
52
|
-
prerelease: false
|
53
|
-
version_requirements: !ruby/object:Gem::Requirement
|
54
|
-
requirements:
|
55
|
-
- - "~>"
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: 2.8.1
|
58
|
-
- !ruby/object:Gem::Dependency
|
59
|
-
name: rake
|
60
|
-
requirement: !ruby/object:Gem::Requirement
|
61
|
-
requirements:
|
62
|
-
- - "~>"
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: '13.0'
|
65
|
-
type: :development
|
66
|
-
prerelease: false
|
67
|
-
version_requirements: !ruby/object:Gem::Requirement
|
68
|
-
requirements:
|
69
|
-
- - "~>"
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
version: '13.0'
|
72
|
-
- !ruby/object:Gem::Dependency
|
73
|
-
name: rspec
|
74
|
-
requirement: !ruby/object:Gem::Requirement
|
75
|
-
requirements:
|
76
|
-
- - "~>"
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: '3.9'
|
79
|
-
type: :development
|
80
|
-
prerelease: false
|
81
|
-
version_requirements: !ruby/object:Gem::Requirement
|
82
|
-
requirements:
|
83
|
-
- - "~>"
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '3.9'
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: rubocop
|
88
|
-
requirement: !ruby/object:Gem::Requirement
|
89
|
-
requirements:
|
90
|
-
- - "~>"
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: 0.54.0
|
93
|
-
type: :development
|
94
|
-
prerelease: false
|
95
|
-
version_requirements: !ruby/object:Gem::Requirement
|
96
|
-
requirements:
|
97
|
-
- - "~>"
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: 0.54.0
|
100
16
|
- !ruby/object:Gem::Dependency
|
101
17
|
name: json_pure
|
102
18
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,6 +112,7 @@ files:
|
|
196
112
|
- lib/honeybee/geometry/shade.rb
|
197
113
|
- lib/honeybee/hvac/ideal_air.rb
|
198
114
|
- lib/honeybee/hvac/template.rb
|
115
|
+
- lib/honeybee/load/daylight.rb
|
199
116
|
- lib/honeybee/load/electric_equipment.rb
|
200
117
|
- lib/honeybee/load/gas_equipment.rb
|
201
118
|
- lib/honeybee/load/infiltration.rb
|
@@ -252,6 +169,7 @@ files:
|
|
252
169
|
- lib/to_openstudio/hvac/Model.hvac.rb
|
253
170
|
- lib/to_openstudio/hvac/ideal_air.rb
|
254
171
|
- lib/to_openstudio/hvac/template.rb
|
172
|
+
- lib/to_openstudio/load/daylight.rb
|
255
173
|
- lib/to_openstudio/load/electric_equipment.rb
|
256
174
|
- lib/to_openstudio/load/gas_equipment.rb
|
257
175
|
- lib/to_openstudio/load/infiltration.rb
|
@@ -284,24 +202,23 @@ files:
|
|
284
202
|
homepage: https://github.com/ladybug-tools/honeybee-openstudio-gem
|
285
203
|
licenses: []
|
286
204
|
metadata: {}
|
287
|
-
post_install_message:
|
205
|
+
post_install_message:
|
288
206
|
rdoc_options: []
|
289
207
|
require_paths:
|
290
208
|
- lib
|
291
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
292
210
|
requirements:
|
293
|
-
- - "
|
211
|
+
- - ">="
|
294
212
|
- !ruby/object:Gem::Version
|
295
|
-
version:
|
213
|
+
version: '0'
|
296
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
297
215
|
requirements:
|
298
216
|
- - ">="
|
299
217
|
- !ruby/object:Gem::Version
|
300
218
|
version: '0'
|
301
219
|
requirements: []
|
302
|
-
|
303
|
-
|
304
|
-
signing_key:
|
220
|
+
rubygems_version: 3.1.2
|
221
|
+
signing_key:
|
305
222
|
specification_version: 4
|
306
223
|
summary: Gem for translating between Honeybee JSON and OpenStudio Model.
|
307
224
|
test_files: []
|