Class: OpenStudio::Model::CoilHeatingDXSingleSpeed

Inherits:
Object
  • Object
show all
Defined in:
lib/openstudio-standards/hvac_sizing/HVACSizing.CoilHeatingDXSingleSpeed.rb,
lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb

Overview

open the class to add methods to return sizing values

Instance Method Summary collapse

Instance Method Details

#applySizingValuesObject

Takes the values calculated by the EnergyPlus sizing routines and puts them into this object model in place of the autosized fields. Must have previously completed a run with sql output for this to work.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/openstudio-standards/hvac_sizing/HVACSizing.CoilHeatingDXSingleSpeed.rb', line 15

def applySizingValues

  rated_air_flow_rate = self.autosizedRatedAirFlowRate
  if rated_air_flow_rate.is_initialized
    self.setRatedAirFlowRate(rated_air_flow_rate.get) 
  end

  rated_total_heating_capacity = self.autosizedRatedTotalHeatingCapacity
  if rated_total_heating_capacity.is_initialized
    self.setRatedTotalHeatingCapacity(rated_total_heating_capacity.get) 
  end    

  rated_resistive_defrost_heater_capacity = self.autosizedResistiveDefrostHeaterCapacity
  if rated_resistive_defrost_heater_capacity.is_initialized
    self.setResistiveDefrostHeaterCapacity(rated_resistive_defrost_heater_capacity.get) 
  end     
    
end

#autosizeObject

Sets all auto-sizeable fields to autosize



6
7
8
9
10
# File 'lib/openstudio-standards/hvac_sizing/HVACSizing.CoilHeatingDXSingleSpeed.rb', line 6

def autosize
  self.autosizeRatedTotalHeatingCapacity
  self.autosizeRatedAirFlowRate
  self.autosizeResistiveDefrostHeaterCapacity
end

#autosizedRatedAirFlowRateObject

returns the autosized rated air flow rate as an optional double



35
36
37
38
39
# File 'lib/openstudio-standards/hvac_sizing/HVACSizing.CoilHeatingDXSingleSpeed.rb', line 35

def autosizedRatedAirFlowRate

  return self.model.getAutosizedValue(self, 'Design Size Rated Air Flow Rate', 'm3/s')

end

#autosizedRatedTotalHeatingCapacityObject

returns the autosized rated total cooling capacity as an optional double



42
43
44
45
46
# File 'lib/openstudio-standards/hvac_sizing/HVACSizing.CoilHeatingDXSingleSpeed.rb', line 42

def autosizedRatedTotalHeatingCapacity

  return self.model.getAutosizedValue(self, 'Design Size Gross Rated Heating Capacity', 'W')
  
end

#autosizedResistiveDefrostHeaterCapacityObject

returns the autosized rated sensible heat ratio as an optional double



49
50
51
52
53
# File 'lib/openstudio-standards/hvac_sizing/HVACSizing.CoilHeatingDXSingleSpeed.rb', line 49

def autosizedResistiveDefrostHeaterCapacity

  return self.model.getAutosizedValue(self, 'Design Size Resistive Defrost Heater Capacity', 'W')   
  
end

#find_capacityDouble

Finds capacity in tons

Returns:

  • (Double)

    capacity in tons to be used for find object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb', line 28

def find_capacity()

  # Determine supplemental heating type if unitary
  heat_pump = false
  if self.airLoopHVAC.empty?
    if self.containingHVACComponent.is_initialized
      containing_comp = containingHVACComponent.get
      if containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.is_initialized
        heat_pump = true
      end
    end
  end

  # Get the coil capacity
  capacity_w = nil
  if(heat_pump == true)
    containing_comp = self.containingHVACComponent.get
    heat_pump_comp = containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.get
    ccoil = heat_pump_comp.coolingCoil
    dxcoil = ccoil.to_CoilCoolingDXSingleSpeed.get
    dxcoil_name = dxcoil.name.to_s
    if sql_db_vars_map
      if sql_db_vars_map[dxcoil_name]
        dxcoil.setName(sql_db_vars_map[dxcoil_name])
      end
    end
    if dxcoil.ratedTotalCoolingCapacity.is_initialized
      capacity_w = dxcoil.ratedTotalCoolingCapacity.get
    elsif dxcoil.autosizedRatedTotalCoolingCapacity.is_initialized
      capacity_w = dxcoil.autosizedRatedTotalCoolingCapacity.get
    else
      OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name} capacity is not available, cannot apply efficiency standard.")
      successfully_set_all_properties = false
      return successfully_set_all_properties
    end
    dxcoil.setName(dxcoil_name)
  else
    if self.ratedTotalHeatingCapacity.is_initialized
      capacity_w = self.ratedTotalHeatingCapacity.get
    elsif self.autosizedRatedTotalHeatingCapacity.is_initialized
      capacity_w = self.autosizedRatedTotalHeatingCapacity.get
    else
      OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name} capacity is not available, cannot apply efficiency standard.")
      successfully_set_all_properties = false
      return successfully_set_all_properties
    end
  end

  # Convert capacity to Btu/hr
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, "W", "Btu/hr").get

  return capacity_btu_per_hr

