openstudio-standards 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,96 +1,23 @@
1
1
 
2
2
  # Reopen the OpenStudio class to add methods to apply standards to this object
3
3
  class OpenStudio::Model::CoilCoolingDXTwoSpeed
4
- # Finds the search criteria
5
- #
6
- # @param template [String] valid choices: 'DOE Ref Pre-1980', 'DOE Ref 1980-2004', '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013'
7
- # @return [hash] has for search criteria to be used for find object
8
- def find_search_criteria(template)
9
- # Define the criteria to find the chiller properties
10
- # in the hvac standards data set.
11
- search_criteria = {}
12
- search_criteria['template'] = template
13
- cooling_type = condenserType
14
- search_criteria['cooling_type'] = cooling_type
15
-
16
- # Determine the heating type if unitary or zone hvac
17
- heat_pump = false
18
- heating_type = nil
19
- if airLoopHVAC.empty?
20
- if containingHVACComponent.is_initialized
21
- containing_comp = containingHVACComponent.get
22
- if containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.is_initialized
23
- heat_pump = true
24
- heating_type = 'Electric Resistance or None'
25
- end # TODO: Add other unitary systems
26
- elsif containingZoneHVACComponent.is_initialized
27
- containing_comp = containingZoneHVACComponent.get
28
- if containing_comp.to_ZoneHVACPackagedTerminalAirConditioner.is_initialized
29
- htg_coil = containing_comp.to_ZoneHVACPackagedTerminalAirConditioner.get.heatingCoil
30
- if htg_coil.to_CoilHeatingElectric.is_initialized
31
- heating_type = 'Electric Resistance or None'
32
- elsif htg_coil.to_CoilHeatingWater.is_initialized || htg_coil.to_CoilHeatingGas.is_initialized
33
- heating_type = 'All Other'
34
- end
35
- end # TODO: Add other zone hvac systems
36
- end
37
- end
38
-
39
- # Determine the heating type if on an airloop
40
- if airLoopHVAC.is_initialized
41
- air_loop = airLoopHVAC.get
42
- heating_type = if !air_loop.supplyComponents('OS:Coil:Heating:Electric'.to_IddObjectType).empty?
43
- 'Electric Resistance or None'
44
- elsif !air_loop.supplyComponents('OS:Coil:Heating:Gas'.to_IddObjectType).empty?
45
- 'All Other'
46
- elsif !air_loop.supplyComponents('OS:Coil:Heating:Water'.to_IddObjectType).empty?
47
- 'All Other'
48
- elsif !air_loop.supplyComponents('OS:Coil:Heating:DX:SingleSpeed'.to_IddObjectType).empty?
49
- 'All Other'
50
- elsif !air_loop.supplyComponents('OS:Coil:Heating:Gas:MultiStage'.to_IddObjectType).empty?
51
- 'All Other'
52
- elsif !air_loop.supplyComponents('OS:Coil:Heating:Desuperheater'.to_IddObjectType).empty?
53
- 'All Other'
54
- elsif !air_loop.supplyComponents('OS:Coil:Heating:WaterToAirHeatPump:EquationFit'.to_IddObjectType).empty?
55
- 'All Other'
56
- else
57
- 'Electric Resistance or None'
58
- end
59
- end
60
-
61
- # Add the heating type to the search criteria
62
- unless heating_type.nil?
63
- search_criteria['heating_type'] = heating_type
64
- end
4
+ include CoilDX
65
5
 
66
- # TODO: Standards - add split system vs single package to model
67
- # For now, assume single package
68
- subcategory = 'Single Package'
69
- search_criteria['subcategory'] = subcategory
70
-
71
- return search_criteria
72
- end
73
-
74
- # Finds capacity in tons
6
+ # Finds capacity in W
75
7
  #
76
- # @return [Double] capacity in tons to be used for find object
8
+ # @return [Double] capacity in W to be used for find object
77
9
  def find_capacity
78
- # Get the coil capacity
79
10
  capacity_w = nil
80
11
  if ratedHighSpeedTotalCoolingCapacity.is_initialized
81
12
  capacity_w = ratedHighSpeedTotalCoolingCapacity.get
