Module: PrototypeBuilding::MidriseApartment

Defined in:
lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb

Class Method Summary collapse

Class Method Details

.add_door_infiltration(template, climate_zone, model) ⇒ Object

add extra infiltration for ground floor corridor



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
# File 'lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb', line 263

def self.add_door_infiltration(template, climate_zone, model)
  case template
  when 'DOE Ref 1980-2004', 'DOE Ref Pre-1980'
    # no door infiltration in these two vintages
  when '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013'
    g_corridor = model.getSpaceByName('G Corridor').get
    infiltration_g_corridor_door = OpenStudio::Model::SpaceInfiltrationDesignFlowRate.new(model)
    infiltration_g_corridor_door.setName('G Corridor door Infiltration')
    infiltration_g_corridor_door.setSpace(g_corridor)
    case template
    when '90.1-2004'
      infiltration_g_corridor_door.setDesignFlowRate(0.520557541)
      infiltration_g_corridor_door.setSchedule(model.add_schedule('ApartmentMidRise INFIL_Door_Opening_SCH_2004_2007'))
    when '90.1-2007'
      case climate_zone
      when 'ASHRAE 169-2006-1A', 'ASHRAE 169-2006-2A', 'ASHRAE 169-2006-2B'
        infiltration_g_corridor_door.setDesignFlowRate(0.520557541)
      else
        infiltration_g_corridor_door.setDesignFlowRate(0.327531218)
      end
      infiltration_g_corridor_door.setSchedule(model.add_schedule('ApartmentMidRise INFIL_Door_Opening_SCH_2004_2007'))
    when '90.1-2010', '90.1-2013'
      case climate_zone
      when 'ASHRAE 169-2006-1A', 'ASHRAE 169-2006-2A', 'ASHRAE 169-2006-2B'
        infiltration_g_corridor_door.setDesignFlowRate(0.520557541)
      else
        infiltration_g_corridor_door.setDesignFlowRate(0.327531218)
      end
      infiltration_g_corridor_door.setSchedule(model.add_schedule('ApartmentMidRise INFIL_Door_Opening_SCH_2010_2013'))
    end
  end
end

.add_extra_equip_corridor(template, model) ⇒ Object

add elevator and lights&fans for the ground floor corridor



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
# File 'lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb', line 203

def self.add_extra_equip_corridor(template, model)
  corridor_ground_space = model.getSpaceByName('G Corridor').get
  elec_equip_def1 = OpenStudio::Model::ElectricEquipmentDefinition.new(model)
  elec_equip_def2 = OpenStudio::Model::ElectricEquipmentDefinition.new(model)
  elec_equip_def1.setName('Ground Corridor Electric Equipment Definition1')
  elec_equip_def2.setName('Ground Corridor Electric Equipment Definition2')
  case template
  when '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013'
    elec_equip_def1.setFractionLatent(0)
    elec_equip_def1.setFractionRadiant(0)
    elec_equip_def1.setFractionLost(0.95)
    elec_equip_def2.setFractionLatent(0)
    elec_equip_def2.setFractionRadiant(0)
    elec_equip_def2.setFractionLost(0.95)
    elec_equip_def1.setDesignLevel(16_055)
    if template == '90.1-2013'
      elec_equip_def2.setDesignLevel(63)
    elsif template == '90.1-2010'
      elec_equip_def2.setDesignLevel(105.9)
    else
      elec_equip_def2.setDesignLevel(161.9)
    end
    # Create the electric equipment instance and hook it up to the space type
    elec_equip1 = OpenStudio::Model::ElectricEquipment.new(elec_equip_def1)
    elec_equip2 = OpenStudio::Model::ElectricEquipment.new(elec_equip_def2)
    elec_equip1.setName('G Corridor_Elevators_Equip')
    elec_equip2.setName('Elevators_Lights_Fan')
    elec_equip1.setSpace(corridor_ground_space)
    elec_equip2.setSpace(corridor_ground_space)
    elec_equip1.setSchedule(model.add_schedule('ApartmentMidRise BLDG_ELEVATORS'))
    case template
    when '90.1-2004', '90.1-2007'
      elec_equip2.setSchedule(model.add_schedule('ApartmentMidRise ELEV_LIGHT_FAN_SCH_24_7'))
    when '90.1-2010', '90.1-2013'
      elec_equip2.setSchedule(model.add_schedule('ApartmentMidRise ELEV_LIGHT_FAN_SCH_ADD_DF'))
    end
  when 'DOE Ref Pre-1980', 'DOE Ref 1980-2004'
    elec_equip_def1.setDesignLevel(16_055)
    elec_equip_def1.setFractionLatent(0)
    elec_equip_def1.setFractionRadiant(0)
    elec_equip_def1.setFractionLost(0.95)
    # Create the electric equipment instance and hook it up to the space type
    elec_equip1 = OpenStudio::Model::ElectricEquipment.new(elec_equip_def1)
    elec_equip1.setName('G Corridor_Elevators_Equip')
    elec_equip1.setSpace(corridor_ground_space)
    elec_equip1.setSchedule(model.add_schedule('ApartmentMidRise BLDG_ELEVATORS Pre2004'))
  end
