Surface range is straightforward, that's in each sub's SIM file;
Miles=15000
Knots=12
will give a max range of 15000 miles at 12 knots.
Submerged is a different story;
http://www.subsim.com/radioroom/showthread.php?t=211380
That subroutine is so screwed up the best you can do is get it somewhere close to a realistic feel then just live with it.
What I'm using now;
S-Class;
E-Propulsion
Max Speed = 9
Eng Power = 2350
Eng RPM = 296
Ranges
Submerged
Miles = 0.5
Knots = 30
All fleet boats;
E-Propulsion
Max Speed = 10
Eng Power = 2660
Eng RPM = 270
Ranges
Submerged
Miles = 1
Knots = 45
That looks totally whacko, but read the thread - the labels are not what they're labeled to be for underwater propulsion.