I don't have the time for filling up the flasks with the compressor in my head. The only number I have in my head is that it takes about 10-15 minutes to blow the tanks with the diesel.
But all the things you've mentioned are taken into account and much more (like for example the jet effect when blowing and damage to the tanks itself). The simulation of the tanks is based on papers about development of computer controlled ballast tanks. It is pretty complicated math. I've worked 6 weeks full time on the ballast tanks alone and during that time I've discussed my results with the former chief engineer of a Type VII (I've got also help from him while I was working on the simulation of the diesel).
I usually work on the more complicated things in a separate project for testing and I implement them into the game session project when they are ready - this movie shows my "test bed" for the diesel engine:
https://www.facebook.com/photo.php?v=10152456497769604