OS Measure - report autosized capacity for CoilHeatingGas object?
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. I know when it gets to chg.autosizedNominalCapacity.get, the returned error is "For Coil Heating Gas 4 capacity is not available"
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}.")
Additionally, @jmarrec was gracious enough to help. When he ran the model through the <companion_folder>/run/ directory it can find the autosized capacity. These are the results.
[1] run(main)> m = osload('in.osm')
[2] run(main)> sql = OpenStudio::SqlFile.new()
[2] run(main)> sqlFile = OpenStudio::SqlFile.new('eplusout.sql')
[3] run(main)> m.setSqlFile(sqlFile)
[4] run(main)> coil = m.getCoilHeatingGass[0]
[5] run(main)> puts coil
OS:Coil:Heating:Gas, {871a33d0-6913-4883-9486-ccdfa3d5f11a}, !- Handle Coil Heating Gas 4, !- Name {13af84d4-14b4-44cd-8194-59dbf9daecee}, !- Availability Schedule Name 0.8, !- Gas Burner Efficiency Autosize, !- Nominal Capacity {W} , !- Air Inlet Node Name , !- Air Outlet Node Name , !- Temperature Setpoint Node Name 0, !- Parasitic Electric Load {W} , !- Part Load Fraction Correlation Curve Name 0; !- Parasitic Gas Load {W}
=> nil
[6] run(main)> coil.autosizedNominalCapacity.get => 11200.713297285292
It's apparently looking for "Design Size Nominal Capacity" in the E+ output file, does that exist? See https://github.com/NREL/OpenStudio/bl...
Yes, "Design Size Nominal Capacity" for heating does exist in the eplustbl.html file in the Coil:Heating:Fuel Table. Maybe the change in E+ to generalize coil:heating:gas to coil:heating:fuel has created an issue with the match?
It sounds like a bug to me then. I suggest reporting the issue at https://github.com/NREL/OpenStudio/is....
Its been determined that its not a bug. I will edit my initial question to include additional information on the issue.