https://en.wikipedia.org/wiki/Submarine#Diesel-electric
That's just a law of converting massive amounts of kinetic energy into potential energy as the weight goes up hill.
https://en.wikipedia.org/wiki/Submarine#Diesel-electric