82
13
  elsif autosizedRatedHighSpeedTotalCoolingCapacity.is_initialized
83
14
  capacity_w = autosizedRatedHighSpeedTotalCoolingCapacity.get
84
15
  else
85
- # OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{self.name} capacity is not available, cannot apply efficiency standard.")
86
- successfully_set_all_properties = false
87
- return successfully_set_all_properties
16
+ OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{self.name} capacity is not available, cannot apply efficiency standard.")
17
+ return 0.0
88
18
  end
89
19
 
90
- # Convert capacity to Btu/hr
91
- capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
92
-
93
- return capacity_btu_per_hr
20
+ return capacity_w
94
21
  end
95
22
 
96
23
  # Finds lookup object in standards and return efficiency
@@ -98,16 +25,29 @@ class OpenStudio::Model::CoilCoolingDXTwoSpeed
98
25
  # @param template [String] valid choices: 'DOE Ref Pre-1980', 'DOE Ref 1980-2004', '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013'
99
26
  # @param standards [Hash] the OpenStudio_Standards spreadsheet in hash format
100
27
  # @return [Double] full load efficiency (COP)
101
- def standard_minimum_cop(template, standards)
102
- # find ac properties
28
+ def standard_minimum_cop(template, rename=false)
103
29
  search_criteria = find_search_criteria(template)
104
30
  cooling_type = search_criteria['cooling_type']
105
31
  heating_type = search_criteria['heating_type']
106
- subcategory = search_criteria['subcategory']
107
- capacity_btu_per_hr = find_capacity
108
- capacity_kbtu_per_hr = OpenStudio.convert(capacity_btu_per_hr, 'Btu/hr', 'kBtu/hr').get
32
+ sub_category = search_criteria['subcategory']
33
+ capacity_w = find_capacity
34
+ capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
35
+ capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get
109
36
 
110
- ac_props = model.find_object(standards['unitary_acs'], search_criteria, capacity_btu_per_hr, Date.today)
37
+ # Lookup efficiencies depending on whether it is a unitary AC or a heat pump
38
+ ac_props = nil
39
+ ac_props = if heat_pump?
40
+ model.find_object($os_standards['heat_pumps'], search_criteria, capacity_btu_per_hr, Date.today)
41
+ else
42
+ model.find_object($os_standards['unitary_acs'], search_criteria, capacity_btu_per_hr, Date.today)
43
+ end
44
+
45
+ # Check to make sure properties were found
46
+ if ac_props.nil?
47
+ OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXTwoSpeed', "For #{name}, cannot find efficiency info, cannot apply efficiency standard.")
48
+ successfully_set_all_properties = false
49
+ return successfully_set_all_properties
50
+ end
111
51
 
112
52
  # Get the minimum efficiency standards
113
53
  cop = nil
@@ -122,28 +62,37 @@ class OpenStudio::Model::CoilCoolingDXTwoSpeed
122
62
  unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
123
63
  min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
124
64
  cop = seer_to_cop_cooling_no_fan(min_seer)
125
- OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXTwoSpeed', "For #{template}: #{name}: #{cooling_type} #{heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
65
+ new_comp_name = "#{name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
66
+ OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{name}: #{cooling_type} #{heating_type} #{sub_category} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
126
67
  end
127
68
 
128
69
  # If specified as EER
129
70
  unless ac_props['minimum_energy_efficiency_ratio'].nil?
130
71
  min_eer = ac_props['minimum_energy_efficiency_ratio']
131
72
  cop = eer_to_cop(min_eer, OpenStudio.convert(capacity_kbtu_per_hr, 'kBtu/hr', 'W').get)
132
- OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXTwoSpeed', "For #{template}: #{name}: #{cooling_type} #{heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
73
+ new_comp_name = "#{name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
74
+ OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{name}: #{cooling_type} #{heating_type} #{sub_category} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
133
75
  end
134
76
 
135
77
  # if specified as SEER (heat pump)
136
78
  unless ac_props['minimum_seasonal_efficiency'].nil?
137
79
  min_seer = ac_props['minimum_seasonal_efficiency']
