honeybee-openstudio 2.2.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -59,11 +59,11 @@ module FromHoneybee
59
59
  os_type_limit = OpenStudio::Model::ScheduleTypeLimits.new(openstudio_model)
60
60
  os_type_limit.setName(@hash[:identifier])
61
61
 
62
- if @hash[:lower_limit] != nil and @hash[:lower_limit] != {'type': 'NoLimit'}
62
+ if @hash[:lower_limit] != nil and @hash[:lower_limit] != {:type => 'NoLimit'}
63
63
  os_type_limit.setLowerLimitValue(@hash[:lower_limit])
64
64
  end
65
65
 
66
- if @hash[:upper_limit] != nil and @hash[:upper_limit] != {'type': 'NoLimit'}
66
+ if @hash[:upper_limit] != nil and @hash[:upper_limit] != {:type => 'NoLimit'}
67
67
  os_type_limit.setUpperLimitValue(@hash[:upper_limit])
68
68
  end
69
69
 
@@ -39,7 +39,7 @@ module FromHoneybee
39
39
  @@schema = nil
40
40
 
41
41
  def schema_file
42
- File.join(@lib_dir, 'from_honeybee', '_openapi', 'simulation-parameter.json')
42
+ File.join(@lib_dir, 'from_honeybee', '_defaults', 'simulation-parameter.json')
43
43
  end
44
44
 
45
45
  end
@@ -0,0 +1,160 @@
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 'from_honeybee/model_object'
33
+
34
+ require 'openstudio'
35
+
36
+ module FromHoneybee
37
+ class VentilationOpening < ModelObject
38
+ attr_reader :errors, :warnings
39
+
40
+ def initialize(hash = {})
41
+ super(hash)
42
+ end
43
+
44
+ def defaults
45
+ @@schema[:components][:schemas][:VentilationOpening][:properties]
46
+ end
47
+
48
+ def defaults_control
49
+ @@schema[:components][:schemas][:VentilationControlAbridged][:properties]
50
+ end
51
+
52
+ def to_openstudio(openstudio_model, parent, vent_control_hash)
53
+ # create wind and stack object and set identifier
54
+ os_opening = OpenStudio::Model::ZoneVentilationWindandStackOpenArea.new(openstudio_model)
55
+ os_opening.setName(parent.name.get + '_Opening')
56
+
57
+ # assign the opening area
58
+ if @hash[:fraction_area_operable]
59
+ os_opening.setOpeningArea(@hash[:fraction_area_operable] * parent.netArea)
60
+ else
61
+ os_opening.setOpeningArea(
62
+ defaults[:fraction_area_operable][:default] * parent.netArea)
63
+ end
64
+
65
+ # assign the height
66
+ if @hash[:fraction_height_operable]
67
+ os_opening. setHeightDifference(
68
+ @hash[:fraction_height_operable] * compute_height(parent))
69
+ else
70
+ os_opening. setHeightDifference(
71
+ defaults[:fraction_height_operable][:default] * compute_height(parent))
72
+ end
73
+
74
+ # assign the azimuth
75
+ az_degrees = parent.azimuth * 180 / Math::PI
76
+ os_opening.setEffectiveAngle(az_degrees.round())
77
+
78
+ # assign the discharge coefficient
79
+ if @hash[:discharge_coefficient]
80
+ os_opening.setDischargeCoefficientforOpening(@hash[:discharge_coefficient])
81
+ else
82
+ os_opening.setDischargeCoefficientforOpening(
83
+ defaults[:discharge_coefficient][:default])
84
+ end
85
+
86
+ # assign the wind pressure coefficient
87
+ if @hash[:wind_cross_vent]
88
+ os_opening.autocalculateOpeningEffectiveness()
89
+ else
90
+ os_opening.setOpeningEffectiveness(0)
91
+ end
92
+
93
+ # set all of the ventilation control properties
94
+ if vent_control_hash
95
+ # assign min_indoor_temperature
96
+ if vent_control_hash[:min_indoor_temperature]
97
+ os_opening.setMinimumIndoorTemperature(vent_control_hash[:min_indoor_temperature])
98
+ else
99
+ os_opening.setMinimumIndoorTemperature(
100
+ defaults_control[:min_indoor_temperature][:default])
101
+ end
102
+ # assign max_indoor_temperature
103
+ if vent_control_hash[:max_indoor_temperature]
104
+ os_opening.setMaximumIndoorTemperature(vent_control_hash[:max_indoor_temperature])
105
+ else
106
+ os_opening.setMaximumIndoorTemperature(
107
+ defaults_control[:max_indoor_temperature][:default])
108
+ end
109
+ # assign min_outdoor_temperature
110
+ if vent_control_hash[:min_outdoor_temperature]
111
+ os_opening.setMinimumOutdoorTemperature(vent_control_hash[:min_outdoor_temperature])
112
+ else
113
+ os_opening.setMinimumOutdoorTemperature(
114
+ defaults_control[:min_outdoor_temperature][:default])
115
+ end
116
+ # assign max_outdoor_temperature
117
+ if vent_control_hash[:max_outdoor_temperature]
118
+ os_opening.setMaximumOutdoorTemperature(vent_control_hash[:max_outdoor_temperature])
119
+ else
120
+ os_opening.setMaximumOutdoorTemperature(
121
+ defaults_control[:max_outdoor_temperature][:default])
122
+ end
123
+ # assign delta_temperature
124
+ if vent_control_hash[:delta_temperature]
125
+ os_opening.setDeltaTemperature(vent_control_hash[:delta_temperature])
126
+ else
127
+ os_opening.setDeltaTemperature(
128
+ defaults_control[:delta_temperature][:default])
129
+ end
130
+ # assign schedule if it exists
131
+ if vent_control_hash[:schedule]
132
+ vent_sch = openstudio_model.getScheduleByName(vent_control_hash[:schedule])
133
+ unless vent_sch.empty?
134
+ vent_sch_object = vent_sch.get
135
+ os_opening.setOpeningAreaFractionSchedule(vent_sch_object)
136
+ end
137
+ end
138
+ end
139
+
140
+ os_opening
141
+ end
142
+
143
+ def compute_height(surface)
144
+ # derive the height (difference in z values) of a surface
145
+ verts = surface.vertices
146
+ min_pt = verts[0].z
147
+ max_pt = verts[0].z
148
+ verts.each do |v|
149
+ if v.z < min_pt
150
+ min_pt = v.z
151
+ elsif v.z > max_pt
152
+ max_pt = v.z
153
+ end
154
+ end
155
+ max_pt - min_pt
156
+ end
157
+
158
+ end #VentilationOpening
159
+ end #FromHoneybee
160
+
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.2.0
4
+ version: 2.5.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: 2020-06-19 00:00:00.000000000 Z
14
+ date: 2020-08-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -149,6 +149,7 @@ extensions: []
149
149
  extra_rdoc_files: []
