I want to change the COP for WSHP, so I am trying to modify the OS measure below that I found in here, but I did not understand what these two methods do (to_ZoneHVACPackagedTerminalAirConditioner and is_initialized). I searched the documentation for ZoneHVACPackagedTerminalAirConditioner, but did not find any information about what these methods do. Can someone shade some light on these methods and where I can find their documentation?
Thank you,
# loop through zone equipment
model.getZoneHVACComponents.each do |component|
# see if it is a PTAC
if component.to_ZoneHVACPackagedTerminalAirConditioner.is_initialized
runner.registerInfo("#{component.name} is a PTAC")
ptac = component.to_ZoneHVACPackagedTerminalAirConditioner.get
# get the cooling coil
coil_cooling = ptac.coolingCoil
# see if it is single speed dx
if coil_cooling.to_CoilCoolingDXSingleSpeed.is_initialized
single_speed_dx = coil_cooling.to_CoilCoolingDXSingleSpeed.get
runner.registerInfo("The intial COP is #{single_speed_dx.ratedCOP}")
# set cop
target_cop = 1.5 * single_speed_dx.ratedCOP.get # need the get because ratedCOP returns an optional, should check if it exists before doing a get
optionalDoubleCOP = OpenStudio::OptionalDouble.new(target_cop) # not many objects need this step, this is an odd one
single_speed_dx.setRatedCOP(optionalDoubleCOP)
runner.registerInfo("The adjusted COP is #{single_speed_dx.ratedCOP}")
else
# could add in elsif to look for other types of cooling coils
end
else
# could add in elsif to look for other kinds of zone equipment
end
end