138
80
  cop = seer_to_cop_cooling_no_fan(min_seer)
139
- OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{name}: #{cooling_type} #{heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
81
+ new_comp_name = "#{name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
82
+ OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{name}: #{cooling_type} #{heating_type} #{sub_category} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
140
83
  end
141
84
 
142
85
  # If specified as EER (heat pump)
143
86
  unless ac_props['minimum_full_load_efficiency'].nil?
144
87
  min_eer = ac_props['minimum_full_load_efficiency']
145
88
  cop = eer_to_cop(min_eer, OpenStudio.convert(capacity_kbtu_per_hr, 'kBtu/hr', 'W').get)
146
- OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{name}: #{cooling_type} #{heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
89
+ new_comp_name = "#{name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
90
+ OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{name}: #{cooling_type} #{heating_type} #{sub_category} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
91
+ end
92
+
93
+ # Rename
94
+ if rename
95
+ setName(new_comp_name)
147
96
  end
148
97
 
149
98
  return cop
@@ -154,96 +103,30 @@ class OpenStudio::Model::CoilCoolingDXTwoSpeed
154
103
  # @param template [String] valid choices: 'DOE Ref Pre-1980', 'DOE Ref 1980-2004', '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013'
155
104
  # @param standards [Hash] the OpenStudio_Standards spreadsheet in hash format
156
105
  # @return [Bool] true if successful, false if not
157
- def apply_efficiency_and_curves(template)
106
+ def apply_efficiency_and_curves(template, sql_db_vars_map)
158
107
  successfully_set_all_properties = true
159
108
 
160
- unitary_acs = $os_standards['unitary_acs']
161
-
162
- # Define the criteria to find the chiller properties
163
- # in the hvac standards data set.
164
- search_criteria = {}
165
- search_criteria['template'] = template
166
- cooling_type = condenserType
167
- search_criteria['cooling_type'] = cooling_type
168
-
169
- # Determine the heating type if unitary or zone hvac
170
- heat_pump = false
171
- heating_type = nil
172
- if airLoopHVAC.empty?
173
- if containingHVACComponent.is_initialized
174
- containing_comp = containingHVACComponent.get
175
- if containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.is_initialized
176
- heat_pump = true
177
- heating_type = 'Electric Resistance or None'
178
- end # TODO: Add other unitary systems
179
- elsif containingZoneHVACComponent.is_initialized
180
- containing_comp = containingZoneHVACComponent.get
181
- if containing_comp.to_ZoneHVACPackagedTerminalAirConditioner.is_initialized
182
- htg_coil = containing_comp.to_ZoneHVACPackagedTerminalAirConditioner.get.heatingCoil
183
- if htg_coil.to_CoilHeatingElectric.is_initialized
184
- heating_type = 'Electric Resistance or None'
185
- elsif htg_coil.to_CoilHeatingWater.is_initialized || htg_coil.to_CoilHeatingGas.is_initialized
186
- heating_type = 'All Other'
187
- end
188
- end # TODO: Add other zone hvac systems
189
- end
190
- end
191
-
192
- # Determine the heating type if on an airloop
193
- if airLoopHVAC.is_initialized
194
- air_loop = airLoopHVAC.get
195
- heating_type = if !air_loop.supplyComponents('OS:Coil:Heating:Electric'.to_IddObjectType).empty?
196
- 'Electric Resistance or None'
197
- elsif !air_loop.supplyComponents('OS:Coil:Heating:Gas'.to_IddObjectType).empty?
198
- 'All Other'
199
- elsif !air_loop.supplyComponents('OS:Coil:Heating:Water'.to_IddObjectType).empty?
200
- 'All Other'
201
- elsif !air_loop.supplyComponents('OS:Coil:Heating:DX:SingleSpeed'.to_IddObjectType).empty?
202
- 'All Other'
203
- elsif !air_loop.supplyComponents('OS:Coil:Heating:Gas:MultiStage'.to_IddObjectType).empty?
204
- 'All Other'
205
- elsif !air_loop.supplyComponents('OS:Coil:Heating:Desuperheater'.to_IddObjectType).empty?
206
- 'All Other'
207
- elsif !air_loop.supplyComponents('OS:Coil:Heating:WaterToAirHeatPump:EquationFit'.to_IddObjectType).empty?
208
- 'All Other'
209
- else
210
- 'Electric Resistance or None'
211
- end
212
- end
213
-
214
- # Add the heating type to the search criteria
215
- unless heating_type.nil?
216
- search_criteria['heating_type'] = heating_type
217
- end
218
-
219
- # TODO: Standards - add split system vs single package to model
220
- # For now, assume single package
221
- subcategory = 'Single Package'
222
- search_criteria['subcategory'] = subcategory
223
-
224
- # Get the coil capacity
225
- capacity_w = nil
226
- if ratedHighSpeedTotalCoolingCapacity.is_initialized
227
- capacity_w = ratedHighSpeedTotalCoolingCapacity.get
228
- elsif autosizedRatedHighSpeedTotalCoolingCapacity.is_initialized
229
- capacity_w = autosizedRatedHighSpeedTotalCoolingCapacity.get
230
- else
231
- # OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{self.name} capacity is not available, cannot apply efficiency standard.")
232
- successfully_set_all_properties = false
233
- return successfully_set_all_properties
234
- end
109
+ # Get the search criteria
110
+ search_criteria = find_search_criteria(template)
235
111
 
