Module: BTAP::Resources::SpaceLoads::ScaleLoads

Defined in:
lib/openstudio-standards/btap/spaceloads.rb

Class Method Summary collapse

Class Method Details

.scale_electrical_loads(model, factor) ⇒ Object

This method will scale electrical loads.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • factor (Float)

Author:



118
119
120
121
122
# File 'lib/openstudio-standards/btap/spaceloads.rb', line 118

def self.scale_electrical_loads( model, factor )
  model.getElectricEquipments.sort.each do |item|
    item.setMultiplier( item.multiplier * factor )
  end
end

.scale_electrical_loads_schedule(model, a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) ⇒ Object

This method will scale electrical loads schedule.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • a_coef (Float)
  • b_coef (Float)
  • c_coef (Float)
  • time_shift (Float) (defaults to: nil)
  • time_sign (Float) (defaults to: nil)

Author:



132
133
134
135
136
# File 'lib/openstudio-standards/btap/spaceloads.rb', line 132

def self.scale_electrical_loads_schedule( model, a_coef, b_coef, c_coef,time_shift = nil, time_sign = nil  )
  model.getElectricEquipments.sort.each do |item|
    BTAP::Resources::Schedules::modify_schedule!(model, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign )
  end
end

.scale_hot_water_loads(model, factor) ⇒ Object

This method will scale hotwater loads.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • factor (Float)

Author:



142
143
144
145
146
# File 'lib/openstudio-standards/btap/spaceloads.rb', line 142

def self.scale_hot_water_loads( model, factor )
  model.getHotWaterEquipments.sort.each do |item|
    item.setMultiplier( item.multiplier * factor )
  end
end

.scale_inflitration_loads(model, factor) ⇒ Object

This method will scale infiltration loads.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • factor (Float)

Author:



165
166
167
168
169
170
171
172
# File 'lib/openstudio-standards/btap/spaceloads.rb', line 165

def self.scale_inflitration_loads( model, factor )
  model.getSpaceInfiltrationDesignFlowRates.sort.each do |infiltration_load|
    infiltration_load.setDesignFlowRate( infiltration_load.designFlowRate.get * factor ) unless infiltration_load.designFlowRate.empty?
    infiltration_load.setFlowperSpaceFloorArea( infiltration_load.flowperSpaceFloorArea.get * factor ) unless infiltration_load.flowperSpaceFloorArea.empty?
    infiltration_load.setFlowperExteriorSurfaceArea( infiltration_load.flowperExteriorSurfaceArea.get * factor ) unless infiltration_load.flowperExteriorSurfaceArea.empty?
    infiltration_load.setAirChangesperHour( infiltration_load.airChangesperHour.get * factor ) unless infiltration_load.airChangesperHour.empty?
  end
end

.scale_lighting_loads(model, factor) ⇒ Object

This method will scale lighting loads.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • factor (Float)

Author:



93
94
95
96
97
# File 'lib/openstudio-standards/btap/spaceloads.rb', line 93

def self.scale_lighting_loads( model, factor )
  model.getLightss.sort.each do |item|
    item.setMultiplier( item.multiplier * factor )
  end
end

.scale_lighting_loads_schedule(model, a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) ⇒ Object

This method will scale lighting loads schedule.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • a_coef (Float)
  • b_coef (Float)
  • c_coef (Float)
  • time_shift (Float) (defaults to: nil)
  • time_sign (Float) (defaults to: nil)

Author:



107
108
109
110
111
112
# File 'lib/openstudio-standards/btap/spaceloads.rb', line 107

def self.scale_lighting_loads_schedule( model, a_coef, b_coef, c_coef,time_shift = nil, time_sign = nil  )
  model.getLightss.sort.each do |item|
    #Do an in-place modification of the schedule. 
    BTAP::Resources::Schedules::modify_schedule!(model, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign)
  end
end

.scale_oa_loads(model, factor) ⇒ Object

This method will scale Outdoor Air loads.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • factor (Float)

Author:



152
153
154
155
156
157
158
159
# File 'lib/openstudio-standards/btap/spaceloads.rb', line 152

