How did WWII diesel submarines get rid of the fumes when they were underwater?

by hablador
itsallfolklore

They ran on batteries underwater. The batteries needed to be recharged with the diesel engine, which could only be run on the surface, because of the need for air to run the engines and the need to exhaust the fumes.