ThermalZone::airLoopHVACTerminal
returns an HVACComponent class, which is the 'generic' class that all AirTerminal object types inherit from (AirTerminalDualDuct types inherit from Mixer, not StraightComponent). Once you get the HVACObject, you need to 'cast' it to the proper base type in order to access the specific terminal class methods.
e.g.:
terminal = thermal_zone.airLoopHVACTerminal
if terminal.is_initialized
terminal = terminal.get # this gets the HVACComponent
end
# cast to AirTerminalSingleDuctVAVReheat class
if terminal.to_AirTerminalSingleDuctVAVReheat.is_initialized
terminal = terminal.to_AirTerminalSingleDuctVAVReheat.get
end
terminal.setMaximumAirFlowRate(rate)