Thinking further on the security valve, I think what happens is that as the hot water leaves the upper outlet, it is replaced by cold water from the inlet. The cold water stays in the bottom allowing only hot water to leave via the outlet. When the shut off valve is closed and the security valve is opened, air enlaces the hot water leaving via the upper outlet and because the outlet is high, the replacement air goes to the top of the tank and therefore only air can now escape via the outlet leaving all the water in the tank sitting below the upper outlet in place. I think that makes sense?