First time here? Check our help page!
2

How to get Maximum Flow Rate

Hello, I'm trying to call the maximum flow rate of a fan. First there's a sizing run, and then a segment that attempts to call the maximum flow rate:

model.runSizingRun()
model.getAirLoopHVACs.each do |air_loop|
supply_components = air_loop.supplyComponents
    supply_components.each do |supply_component|
        unit = supply_component.to_FanVariableVolume
        if not unit.empty?  
        fan_vv = unit.get
        runner.registerInfo("#{fan_vv.name}")   
            if fan_vv.isMaximumFlowRateAutosized == true
            runner.registerInfo("Autosized")
            flow_rate = fan_vv.getMaximumFlowRate
            runner.registerInfo("#{flow_rate}")             
            else
            runner.registerInfo("Not Autosized")
            end
        end
    end
end

The info message for flow_rate results in a '#' instead of a value.

image description

I'm not sure if I'm using the get.MaximumFowRate method correctly.

image description

Thanks in advance for any assistance!

Luke.Y's avatar
89
Luke.Y
asked 2017-11-21 07:43:09 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

You are missing .get when you assign the OSOptionalQuantity , so your code should look like that:

model.runSizingRun()
model.getAirLoopHVACs.each do |air_loop|
supply_components = air_loop.supplyComponents
    supply_components.each do |supply_component|
        unit = supply_component.to_FanVariableVolume
        if not unit.empty?  
        fan_vv = unit.get
        runner.registerInfo("#{fan_vv.name}")   
            if fan_vv.isMaximumFlowRateAutosized == true
            runner.registerInfo("Autosized")
            flow_rate = fan_vv.getMaximumFlowRate.get
            runner.registerInfo("#{flow_rate}")             
            else
            runner.registerInfo("Not Autosized")
            end
        end
    end
end
Avi's avatar
4.3k
Avi
answered 2017-11-21 10:07:31 -0500, updated 2017-11-21 12:47:39 -0500
edit flag offensive 0 remove flag delete link

Comments

@Avi, thanks for your help!

Luke.Y's avatar Luke.Y (2017-11-21 13:23:06 -0500) edit

If you are satisfied with the answer you can mark it as correct.

Avi's avatar Avi (2017-11-21 13:32:21 -0500) edit
1

Just to clarify, I changed the line flow_rate = fan_vv.getMaximumFlowRate.get to flow_rate = fan_vv.autosizedMaximumFlowRate.get since the intention was to call the design flow rate based on a sizing run.

Luke.Y's avatar Luke.Y (2017-11-21 18:41:36 -0500) edit
add a comment see more comments