You could link the whilstling effect to the fire effect of a (fake) gun provided with (fake) AP shells and (fake) starshells, so that the boat can make noise even if the submarine has not been visually spotted.
Edit 1 : It will be a bit odd if the whistle blows up each time the ship is changing course while cruising...
Edit 2 : Maybe the trigger could be when the boat goes reverse course ? You might control the effect in the ship's .VAL file, depending on the speed (negative...). Same controller as used for bow sprays...
Edit 3 : You might use state machine controllers to control the height of a node depending on the rudder rotation (but I don't know how these controllers work ; they are used for rotating things like submarine's radio antenna & radar ; ask
Anvart :
https://www.subsim.com/radioroom/member.php?u=223431). If the rudder has turned, then a node comes immediately from -10m to the proper height in order the steam effect is perfectly placed on the whistle (and then you use the height controller to spawn the effect).