end

.adjust_clg_setpoint(template, climate_zone, model) ⇒ Object



188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb', line 188

def self.adjust_clg_setpoint(template, climate_zone, model)
  space_name = 'Office'
  space_type_name = model.getSpaceByName(space_name).get.spaceType.get.name.get
  thermostat_name = space_type_name + ' Thermostat'
  thermostat = model.getThermostatSetpointDualSetpointByName(thermostat_name).get
  case template
  when '90.1-2004', '90.1-2007', '90.1-2010'
    case climate_zone
    when 'ASHRAE 169-2006-2B', 'ASHRAE 169-2006-1B', 'ASHRAE 169-2006-3B'
      thermostat.setCoolingSetpointTemperatureSchedule(model.add_schedule('ApartmentMidRise CLGSETP_OFF_SCH_NO_OPTIMUM'))
    end
  end
end

.custom_hvac_tweaks(building_type, template, climate_zone, prototype_input, model) ⇒ Object



173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb', line 173

def self.custom_hvac_tweaks(building_type, template, climate_zone, prototype_input, model)
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.model.Model', 'Started building type specific adjustments')

  # adjust the cooling setpoint
  PrototypeBuilding::MidriseApartment.adjust_clg_setpoint(template, climate_zone, model)
  # add elevator and lights&fans for the ground floor corridor
  PrototypeBuilding::MidriseApartment.add_extra_equip_corridor(template, model)
  # add extra infiltration for ground floor corridor
  PrototypeBuilding::MidriseApartment.add_door_infiltration(template, climate_zone, model)

  OpenStudio.logFree(OpenStudio::Info, 'openstudio.model.Model', 'Finished building type specific adjustments')

  return true
end

.custom_swh_tweaks(building_type, template, climate_zone, prototype_input, model) ⇒ Object



296
297
298
299
300
# File 'lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb', line 296

def self.custom_swh_tweaks(building_type, template, climate_zone, prototype_input, model)
  PrototypeBuilding::MidriseApartment.update_waterheater_loss_coefficient(template, model)

  return true
end

.define_hvac_system_map(building_type, template, climate_zone) ⇒ Object



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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb', line 95