end

#find_search_criteria(template) ⇒ hash

Finds the search criteria

Parameters:

  • template (String)

    valid choices: ‘DOE Ref Pre-1980’, ‘DOE Ref 1980-2004’, ‘90.1-2004’, ‘90.1-2007’, ‘90.1-2010’, ‘90.1-2013’

Returns:

  • (hash)

    has for search criteria to be used for find object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb', line 9

def find_search_criteria(template)

  # Define the criteria to find the chiller properties
  # in the hvac standards data set.
  search_criteria = {}
  search_criteria['template'] = template

  # TODO Standards - add split system vs single package to model
  # For now, assume single package
  subcategory = 'Single Package'
  search_criteria['subcategory'] = subcategory

  return search_criteria

end

#setStandardEfficiencyAndCurves(template, sql_db_vars_map) ⇒ Object



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb', line 142

def setStandardEfficiencyAndCurves(template, sql_db_vars_map)

  successfully_set_all_properties = true

  unitary_hps = $os_standards['heat_pumps']
  heat_pumps = $os_standards['heat_pumps_heating']
 
  # Define the criteria to find the unitary properties
  # in the hvac standards data set.
  search_criteria = {}
  search_criteria['template'] = template

  # TODO Standards - add split system vs single package to model
  # For now, assume single package
  subcategory = 'Single Package'
  search_criteria['subcategory'] = subcategory

  # Determine supplemental heating type if unitary
  heat_pump = false
  suppl_heating_type = nil
  if self.airLoopHVAC.empty?
    if self.containingHVACComponent.is_initialized
      containing_comp = containingHVACComponent.get
      if containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.is_initialized
        heat_pump = true
        htg_coil = containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.get.supplementalHeatingCoil
        if htg_coil.to_CoilHeatingElectric.is_initialized
          suppl_heating_type = 'Electric Resistance or None'
        else
          suppl_heating_type = 'All Other'
        end
      end # TODO Add other unitary systems
    elsif self.containingZoneHVACComponent.is_initialized
      containing_comp = self.containingZoneHVACComponent.get
      # PTHP
      if containing_comp.to_ZoneHVACPackagedTerminalHeatPump.is_initialized
        pthp = containing_comp.to_ZoneHVACPackagedTerminalHeatPump.get
        #heat_pump = true?
        # Todo: Should we implement a subcategory for PTHP like there is one for PTAC?
        # Because for PTHP the COP has two coefficients two (eg 90.1-2007: COP = 3.2 - 0.000026*Cap)
        subcategory = 'PTHP'
        htg_coil = containing_comp.to_ZoneHVACPackagedTerminalHeatPump.get.supplementalHeatingCoil
        if htg_coil.to_CoilHeatingElectric.is_initialized
          suppl_heating_type = 'Electric Resistance or None'
        else
          suppl_heating_type = 'All Other'
        end
      end
    end
  end

  # Determine the supplemental heating type if on an airloop
  if self.airLoopHVAC.is_initialized
    air_loop = self.airLoopHVAC.get
    if air_loop.supplyComponents('Coil:Heating:Electric'.to_IddObjectType).size > 0
      suppl_heating_type = 'Electric Resistance or None'
    elsif air_loop.supplyComponents('Coil:Heating:Gas'.to_IddObjectType).size > 0
      suppl_heating_type = 'All Other'
    elsif air_loop.supplyComponents('Coil:Heating:Water'.to_IddObjectType).size > 0
      suppl_heating_type = 'All Other'
    elsif air_loop.supplyComponents('Coil:Heating:DX:SingleSpeed'.to_IddObjectType).size > 0
      suppl_heating_type = 'All Other'
    elsif air_loop.supplyComponents('Coil:Heating:Gas:MultiStage'.to_IddObjectType).size > 0
      suppl_heating_type = 'All Other'
    elsif air_loop.supplyComponents('Coil:Heating:Desuperheater'.to_IddObjectType).size > 0
      suppl_heating_type = 'All Other'
    elsif air_loop.supplyComponents('Coil:Heating:WaterToAirHeatPump:EquationFit'.to_IddObjectType).size > 0
      suppl_heating_type = 'All Other'  
    else
      suppl_heating_type = 'Electric Resistance or None'
    end
  end


  # Get the coil capacity
  capacity_w = nil
  if(heat_pump == true)
    containing_comp = self.containingHVACComponent.get
    heat_pump_comp = containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.get
    ccoil = heat_pump_comp.coolingCoil
    dxcoil = ccoil.to_CoilCoolingDXSingleSpeed.get
    dxcoil_name = dxcoil.name.to_s
    if sql_db_vars_map
      if sql_db_vars_map[dxcoil_name]
        dxcoil.setName(sql_db_vars_map[dxcoil_name])
      end
    end
    if dxcoil.ratedTotalCoolingCapacity.is_initialized
      capacity_w = dxcoil.ratedTotalCoolingCapacity.get
    elsif dxcoil.autosizedRatedTotalCoolingCapacity.is_initialized
      capacity_w = dxcoil.autosizedRatedTotalCoolingCapacity.get
    else
      OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name} capacity is not available, cannot apply efficiency standard.")
      successfully_set_all_properties = false
      return successfully_set_all_properties  
    end
    dxcoil.setName(dxcoil_name)
  else
    if self.ratedTotalHeatingCapacity.is_initialized
      capacity_w = self.ratedTotalHeatingCapacity.get
    elsif self.autosizedRatedTotalHeatingCapacity.is_initialized
      capacity_w = self.autosizedRatedTotalHeatingCapacity.get
    else
      OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name} capacity is not available, cannot apply efficiency standard.")
      successfully_set_all_properties = false
      return successfully_set_all_properties
    end    
  end

  # Convert capacity to Btu/hr
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, "W", "Btu/hr").get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, "W", "kBtu/hr").get

  # Lookup efficiencies depending on whether it is a unitary AC or a heat pump
  ac_props = nil
  if heat_pump == true
    ac_props = self.model.find_object(heat_pumps, search_criteria, capacity_btu_per_hr)
  else
    ac_props = self.model.find_object(unitary_hps, search_criteria, capacity_btu_per_hr)
  end

  # TODO: REMOVE THIS, TEMPORARY HACK ONLY
  if subcategory == 'PTHP'
    case template
      when '90.1-2007'
        pthp_cop_coeff_1 = 3.2
        pthp_cop_coeff_2 = -0.000026
      when '90.1-2010'
        # As of 10/08/2012
        pthp_cop_coeff_1 = 3.7
        pthp_cop_coeff_2 = -0.000052
    end

    # TABLE 6.8.1D
    # COP = pthp_cop_coeff_1 + pthp_cop_coeff_2 * Cap
    # Note c: Cap means the rated cooling capacity of the product in Btu/h.
    # If the unit’s capacity is less than 7000 Btu/h, use 7000 Btu/h in the calculation.
    # If the unit’s capacity is greater than 15,000 Btu/h, use 15,000 Btu/h in the calculation.
    capacity_btu_per_hr = 7000 if capacity_btu_per_hr < 7000
    capacity_btu_per_hr = 15000 if capacity_btu_per_hr > 15000
    pthp_cop = pthp_cop_coeff_1 + (pthp_cop_coeff_2 * capacity_btu_per_hr)
    new_comp_name = "#{self.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{pthp_cop.round(1)}COP"
    self.setName(new_comp_name)
    self.setRatedCOP(pthp_cop)
    OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed',  "HACK: For #{template}: #{self.name}: #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr #{pthp_cop.round(2)}COP")
  end
  # TODO: END OF REMOVE THIS TEMPORARY HACK ONLY

  # Check to make sure properties were found
  if ac_props.nil?
    OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name}, cannot find efficiency info, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  # Make the HEAT-CAP-FT curve
  heat_cap_ft = self.model.add_curve(ac_props["heat_cap_ft"])
  if heat_cap_ft
    self.setTotalHeatingCapacityFunctionofTemperatureCurve(heat_cap_ft)
  else
    OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name}, cannot find heat_cap_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-CAP-FFLOW curve
  heat_cap_fflow = self.model.add_curve(ac_props["heat_cap_fflow"])
  if heat_cap_fflow
    self.setTotalHeatingCapacityFunctionofFlowFractionCurve(heat_cap_fflow)
  else
    OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name}, cannot find heat_cap_fflow curve, will not be set.")
    successfully_set_all_properties = false
  end
  
  # Make the HEAT-EIR-FT curve
  heat_eir_ft = self.model.add_curve(ac_props["heat_eir_ft"])
  if heat_eir_ft
    self.setEnergyInputRatioFunctionofTemperatureCurve(heat_eir_ft)  
  else
    OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name}, cannot find heat_eir_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-EIR-FFLOW curve
  heat_eir_fflow = self.model.add_curve(ac_props["heat_eir_fflow"])
  if heat_eir_fflow
    self.setEnergyInputRatioFunctionofFlowFractionCurve(heat_eir_fflow)
  else
    OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name}, cannot find heat_eir_fflow curve, will not be set.")
    successfully_set_all_properties = false
  end
  
  # Make the HEAT-PLF-FPLR curve
  heat_plf_fplr = self.model.add_curve(ac_props["heat_plf_fplr"])
  if heat_plf_fplr
    self.setPartLoadFractionCorrelationCurve(heat_plf_fplr)
  else
    OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name}, cannot find heat_plf_fplr curve, will not be set.")
    successfully_set_all_properties = false
  end 
 
  # Get the minimum efficiency standards
  cop = nil
  
  # If specified as SEER
  unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
    min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
    cop = seer_to_cop(min_seer)
    self.setName("#{self.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER")
    OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed',  "For #{template}: #{self.name}: #{suppl_heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
  end
  
  # If specified as EER
  unless ac_props['minimum_energy_efficiency_ratio'].nil?
    min_eer = ac_props['minimum_energy_efficiency_ratio']
    cop = eer_to_cop(min_eer)
    self.setName("#{self.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER")
    OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{template}: #{self.name}:  #{suppl_heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end


  # Set the efficiency values
  unless cop.nil?
    self.setRatedCOP(cop)
  end

  return sql_db_vars_map

