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.