def self.define_hvac_system_map(building_type, template, climate_zone)
  system_to_space_map = [
    { 'type' => 'SAC',
      'space_names' => ['G SW Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['G NW Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['G NE Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['G N1 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['G N2 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['G S1 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['G S2 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['M SW Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['M NW Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['M SE Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['M NE Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['M N1 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['M N2 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['M S1 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['M S2 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['T SW Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['T NW Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['T SE Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['T NE Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['T N1 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['T N2 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['T S1 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['T S2 Apartment'] },
    { 'type' => 'SAC',
      'space_names' => ['Office'] }
  ]

  case template
  when 'DOE Ref 1980-2004', 'DOE Ref Pre-1980'
    system_to_space_map.push('type' => 'UnitHeater', 'space_names' => ['G Corridor'])
    system_to_space_map.push('type' => 'UnitHeater', 'space_names' => ['M Corridor'])
    system_to_space_map.push('type' => 'UnitHeater', 'space_names' => ['T Corridor'])
  end

  return system_to_space_map
end

.define_space_multiplierObject



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb', line 157

def self.define_space_multiplier
  # This map define the multipliers for spaces with multipliers not equals to 1
  space_multiplier_map = {
    'M SW Apartment' => 2,
    'M NW Apartment' => 2,
    'M SE Apartment' => 2,
    'M NE Apartment' => 2,
    'M N1 Apartment' => 2,
    'M N2 Apartment' => 2,
    'M S1 Apartment' => 2,
    'M S2 Apartment' => 2,
    'M Corridor' => 2
  }
  return space_multiplier_map
end

.define_space_type_map(building_type, template, climate_zone) ⇒ Object



5
6
7
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
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
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb', line 5

def self.define_space_type_map(building_type, template, climate_zone)
  space_type_map = nil

  case template
  when '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013'
    space_type_map = {
      'Office' => ['Office'],
      'Corridor' => ['G Corridor', 'M Corridor'],
      'Corridor_topfloor' => ['T Corridor'],
      'Apartment' => [
        'G SW Apartment',
        'G NW Apartment',
        'G NE Apartment',
        'G N1 Apartment',
        'G N2 Apartment',
        'G S1 Apartment',
        'G S2 Apartment',
        'M SW Apartment',
        'M NW Apartment',
        'M SE Apartment',
        'M NE Apartment',
        'M N1 Apartment',
        'M N2 Apartment',
        'M S1 Apartment',
        'M S2 Apartment'
      ],
      'Apartment_topfloor_WE' => [
        'T SW Apartment',
        'T NW Apartment',
        'T SE Apartment',
        'T NE Apartment'
      ],
      'Apartment_topfloor_NS' => [
        'T N1 Apartment',
        'T N2 Apartment',
        'T S1 Apartment',
        'T S2 Apartment'
      ]
    }
  when 'DOE Ref 1980-2004', 'DOE Ref Pre-1980'
    space_type_map = {
      'Office' => ['Office'],
      'Corridor' => ['G Corridor', 'M Corridor', 'T Corridor'],
      'Apartment' => [
        'G SW Apartment',
        'G NW Apartment',
        'G NE Apartment',
        'G N1 Apartment',
        'G N2 Apartment',
        'G S1 Apartment',
        'G S2 Apartment',
        'M SW Apartment',
        'M NW Apartment',
        'M SE Apartment',
        'M NE Apartment',
        'M N1 Apartment',
        'M N2 Apartment',
        'M S1 Apartment',
        'M S2 Apartment',
        'T SW Apartment',
        'T NW Apartment',
        'T SE Apartment',
        'T NE Apartment',
        'T N1 Apartment',
        'T N2 Apartment',
        'T S1 Apartment',
        'T S2 Apartment'
      ]
    }

  when 'NECB 2011'
    sch = 'G'
    space_type_map = {
      "Corr. < 2.4m wide-sch-#{sch}" => ['G Corridor', 'M Corridor', 'T Corridor'],

      'Dwelling Unit(s)' => ['G N1 Apartment', 'G N2 Apartment', 'G NE Apartment',
                             'G NW Apartment', 'G S1 Apartment', 'G S2 Apartment',
                             'G SW Apartment', 'M N1 Apartment', 'M N2 Apartment',
                             'M NE Apartment', 'M NW Apartment', 'M S1 Apartment',
                             'M S2 Apartment', 'M SE Apartment', 'M SW Apartment',
                             'T N1 Apartment', 'T N2 Apartment', 'T NE Apartment',
                             'T NW Apartment', 'T S1 Apartment', 'T S2 Apartment',
                             'T SE Apartment', 'T SW Apartment'],
      'Office - enclosed' => ['Office']
    }
  end

  return space_type_map
end

.update_waterheater_loss_coefficient(template, model) ⇒ Object



252
253
254
255
256
257
258
259
260
# File 'lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb', line 252

def self.update_waterheater_loss_coefficient(template, model)
  case template
  when '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013', 'NECB 2011'
    model.getWaterHeaterMixeds.sort.each do |water_heater|
      water_heater.setOffCycleLossCoefficienttoAmbientTemperature(46.288874618)
      water_heater.setOnCycleLossCoefficienttoAmbientTemperature(46.288874618)
    end
  end
end