honeybee-openstudio 2.5.1 → 2.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.5.1
4
+ version: 2.6.2
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-08-08 00:00:00.000000000 Z
14
+ date: 2020-09-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -210,7 +210,9 @@ files:
210
210
  - lib/from_honeybee/simulation/designday.rb
211
211
  - lib/from_honeybee/simulation/extension.rb
212
212
  - lib/from_honeybee/simulation/parameter.rb
213
+ - lib/from_honeybee/ventcool/control.rb
213
214
  - lib/from_honeybee/ventcool/opening.rb
215
+ - lib/from_honeybee/ventcool/simulation.rb
214
216
  - lib/measures/.gitkeep
215
217
  - lib/measures/from_honeybee_model/LICENSE.md
216
218
  - lib/measures/from_honeybee_model/README.md