Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

You are almost there. If you look at the OpenStudio SDK for the AirTerminalSingleDuctParallelPIUReheatobject, there is a method to return the fan object. image description

In your case, you would just this to your code:

model.getAirLoopHVACs.each do |air_loop|
demand_components = air_loop.demandComponents
    demand_components.each do |demand_component|
    pfpb = demand_component.to_AirTerminalSingleDuctParallelPIUReheat
        if not pfpb.empty?
            unit = pfpb.get
            fan_cv = unit.fan.to_FanConstantVolume.get
            #you could split this line to ensure that fan is a FanConstantVolume
            #then call whatever fan methods you'd like
            fan_cv.setFanEfficiency(0.6)
            fan_cv.setPressureRise(75)
        end
    end
end

You are almost there. If you look at the OpenStudio SDK for the AirTerminalSingleDuctParallelPIUReheatobject, there is a method to return the fan object. image description

In your case, you would just add this to your code:

model.getAirLoopHVACs.each do |air_loop|
demand_components = air_loop.demandComponents
    demand_components.each do |demand_component|
    pfpb = demand_component.to_AirTerminalSingleDuctParallelPIUReheat
        if not pfpb.empty?
            unit = pfpb.get
            fan_cv = unit.fan.to_FanConstantVolume.get
            #you could split this line to ensure that fan is a FanConstantVolume
            #then call whatever fan methods you'd like
            fan_cv.setFanEfficiency(0.6)
            fan_cv.setPressureRise(75)
        end
    end
end

You are almost there. If you look at the OpenStudio SDK for the AirTerminalSingleDuctParallelPIUReheatobject, there is a method to return the fan object. image description

In your case, you would just add this to your code:

model.getAirLoopHVACs.each do |air_loop|
demand_components = air_loop.demandComponents
    demand_components.each do |demand_component|
    pfpb = demand_component.to_AirTerminalSingleDuctParallelPIUReheat
        if not pfpb.empty?
            unit = pfpb.get
            fan_cv = unit.fan.to_FanConstantVolume.get
            #you could split this line to ensure that fan is a FanConstantVolume
            #then call whatever fan methods you'd like
            fan_cv.setFanEfficiency(0.6)
            fan_cv.setPressureRise(75)
        end
    end
end