In the stock game:
red=enemy
blue=friendly
green=neutral
For realism's sake, GWX (and maybe the other supermods, I'm not familiar with those) remove the color-coding and require you to ID ships the way real sub commanders did - by getting close enough to make out the flags and markings on them. But with GWX at least you can add the colors back easily enough if you find you'd rather keep them around.
Also be aware that in the game a torpedo needs to run at least 300 meters to arm itself, so if you find yourself a few meters away (

) from an unexpected target there's really no rush to set up a shot... you've got to get some distance before there's any point in firing off an eel at her.