Inside a submarine, between the outer skin and the pressure hull, are several tanks of various design and purpose. These tanks control the total weight of the ship, allowing it to submerge or surface. They also control the trim or balance, fore and aft, of the submarine. The main ballast tanks have the primary function of either destroying or restoring positive buoyancy to the submarine. Allowing air to escape through hydraulically operated vents at the top of the tanks lets seawater enter through the flood ports at the bottom to replace the air.
Sufficient air is left trapped in the tanks to prevent the seawater from reentering.
The variable ballast tanks have no direct connection to the sea. Therefore, we must pump water into or out of them. The negative tank and the safety tank can open to the sea through large flood valves. These valves, as well as the vent valves for the main ballast tanks and those for the safety and negative tanks, are all hydraulically operated. The vents and flood valves are outside the pressure hull, so some means of remote control is needed to open and close them from within the submarine.