lib/openstudio-standards/standards/Standards.WaterHeaterMixed.rb in openstudio-standards-0.2.8 vs lib/openstudio-standards/standards/Standards.WaterHeaterMixed.rb in openstudio-standards-0.2.9
- old
+ new
@@ -7,19 +7,27 @@
# Per PNNL http://www.energycodes.gov/sites/default/files/documents/PrototypeModelEnhancements_2014_0.pdf
# Appendix A: Service Water Heating
#
# @return [Bool] true if successful, false if not
def water_heater_mixed_apply_efficiency(water_heater_mixed)
+ # TODO remove this once workaround for HPWHs is removed
+ if water_heater_mixed.partLoadFactorCurve.is_initialized
+ if water_heater_mixed.partLoadFactorCurve.get.name.get.include?('HPWH_COP')
+ OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.WaterHeaterMixed', "For #{water_heater_mixed.name}, the workaround for HPWHs has been applied, efficiency will not be changed.")
+ return true
+ end
+ end
+
# Get the capacity of the water heater
# TODO add capability to pull autosized water heater capacity
# if the Sizing:WaterHeater object is ever implemented in OpenStudio.
capacity_w = water_heater_mixed.heaterMaximumCapacity
if capacity_w.empty?
OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.WaterHeaterMixed', "For #{water_heater_mixed.name}, cannot find capacity, standard will not be applied.")
return false
else
- capacity_w = capacity_w.get
+ capacity_w = capacity_w.get / water_heater_mixed.component_quantity
end
capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
# Get the volume of the water heater
# TODO add capability to pull autosized water heater volume
@@ -27,10 +35,10 @@
volume_m3 = water_heater_mixed.tankVolume
if volume_m3.empty?
OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.WaterHeaterMixed', "For #{water_heater_mixed.name}, cannot find volume, standard will not be applied.")
return false
else
- volume_m3 = @instvarbuilding_type == 'MidriseApartment' ? volume_m3.get / 23 : volume_m3.get
+ volume_m3 = @instvarbuilding_type == 'MidriseApartment' ? volume_m3.get / 23 : volume_m3.get / water_heater_mixed.component_quantity
end
volume_gal = OpenStudio.convert(volume_m3, 'm^3', 'gal').get
# Get the heater fuel type
fuel_type = water_heater_mixed.heaterFuelType