lib/openstudio-standards/standards/Standards.ZoneHVACComponent.rb in openstudio-standards-0.1.15 vs lib/openstudio-standards/standards/Standards.ZoneHVACComponent.rb in openstudio-standards-0.2.0.rc1
- old
+ new
@@ -1,27 +1,25 @@
-# open the class to add methods to apply HVAC efficiency standards
-class OpenStudio::Model::ZoneHVACComponent
- # Sets the fan power of zone level HVAC equipment
+class Standard
+ # @!group ZoneHVACComponent
+
+ # Sets the fan power of zone level HVAC equipment
# (PTACs, PTHPs, Fan Coils, and Unit Heaters)
# based on the W/cfm specified in the standard.
#
- # @param template [String] the template base requirements on
# @return [Bool] returns true if successful, false if not
- def apply_prm_baseline_fan_power(template)
- OpenStudio.logFree(OpenStudio::Debug, 'openstudio.model.ZoneHVACComponent', "Setting fan power for #{name}.")
+ def zone_hvac_component_apply_prm_baseline_fan_power(zone_hvac_component)
+ OpenStudio.logFree(OpenStudio::Debug, 'openstudio.model.ZoneHVACComponent', "Setting fan power for #{zone_hvac_component.name}.")
# Convert this to the actual class type
- zone_hvac = if to_ZoneHVACFourPipeFanCoil.is_initialized
- to_ZoneHVACFourPipeFanCoil.get
- elsif to_ZoneHVACUnitHeater.is_initialized
- to_ZoneHVACUnitHeater.get
- elsif to_ZoneHVACPackagedTerminalAirConditioner.is_initialized
- to_ZoneHVACPackagedTerminalAirConditioner.get
- elsif to_ZoneHVACPackagedTerminalHeatPump.is_initialized
- to_ZoneHVACPackagedTerminalHeatPump.get
- else
- nil
+ zone_hvac = if zone_hvac_component.to_ZoneHVACFourPipeFanCoil.is_initialized
+ zone_hvac_component.to_ZoneHVACFourPipeFanCoil.get
+ elsif zone_hvac_component.to_ZoneHVACUnitHeater.is_initialized
+ zone_hvac_component.to_ZoneHVACUnitHeater.get
+ elsif zone_hvac_component.to_ZoneHVACPackagedTerminalAirConditioner.is_initialized
+ zone_hvac_component.to_ZoneHVACPackagedTerminalAirConditioner.get
+ elsif zone_hvac_component.to_ZoneHVACPackagedTerminalHeatPump.is_initialized
+ zone_hvac_component.to_ZoneHVACPackagedTerminalHeatPump.get
end
# Do nothing for other types of zone HVAC equipment
if zone_hvac.nil?
return false
@@ -51,25 +49,25 @@
max_air_flow_rate = fan.maximumFlowRate.get
end
max_air_flow_rate_cfm = OpenStudio.convert(max_air_flow_rate, 'm^3/s', 'ft^3/min').get
# Set the impeller efficiency
- fan.change_impeller_efficiency(fan.baseline_impeller_efficiency(template))
+ fan_change_impeller_efficiency(fan, fan_baseline_impeller_efficiency(fan))
# Set the motor efficiency, preserving the impeller efficency.
# For zone HVAC fans, a bhp lookup of 0.5bhp is always used because
# they are assumed to represent a series of small fans in reality.
- fan.apply_standard_minimum_motor_efficiency(template, fan.brake_horsepower)
+ fan_apply_standard_minimum_motor_efficiency(fan, fan_brake_horsepower(fan))
# Calculate a new pressure rise to hit the target W/cfm
fan_tot_eff = fan.fanEfficiency
fan_rise_new_pa = fan_efficacy_w_per_m3_per_s * fan_tot_eff
fan.setPressureRise(fan_rise_new_pa)
# Calculate the newly set efficacy
fan_power_new_w = fan_rise_new_pa * max_air_flow_rate / fan_tot_eff
fan_efficacy_new_w_per_cfm = fan_power_new_w / max_air_flow_rate_cfm
- OpenStudio.logFree(OpenStudio::Info, 'openstudio.model.ZoneHVACComponent', "For #{name}: fan efficacy set to #{fan_efficacy_new_w_per_cfm.round(2)} W/cfm.")
+ OpenStudio.logFree(OpenStudio::Info, 'openstudio.model.ZoneHVACComponent', "For #{zone_hvac_component.name}: fan efficacy set to #{fan_efficacy_new_w_per_cfm.round(2)} W/cfm.")
return true
end
-end
\ No newline at end of file
+end