James Brundell, Dunedin, New Zealand.
Use the -e option:
rsync -avz -e "ssh -p $portNumber" user@remoteip:/path/to/files/ /local/path/