honeybee-openstudio 2.4.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -46,8 +46,8 @@ module FromHoneybee
46
46
  end
47
47
 
48
48
  def defaults_control
49
- @@schema[:components][:schemas][:VentilationControlAbridged][:properties]
50
- end
49
+ @@schema[:components][:schemas][:VentilationControlAbridged][:properties]
50
+ end
51
51
 
52
52
  def to_openstudio(openstudio_model, parent, vent_control_hash)
53
53
  # create wind and stack object and set identifier
@@ -140,6 +140,48 @@ module FromHoneybee
140
140
  os_opening
141
141
  end
142
142
 
143
+ def to_openstudio_afn(openstudio_model, parent)
144
+ # process the flow_coefficient_closed and set it to a very small number if it's 0
145
+ if @hash[:flow_coefficient_closed] and @hash[:flow_coefficient_closed] != 0
146
+ flow_coefficient = @hash[:flow_coefficient_closed]
147
+ else
148
+ flow_coefficient = 1.0e-09 # set it to a very small number
149
+ end
150
+
151
+ # create the simple opening object for the Aperture or Door using default values
152
+ flow_exponent = defaults[:flow_exponent_closed][:default].to_f
153
+ two_way_thresh= defaults[:two_way_threshold][:default].to_f
154
+ discharge_coeff = defaults[:discharge_coefficient][:default].to_f
155
+ os_opening = OpenStudio::Model::AirflowNetworkSimpleOpening.new(
156
+ openstudio_model, flow_coefficient, flow_exponent, two_way_thresh, discharge_coeff)
157
+
158
+ # assign the flow exponent when the opening is closed
159
+ if @hash[:flow_exponent_closed]
160
+ os_opening.setAirMassFlowExponentWhenOpeningisClosed(@hash[:flow_exponent_closed])
161
+ end
162
+ # assign the minimum difference for two-way flow
163
+ if @hash[:two_way_threshold]
164
+ os_opening.setMinimumDensityDifferenceforTwoWayFlow(@hash[:two_way_threshold])
165
+ end
166
+ # assign the discharge coefficient
167
+ if @hash[:discharge_coefficient]
168
+ os_opening.setDischargeCoefficient(@hash[:discharge_coefficient])
169
+ end
170
+
171
+ # create the AirflowNetworkSurface
172
+ os_afn_srf = parent.getAirflowNetworkSurface(os_opening)
173
+
174
+ # assign the opening area
175
+ if @hash[:fraction_area_operable]
176
+ open_fac = @hash[:fraction_area_operable]
177
+ else
178
+ open_fac = defaults[:fraction_area_operable][:default]
179
+ end
180
+ os_afn_srf.setWindowDoorOpeningFactorOrCrackFactor(open_fac)
181
+
182
+ open_fac
183
+ end
184
+
143
185
  def compute_height(surface)
144
186
  # derive the height (difference in z values) of a surface
145
187
  verts = surface.vertices
@@ -152,7 +194,8 @@ module FromHoneybee
152
194
  max_pt = v.z
153
195
  end
154
196
  end
155
- max_pt - min_pt
197
+ # quarter the window height to get the height from midpoint of lower opening to neutral pressure level
198
+ (max_pt - min_pt) / 4
156
199
  end
157
200
 
158
201
  end #VentilationOpening