150
150
  files:
151
151
  - ".coveralls.yml"
152
+ - ".github/workflows/emit-release-event.yaml"
152
153
  - ".gitignore"
153
154
  - ".releaserc.json"
154
155
  - ".travis.yml"
@@ -165,8 +166,9 @@ files:
165
166
  - lib/files/honeybee_workflow.osw
166
167
  - lib/files/urbanopt_Gemfile
167
168
  - lib/from_honeybee.rb
168
- - lib/from_honeybee/_openapi/model.json
169
- - lib/from_honeybee/_openapi/simulation-parameter.json
169
+ - lib/from_honeybee/_defaults/energy_default.json
170
+ - lib/from_honeybee/_defaults/model.json
171
+ - lib/from_honeybee/_defaults/simulation-parameter.json
170
172
  - lib/from_honeybee/construction/air.rb
171
173
  - lib/from_honeybee/construction/opaque.rb
172
174
  - lib/from_honeybee/construction/shade.rb
@@ -179,7 +181,9 @@ files:
179
181
  - lib/from_honeybee/geometry/face.rb
180
182
  - lib/from_honeybee/geometry/room.rb
181
183
  - lib/from_honeybee/geometry/shade.rb
184
+ - lib/from_honeybee/hvac/Model.hvac.rb
182
185
  - lib/from_honeybee/hvac/ideal_air.rb
186
+ - lib/from_honeybee/hvac/template.rb
183
187
  - lib/from_honeybee/load/electric_equipment.rb
184
188
  - lib/from_honeybee/load/gas_equipment.rb
185
189
  - lib/from_honeybee/load/infiltration.rb
@@ -206,6 +210,7 @@ files:
206
210
  - lib/from_honeybee/simulation/designday.rb
207
211
  - lib/from_honeybee/simulation/extension.rb
208
212
  - lib/from_honeybee/simulation/parameter.rb
213
+ - lib/from_honeybee/ventcool/opening.rb
209
214
  - lib/measures/.gitkeep
210
215
  - lib/measures/from_honeybee_model/LICENSE.md
211
216
  - lib/measures/from_honeybee_model/README.md