def self.scale_oa_loads( model, factor )
  model.getDesignSpecificationOutdoorAirs.sort.each do |oa_def|
    oa_def.setOutdoorAirFlowperPerson(oa_def.getOutdoorAirFlowperPerson * factor ) unless oa_def.isOutdoorAirFlowperPersonDefaulted
    oa_def.setOutdoorAirFlowperFloorArea(oa_def.getOutdoorAirFlowperFloorArea * factor) unless oa_def.isOutdoorAirFlowperFloorAreaDefaulted
    oa_def.setOutdoorAirFlowRate(oa_def.getOutdoorAirFlowRate * factor) unless oa_def.isOutdoorAirFlowRateDefaulted
    oa_def.setOutdoorAirFlowAirChangesperHour(oa_def.getOutdoorAirFlowAirChangesperHour * factor ) unless oa_def.isOutdoorAirFlowAirChangesperHourDefaulted
  end
end

.scale_people_loads(model, factor) ⇒ Object

This method will scale people loads.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • factor (Float)

Author:



68
69
70
71
72
# File 'lib/openstudio-standards/btap/spaceloads.rb', line 68

def self.scale_people_loads( model, factor )
  model.getPeoples.sort.each do |item|
    item.setMultiplier( item.multiplier * factor )
  end
end

.scale_people_loads_schedule(model, a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) ⇒ Object

This method will scale people loads schedule.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • a_coef (Float)
  • b_coef (Float)
  • c_coef (Float)
  • time_shift (Float) (defaults to: nil)
  • time_sign (Float) (defaults to: nil)

Author:



82
83
84
85
86
87
# File 'lib/openstudio-standards/btap/spaceloads.rb', line 82

def self.scale_people_loads_schedule( model, a_coef, b_coef, c_coef,time_shift = nil, time_sign = nil  )
  model.getPeoples.sort.each do |item|
    #Do an in-place modification of the schedule. 
    BTAP::Resources::Schedules::modify_schedule!(model, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign )
  end
end

.set_inflitration_magnitude(model, setDesignFlowRate, setFlowperSpaceFloorArea, setFlowperExteriorSurfaceArea, setAirChangesperHour) ⇒ String

This method will set the infiltration magnitude.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • setDesignFlowRate (Float)
  • setFlowperSpaceFloorArea (Float)
  • setFlowperExteriorSurfaceArea (Float)
  • setAirChangesperHour (Float)

Returns:

Author:



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/openstudio-standards/btap/spaceloads.rb', line 182

def self.set_inflitration_magnitude( model, setDesignFlowRate,setFlowperSpaceFloorArea,setFlowperExteriorSurfaceArea,setAirChangesperHour )

  table = "name,infiltration_method,infiltration_design_flow_rate,infiltration_flow_per_space,infiltration_flow_per_exterior_area,infiltration_air_changes_per_hour\n"
  model.getSpaceInfiltrationDesignFlowRates.sort.each do |infiltration_load|
    infiltration_load.setAirChangesperHour(setAirChangesperHour ) unless setAirChangesperHour.nil?
    infiltration_load.setDesignFlowRate( setDesignFlowRate ) unless setDesignFlowRate.nil?
    infiltration_load.setFlowperSpaceFloorArea(setFlowperSpaceFloorArea ) unless setFlowperSpaceFloorArea.nil?
    infiltration_load.setFlowperExteriorSurfaceArea(setFlowperExteriorSurfaceArea ) unless setFlowperExteriorSurfaceArea.nil?
    table << infiltration_load.name.get.to_s << ","
    table << infiltration_load.designFlowRateCalculationMethod << ","
    infiltration_load.airChangesperHour.empty? ? ach = "NA" : ach = infiltration_load.airChangesperHour.get
    infiltration_load.designFlowRate.empty? ? dfr = "NA" :  dfr = infiltration_load.designFlowRate.get
    infiltration_load.flowperSpaceFloorArea.empty? ? fsfa = "NA" :  fsfa = infiltration_load.flowperSpaceFloorArea.get
    infiltration_load.flowperExteriorSurfaceArea.empty? ? fesa = "NA" :  fesa = infiltration_load.flowperExteriorSurfaceArea.get
    table << "#{ach},#{dfr},#{fsfa},#{fesa}\n"
  end
  return table
end