236
- # Convert capacity to Btu/hr
112
+ # Get the capacity
113
+ capacity_w = find_capacity
237
114
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
238
115
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get
239
116
 
240
- ac_props = model.find_object(unitary_acs, search_criteria, capacity_btu_per_hr, Date.today)
117
+ # Lookup efficiencies depending on whether it is a unitary AC or a heat pump
118
+ ac_props = nil
119
+ ac_props = if heat_pump?
120
+ model.find_object($os_standards['heat_pumps'], search_criteria, capacity_btu_per_hr, Date.today)
121
+ else
122
+ model.find_object($os_standards['unitary_acs'], search_criteria, capacity_btu_per_hr, Date.today)
123
+ end
241
124
 
242
125
  # Check to make sure properties were found
243
126
  if ac_props.nil?
244
127
  OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXTwoSpeed', "For #{name}, cannot find efficiency info, cannot apply efficiency standard.")
245
128
  successfully_set_all_properties = false
246
- return successfully_set_all_properties
129
+ return sql_db_vars_map
247
130
  end
248
131
 
249
132
  # Make the total COOL-CAP-FT curve
@@ -309,29 +192,21 @@ class OpenStudio::Model::CoilCoolingDXTwoSpeed
309
192
  successfully_set_all_properties = false
310
193
  end
311
194
 
312
- # Get the minimum efficiency standards
313
- cop = nil
195
+ # Preserve the original name
196
+ orig_name = name.to_s
314
197
 
315
- # If specified as SEER
316
- unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
317
- min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
318
- cop = seer_to_cop_cooling_no_fan(min_seer)
319
- setName("#{name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER")
320
- OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXTwoSpeed', "For #{template}: #{name}: #{cooling_type} #{heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
321
- end
198
+ # Find the minimum COP and rename with efficiency rating
199
+ cop = standard_minimum_cop(template, true)
322
200
 
323
- # If specified as EER
324
- unless ac_props['minimum_energy_efficiency_ratio'].nil?
325
- min_eer = ac_props['minimum_energy_efficiency_ratio']
326
- cop = eer_to_cop(min_eer, OpenStudio.convert(capacity_kbtu_per_hr, 'kBtu/hr', 'W').get)
327
- setName("#{name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER")
328
- OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXTwoSpeed', "For #{template}: #{name}: #{cooling_type} #{heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
329
- end
201
+ # Map the original name to the new name
202
+ sql_db_vars_map[name.to_s] = orig_name
330
203
 
331
204
  # Set the efficiency values
332
- setRatedHighSpeedCOP(cop)
333
- setRatedLowSpeedCOP(cop)
205
+ unless cop.nil?
206
+ setRatedHighSpeedCOP(cop)
207
+ setRatedLowSpeedCOP(cop)
208
+ end
334
209
 
335
- return true
210
+ return sql_db_vars_map
336
211
  end
337
212
  end