@@ -0,0 +1,110 @@
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 VentilationSimulationControl < ModelObject
38
+ attr_reader :errors, :warnings
39
+
40
+ def initialize(hash = {})
41
+ super(hash)
42
+ end
43
+
44
+ def defaults
45
+ @@schema[:components][:schemas][:VentilationSimulationControl][:properties]
46
+ end
47
+
48
+ def to_openstudio(openstudio_model)
49
+ # create the AirflowNetworkSimulationControl object
50
+ os_vsim_control = openstudio_model.getAirflowNetworkSimulationControl
51
+ os_vsim_control.setName('Window Based Ventilative Cooling')
52
+
53
+ # assign the control type
54
+ if @hash[:vent_control_type]
55
+ os_vsim_control.setAirflowNetworkControl(@hash[:vent_control_type])
56
+ else
57
+ os_vsim_control.setAirflowNetworkControl('MultizoneWithoutDistribution')
58
+ end
59
+
60
+ # assign the building type
61
+ if @hash[:building_type]
62
+ os_vsim_control.setBuildingType(@hash[:building_type])
63
+ else
64
+ os_vsim_control.setBuildingType(defaults[:building_type][:default])
65
+ end
66
+
67
+ # assign the long axis azimth angle of the building
68
+ if @hash[:long_axis_angle]
69
+ os_vsim_control.setAzimuthAngleofLongAxisofBuilding(@hash[:long_axis_angle])
70
+ else
71
+ os_vsim_control.setAzimuthAngleofLongAxisofBuilding(defaults[:long_axis_angle][:default])
72
+ end
73
+
74
+ # assign the aspect ratio of the building
75
+ if @hash[:aspect_ratio]
76
+ os_vsim_control.setBuildingAspectRatio(@hash[:aspect_ratio])
77
+ else
78
+ os_vsim_control.setBuildingAspectRatio(defaults[:aspect_ratio][:default])
79
+ end
80
+
81
+ # create the AirflowNetworkReferenceCrackConditions object that all other cracks reference
82
+ os_ref_crack = OpenStudio::Model::AirflowNetworkReferenceCrackConditions.new(openstudio_model)
83
+ os_ref_crack.setName('Reference Crack Conditions')
84
+
85
+ # assign the reference temperature
86
+ if @hash[:reference_temperature]
87
+ os_ref_crack.setTemperature(@hash[:reference_temperature])
88
+ else
89
+ os_ref_crack.setTemperature(defaults[:reference_temperature][:default])
90
+ end
91
+
92
+ # assign the reference pressure
93
+ if @hash[:reference_pressure]
94
+ os_ref_crack.setBarometricPressure(@hash[:reference_pressure])
95
+ else
96
+ os_ref_crack.setBarometricPressure(defaults[:reference_pressure][:default])
97
+ end
98
+
99
+ # assign the reference humidity ratio
100
+ if @hash[:reference_humidity_ratio]
101
+ os_ref_crack.setHumidityRatio(@hash[:reference_humidity_ratio])
102
+ else
103
+ os_ref_crack.setHumidityRatio(defaults[:reference_humidity_ratio][:default])
104
+ end
105
+
106
+ os_ref_crack
107
+ end
108
+
109
+ end #VentilationSimulationControl
110
+ end #FromHoneybee
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.0
4
+ version: 2.6.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-07-20 00:00:00.000000000 Z
14
+ date: 2020-09-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -181,7 +181,9 @@ files:
181
181
  - lib/from_honeybee/geometry/face.rb
182
182
  - lib/from_honeybee/geometry/room.rb
183
183
  - lib/from_honeybee/geometry/shade.rb
184
+ - lib/from_honeybee/hvac/Model.hvac.rb
184
185
  - lib/from_honeybee/hvac/ideal_air.rb
186
+ - lib/from_honeybee/hvac/template.rb
185
187
  - lib/from_honeybee/load/electric_equipment.rb
186
188
  - lib/from_honeybee/load/gas_equipment.rb
187
189
  - lib/from_honeybee/load/infiltration.rb
@@ -208,7 +210,9 @@ files:
208
210
  - lib/from_honeybee/simulation/designday.rb
209
211
  - lib/from_honeybee/simulation/extension.rb
210
212
  - lib/from_honeybee/simulation/parameter.rb
213
+ - lib/from_honeybee/ventcool/control.rb
211
214
  - lib/from_honeybee/ventcool/opening.rb
215
+ - lib/from_honeybee/ventcool/simulation.rb
212
216
  - lib/measures/.gitkeep
213
217
  - lib/measures/from_honeybee_model/LICENSE.md
214
218
  - lib/measures/from_honeybee_model/README.md