I have attached the geometry of interest with some parts of the solution. The geometry is a vessel that is half of a sphere with an orifice at the bottom. The first expression that they have written, the "A*(2*g*z)^0.5=....." is from conservation of flow rate. 2*g*z is the velocity at the inlet of the orifice. I don't understand how they got that velocity since there should be a pressure drop from z to the orifice opening. Basically it just seems like they did Potential energy (@ z) = Kinetic Energy at orifice opening. So that gives g*z=0.5*v^2=>v=(2*g*z)^0.5 but isn't there a pressure gain as well of density*gravity*z? The only way they could have gotten that velocity is if the pressure at both locations are the same.