At this time of my carer (U-boat a VII C type) im in (La Spezia April 1943) in war operations and untill now it was possible to avoid to be destroyed by DD attacks with some sucess.
There isnt a magical formula to avoid...but all aways i dive deep (180-260m and more if necessary) and all aways i change deep and direction keeping a low profile to the attacker, if the attacker its about 400-500 m away from me, i keep the speed 1 knt, and if aproches at attack run, before i listen "deep charges in the water" its flank speed or back emergency, using my own time to react to the enemy attack.
Folow this steeps its not the away to sucess...but for me i folow my own instincts, allied with my own experience in the game including deep charges attacks and DD beaivour...and thats it, i cant put in words what my instincts tell me to do in that moment " for all the action, there is all aways a contra-reaction".