@@ -0,0 +1,150 @@
1
+
2
+ # A variety of DX coil methods that are the same regardless of coil type.
3
+ # These methods are available to:
4
+ # CoilCoolingDXSingleSpeed, CoilCoolingDXTwoSpeed, CoilCoolingDXMultiSpeed
5
+ module CoilDX
6
+ # Finds the subcategory. Possible choices are:
7
+ # Single Package, Split System, PTAC, or PTHP
8
+ #
9
+ # @return [String] the subcategory
10
+ # @todo Add add split system vs single package to model object
11
+ def subcategory
12
+ sub_category = 'Single Package'
13
+
14
+ if airLoopHVAC.empty?
15
+ if containingZoneHVACComponent.is_initialized
16
+ containing_comp = containingZoneHVACComponent.get
17
+ # PTAC
18
+ if containing_comp.to_ZoneHVACPackagedTerminalAirConditioner.is_initialized
19
+ sub_category = 'PTAC'
20
+ # PTHP
21
+ elsif containing_comp.to_ZoneHVACPackagedTerminalHeatPump.is_initialized
22
+ sub_category = 'PTHP'
23
+ end # TODO: Add other zone hvac systems
24
+ end
25
+ end
26
+
27
+ return sub_category
28
+ end
29
+
30
+ # Determine if it is a heat pump
31
+ # @return [Bool] true if it is a heat pump, false if not
32
+ def heat_pump?
33
+ heat_pump = false
34
+
35
+ heating_type = nil
36
+ if airLoopHVAC.empty?
37
+ if containingHVACComponent.is_initialized
38
+ containing_comp = containingHVACComponent.get
39
+ if containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.is_initialized
40
+ heat_pump = true
41
+ end # TODO: Add other unitary systems
42
+ elsif containingZoneHVACComponent.is_initialized
43
+ containing_comp = containingZoneHVACComponent.get
44
+ # PTHP
45
+ if containing_comp.to_ZoneHVACPackagedTerminalHeatPump.is_initialized
46
+ heat_pump = true
47
+ end # TODO: Add other zone hvac systems
48
+ end
49
+ end
50
+
51
+ return heat_pump
52
+ end
53
+
54
+ # Determine the heating type. Possible choices are:
55
+ # Electric Resistance or None, All Other
56
+ # @return [String] the heating type
57
+ def heating_type
58
+ htg_type = nil
59
+
60
+ # If Unitary or Zone HVAC
61
+ if airLoopHVAC.empty?
62
+ if containingHVACComponent.is_initialized
63
+ containing_comp = containingHVACComponent.get
64
+ if containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.is_initialized
65
+ htg_type = 'Electric Resistance or None'
66
+ end # TODO: Add other unitary systems
67
+ elsif containingZoneHVACComponent.is_initialized
68
+ containing_comp = containingZoneHVACComponent.get
69
+ # PTAC
70
+ if containing_comp.to_ZoneHVACPackagedTerminalAirConditioner.is_initialized
71
+ htg_coil = containing_comp.to_ZoneHVACPackagedTerminalAirConditioner.get.heatingCoil
72
+ if htg_coil.to_CoilHeatingElectric.is_initialized
73
+ htg_type = 'Electric Resistance or None'
74
+ elsif htg_coil.to_CoilHeatingWater.is_initialized || htg_coil.to_CoilHeatingGas.is_initialized
75
+ htg_type = 'All Other'
76
+ end
77
+ # PTHP
78
+ elsif containing_comp.to_ZoneHVACPackagedTerminalHeatPump.is_initialized
79
+ htg_type = 'Electric Resistance or None'
80
+ end # TODO: Add other zone hvac systems
81
+
82
+ end
83
+ end
84
+
85
+ # If on an AirLoop
86
+ if airLoopHVAC.is_initialized
87
+ air_loop = airLoopHVAC.get
88
+ htg_type = if !air_loop.supplyComponents('OS:Coil:Heating:Electric'.to_IddObjectType).empty?
89
+ 'Electric Resistance or None'
90
+ elsif !air_loop.supplyComponents('OS:Coil:Heating:Gas'.to_IddObjectType).empty?
91
+ 'All Other'
92
+ elsif !air_loop.supplyComponents('OS:Coil:Heating:Water'.to_IddObjectType).empty?
93
+ 'All Other'
94
+ elsif !air_loop.supplyComponents('OS:Coil:Heating:DX:SingleSpeed'.to_IddObjectType).empty?
95
+ 'All Other'
96
+ elsif !air_loop.supplyComponents('OS:Coil:Heating:Gas:MultiStage'.to_IddObjectType).empty?
97
+ 'All Other'
98
+ elsif !air_loop.supplyComponents('OS:Coil:Heating:Desuperheater'.to_IddObjectType).empty?
99
+ 'All Other'
100
+ elsif !air_loop.supplyComponents('OS:Coil:Heating:WaterToAirHeatPump:EquationFit'.to_IddObjectType).empty?
101
+ 'All Other'
102
+ else
103
+ 'Electric Resistance or None'
104
+ end
105
+ end
106
+
107
+ return htg_type
108
+ end
109
+
110
+ # Finds the search criteria
111
+ #
112
+ # @param template [String] valid choices: 'DOE Ref Pre-1980', 'DOE Ref 1980-2004', '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013'
113
+ # @return [hash] has for search criteria to be used for find object
114
+ def find_search_criteria(template)
115
+ search_criteria = {}
116
+ search_criteria['template'] = template
117
+
118
+ search_criteria['cooling_type'] = case iddObjectType.valueName.to_s
119
+ when 'OS_Coil_Cooling_DX_SingleSpeed',
120
+ 'OS_Coil_Cooling_DX_TwoSpeed',
121
+ 'OS_Coil_Cooling_DX_MultiSpeed'
122
+ condenserType
123
+ else
124
+ 'AirCooled'
125
+ end
126
+
127
+ # Get the subcategory
128
+ search_criteria['subcategory'] = subcategory
129
+
130
+ # Add the heating type to the search criteria
131
+ unless heating_type.nil?
132
+ search_criteria['heating_type'] = heating_type
133
+ end
134
+
135
+ # Unitary heat pumps don't have a heating type
136
+ # as part of the search
137
+ if heat_pump?
138
+ if airLoopHVAC.empty?
139
+ if containingHVACComponent.is_initialized
140
+ containing_comp = containingHVACComponent.get
141
+ if containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.is_initialized
142
+ search_criteria['heating_type'] = nil
143
+ end # TODO: Add other unitary systems
144
+ end
145
+ end
146
+ end
147
+
148
+ return search_criteria
149
+ end
150
+ end
@@ -1,11 +1,13 @@
1
1
 
