NREL / openstudio-calibration-gem

Other
5 stars 5 forks source link

Coil:CoolingDX measures fail on CreteTypical models #64

Open craig-simmons opened 8 months ago

craig-simmons commented 8 months ago

The current code gets to the DX coils through the AirLoopHVAC objects and expects the coils to be a direct component of the loop.. Currently CreateTypical (via Standards?) implements AirLoopHVACUnitarySystem objects and the coils are not added. For my purposes I just added to the code below and found the coils directly model.getCoilCoolingDXSingleSpeeds and added them all to the coils array because I just wanted to change them all. But a more robust solution is needed to support the current input structure that allows for specific coils to be changed based on the AirLoopHVAC they're associated with.

Current code sample from lib/measures/CoilCoolingDXSingleSpeedMultiplier/measure.rb (lines 131 - 141)

      loops = model.getAirLoopHVACs /n
      # loop through air loops
      loops.each do |loop|
        supply_components = loop.supplyComponents
        # find coils on loops
        supply_components.each do |supply_component|
          unless supply_component.to_CoilCoolingDXSingleSpeed.empty?
            coils << supply_component.to_CoilCoolingDXSingleSpeed.get
          end
        end
      end

Code I added (immediately after the above lines) to catch all coils in the model:

      dxcoils = model.getCoilCoolingDXSingleSpeeds
      dxcoils.each do |dxcoil|
        coils << dxcoil
      end