Class: OpenStudio::Model::ChillerElectricEIR

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

Overview

open the class to add methods to return sizing values

Instance Method Summary collapse

Instance Method Details

#apply_efficiency_and_curves(template, clg_tower_objs) ⇒ Bool

Applies the standard efficiency ratings and typical performance curves to this object.

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:

  • (Bool)

    true if successful, false if not



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
141
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
# File 'lib/openstudio-standards/standards/Standards.ChillerElectricEIR.rb', line 102

def apply_efficiency_and_curves(template, clg_tower_objs)
  chillers = $os_standards['chillers']

  # Define the criteria to find the chiller properties
  # in the hvac standards data set.
  search_criteria = find_search_criteria(template)
  cooling_type = search_criteria['cooling_type']
  condenser_type = search_criteria['condenser_type']
  compressor_type = search_criteria['compressor_type']

  # Get the chiller capacity
  capacity_w = find_capacity

  # NECB 2011 requires that all chillers be modulating down to 25% of their capacity
  if template == 'NECB 2011'
    setChillerFlowMode('LeavingSetpointModulated')
    setMinimumPartLoadRatio(0.25)
    setMinimumUnloadingRatio(0.25)
    if (capacity_w / 1000.0) < 2100.0
      if self.name.to_s.include? 'Primary Chiller'
        chiller_capacity = capacity_w
      elsif self.name.to_s.include? 'Secondary Chiller'
        chiller_capacity = 0.001
      end
    else
      chiller_capacity = capacity_w / 2.0
    end
    setReferenceCapacity(chiller_capacity)
  end # NECB 2011

  # Convert capacity to tons
  capacity_tons = if template == 'NECB 2011'
                    OpenStudio.convert(chiller_capacity, 'W', 'ton').get
                  else
                    OpenStudio.convert(capacity_w, 'W', 'ton').get
                  end

  # Get the chiller properties
  chlr_props = model.find_object(chillers, search_criteria, capacity_tons, Date.today)
  unless chlr_props
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.ChillerElectricEIR', "For #{self.name}, cannot find chiller properties, cannot apply standard efficiencies or curves.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  # Make the CAPFT curve
  cool_cap_ft = model.add_curve(chlr_props['capft'])
  if cool_cap_ft
    setCoolingCapacityFunctionOfTemperature(cool_cap_ft)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.ChillerElectricEIR', "For #{self.name}, cannot find cool_cap_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the EIRFT curve
  cool_eir_ft = model.add_curve(chlr_props['eirft'])
  if cool_eir_ft
    setElectricInputToCoolingOutputRatioFunctionOfTemperature(cool_eir_ft)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.ChillerElectricEIR', "For #{self.name}, cannot find cool_eir_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the EIRFPLR curve
  # which may be either a CurveBicubic or a CurveQuadratic based on chiller type
  cool_plf_fplr = model.add_curve(chlr_props['eirfplr'])
  if cool_plf_fplr
    setElectricInputToCoolingOutputRatioFunctionOfPLR(cool_plf_fplr)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.ChillerElectricEIR', "For #{self.name}, cannot find cool_plf_fplr curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Set the efficiency value
  kw_per_ton = nil
  cop = nil
  if chlr_props['minimum_full_load_efficiency']
    kw_per_ton = chlr_props['minimum_full_load_efficiency']
    cop = kw_per_ton_to_cop(kw_per_ton)
    setReferenceCOP(cop)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.ChillerElectricEIR', "For #{self.name}, cannot find minimum full load efficiency, will not be set.")
    successfully_set_all_properties = false
  end

  # Set cooling tower properties for NECB 2011 now that the new COP of the chiller is set
  if template == 'NECB 2011'
    if self.name.to_s.include? 'Primary Chiller'
      # Single speed tower model assumes 25% extra for compressor power
      tower_cap = capacity_w * (1.0 + 1.0 / referenceCOP)
      if (tower_cap / 1000.0) < 1750
        clg_tower_objs[0].setNumberofCells(1)
      else
        clg_tower_objs[0].setNumberofCells((tower_cap / (1000 * 1750) + 0.5).round)
      end
      clg_tower_objs[0].setFanPoweratDesignAirFlowRate(0.015 * tower_cap)
    end
  end

  # Append the name with size and kw/ton
  setName("#{name} #{capacity_tons.round}tons #{kw_per_ton.round(1)}kW/ton")
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.model.ChillerElectricEIR', "For #{template}: #{self.name}: #{cooling_type} #{condenser_type} #{compressor_type} Capacity = #{capacity_tons.round}tons; COP = #{cop.round(1)} (#{kw_per_ton.round(1)}kW/ton)")

  return successfully_set_all_properties
end

#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.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/openstudio-standards/hvac_sizing/Siz.ChillerElectricEIR.rb', line 13