end

#standard_minimum_cop(template, standards) ⇒ Double

Finds lookup object in standards and return efficiency

Parameters:

  • template (String)

    valid choices: ‘DOE Ref Pre-1980’, ‘DOE Ref 1980-2004’, ‘90.1-2004’, ‘90.1-2007’, ‘90.1-2010’, ‘90.1-2013’

  • standards (Hash)

    the OpenStudio_Standards spreadsheet in hash format

Returns:

  • (Double)

    full load efficiency (COP)



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb', line 88

def standard_minimum_cop(template,standards)

  # find ac properties
  search_criteria = self.find_search_criteria(template)
  subcategory = search_criteria["subcategory"]
  capacity_btu_per_hr = self.find_capacity
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_btu_per_hr, "Btu/hr", "kBtu/hr").get

  # Determine supplemental heating type if unitary
  heat_pump = false
  if self.airLoopHVAC.empty?
    if self.containingHVACComponent.is_initialized
      containing_comp = containingHVACComponent.get
      if containing_comp.to_AirLoopHVACUnitaryHeatPumpAirToAir.is_initialized
        heat_pump = true
      end
    end
  end

  # find object
  ac_props = nil
  if heat_pump == true
    ac_props = self.model.find_object(standards['heat_pumps_heating'], search_criteria, capacity_btu_per_hr)
  else
    ac_props = self.model.find_object(standards['heat_pumps'], search_criteria, capacity_btu_per_hr)
  end

  # Get the minimum efficiency standards
  cop = nil

  # Check to make sure properties were found
  if ac_props.nil?
    OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{self.name}, cannot find efficiency info, cannot apply efficiency standard.")
    return cop # value of nil
  end

  # If specified as SEER
  unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
    min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
    cop = seer_to_cop(min_seer)
    OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed',  "For #{template}: #{self.name}: #{suppl_heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
  end

  # If specified as EER
  unless ac_props['minimum_energy_efficiency_ratio'].nil?
    min_eer = ac_props['minimum_energy_efficiency_ratio']
    cop = eer_to_cop(min_eer)
    OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{template}: #{self.name}:  #{suppl_heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  return cop

end