2
2
  # open the class to add methods to return sizing values
3
3
  class OpenStudio::Model::CoilHeatingDXMultiSpeed
4
- def apply_efficiency_and_curves(template, standards, sql_db_vars_map)
4
+ # Applies the standard efficiency ratings and typical performance curves to this object.
5
+ #
6
+ # @param template [String] valid choices: 'DOE Ref Pre-1980', 'DOE Ref 1980-2004', '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013'
7
+ # @return [Bool] true if successful, false if not
8
+ def apply_efficiency_and_curves(template, sql_db_vars_map)
5
9
  successfully_set_all_properties = true
6
10
 
7
- heat_pumps = standards['heat_pumps_heating']
8
-
9
11
  # Define the criteria to find the unitary properties
10
12
  # in the hvac standards data set.
11
13
  search_criteria = {}
@@ -65,7 +67,7 @@ class OpenStudio::Model::CoilHeatingDXMultiSpeed
65
67
  capacity_kbtu_per_hr = OpenStudio.convert(clg_capacity, 'W', 'kBtu/hr').get
66
68
 
67
69
  # Lookup efficiencies depending on whether it is a unitary AC or a heat pump
68
- hp_props = model.find_object(heat_pumps, search_criteria, capacity_btu_per_hr, Date.today)
70
+ hp_props = model.find_object($os_standards['heat_pumps'], search_criteria, capacity_btu_per_hr, Date.today)
69
71
 
70
72
  # Check to make sure properties were found
71
73
  if hp_props.nil?