def applySizingValues

  reference_chilled_water_flow_rate = self.autosizedReferenceChilledWaterFlowRate
  if reference_chilled_water_flow_rate.is_initialized
    self.setReferenceChilledWaterFlowRate(reference_chilled_water_flow_rate.get) 
  end

  reference_capacity = self.autosizedReferenceCapacity
  if reference_capacity.is_initialized
    self.setReferenceCapacity(reference_capacity.get) 
  end

  # Only try to find the condenser water flow rate if this chiller
  # is a water cooled chiller connected to a condenser loop.
  if self.secondaryPlantLoop.is_initialized
    reference_condenser_fluid_flow_rate = self.autosizedReferenceCondenserFluidFlowRate
    if reference_condenser_fluid_flow_rate.is_initialized
      self.setReferenceCondenserFluidFlowRate(reference_condenser_fluid_flow_rate.get) 
    end
  end
  
end

#autosizeObject

Sets all auto-sizeable fields to autosize



6
7
8
# File 'lib/openstudio-standards/hvac_sizing/Siz.ChillerElectricEIR.rb', line 6

def autosize
  OpenStudio::logFree(OpenStudio::Warn, "openstudio.sizing.ChillerElectricEIR", ".autosize not yet implemented for #{self.iddObject.type.valueDescription}.")
end

#autosizedReferenceCapacityObject

returns the autosized reference capacity as an optional double



44
45
46
47
48
# File 'lib/openstudio-standards/hvac_sizing/Siz.ChillerElectricEIR.rb', line 44

def autosizedReferenceCapacity

  return self.model.getAutosizedValue(self, 'Design Size Reference Capacity', 'W')

end

#autosizedReferenceChilledWaterFlowRateObject

returns the autosized chilled water flow rate as an optional double



37
38
39
40
41
# File 'lib/openstudio-standards/hvac_sizing/Siz.ChillerElectricEIR.rb', line 37

def autosizedReferenceChilledWaterFlowRate

  return self.model.getAutosizedValue(self, 'Design Size Reference Chilled Water Flow Rate', 'm3/s')
  
end

#autosizedReferenceCondenserFluidFlowRateObject

returns the autosized reference condenser fluid flow rate as an optional double



51
52
53
54
55
# File 'lib/openstudio-standards/hvac_sizing/Siz.ChillerElectricEIR.rb', line 51

def autosizedReferenceCondenserFluidFlowRate

  return self.model.getAutosizedValue(self, 'User-Specified Reference Condenser Water Flow Rate', 'm3/s')
  
end

#find_capacityDouble

Finds capacity in W

Returns:

  • (Double)

    capacity in W to be used for find object



58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/openstudio-standards/standards/Standards.ChillerElectricEIR.rb', line 58

def find_capacity
  capacity_w = nil
  if referenceCapacity.is_initialized
    capacity_w = referenceCapacity.get
  elsif autosizedReferenceCapacity.is_initialized
    capacity_w = autosizedReferenceCapacity.get
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.ChillerElectricEIR', "For #{name} capacity is not available, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  return capacity_w
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



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
# File 'lib/openstudio-standards/standards/Standards.ChillerElectricEIR.rb', line 8

def find_search_criteria(template)
  search_criteria = {}
  search_criteria['template'] = template

  # Determine if WaterCooled or AirCooled by
  # checking if the chiller is connected to a condenser
  # water loop or not.
  cooling_type = 'AirCooled'
  if secondaryPlantLoop.is_initialized
    cooling_type = 'WaterCooled'
  end

  search_criteria['cooling_type'] = cooling_type

  # TODO: Standards replace this with a mechanism to store this
  # data in the chiller object itself.
  # For now, retrieve the condenser type from the name
  name = self.name.get
  condenser_type = nil
  compressor_type = nil
  if cooling_type == 'AirCooled'
    if name.include?('WithCondenser')
      condenser_type = 'WithCondenser'
    elsif name.include?('WithoutCondenser')
      condenser_type = 'WithoutCondenser'
    end
  elsif cooling_type == 'WaterCooled'
    if name.include?('Reciprocating')
      compressor_type = 'Reciprocating'
    elsif name.include?('Rotary Screw')
      compressor_type = 'Rotary Screw'
    elsif name.include?('Scroll')
      compressor_type = 'Scroll'
    elsif name.include?('Centrifugal')
      compressor_type = 'Centrifugal'
    end
  end
  unless condenser_type.nil?
    search_criteria['condenser_type'] = condenser_type
  end
  unless compressor_type.nil?
    search_criteria['compressor_type'] = compressor_type
  end

  return search_criteria
end

#standard_minimum_full_load_efficiency(template) ⇒ Double

Finds lookup object in standards and return full load 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)



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/openstudio-standards/standards/Standards.ChillerElectricEIR.rb', line 78

def standard_minimum_full_load_efficiency(template)
  # Get the chiller properties
  search_criteria = find_search_criteria(template)
  capacity_tons = OpenStudio.convert(find_capacity, 'W', 'ton').get 
  chlr_props = model.find_object($os_standards['chillers'], search_criteria, capacity_tons, Date.today)

  # lookup the efficiency value
  kw_per_ton = nil
  cop = nil
  if chlr_props['minimum_full_load_efficiency']
    kw_per_ton = chlr_props['minimum_full_load_efficiency']
    cop = kw_per_ton_to_cop(kw_per_ton)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.ChillerElectricEIR', "For #{name}, cannot find minimum full load efficiency.")
  end

  return cop
end