I am using the following code below in a measure to find the capacity of a CoilHeatingGas object. It works for hard coded capacities. However, when the value is autosized, it fails to find the value. I use exactly the same code for CoilHeatingElectric and it works fine with autosized values. Am I missing something or is there a bug in the current OS code for gas coils?
if coil.to_CoilHeatingGas.is_initialized
chg = coil.to_CoilHeatingGas.get
runner.registerInfo("CoilHeatingGas found = #{chg}.")
# Get the capacity
capacity_w = nil
if chg.nominalCapacity.is_initialized
capacity_w = chg.nominalCapacity.get
elsif chg.autosizedNominalCapacity.is_initialized
runner.registerInfo("CoilHeatingGas has autosized capacity.")
capacity_w = chg.autosizedNominalCapacity.get
else
runner.registerError("For #{coil.name} capacity is not available.")
end
runner.registerInfo("CoilHeatingGas capacity found = #{capacity_w}.")
if coil.to_CoilHeatingElectric.is_initialized
che = coil.to_CoilHeatingElectric.get
runner.registerInfo("CoilHeatingElectric found = #{che}.")
# Get the capacity
capacity_w = nil
if che.nominalCapacity.is_initialized
capacity_w = che.nominalCapacity.get
elsif che.autosizedNominalCapacity.is_initialized
capacity_w = che.autosizedNominalCapacity.get
else
OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.BoilerHotWater', "For #{che.name} capacity is not available.")
end
runner.registerInfo("CoilHeatingElectric capacity = #{capacity_w}.")