Im looking to create a program which models a tabletop water tunnel. One part of the system involves flow out of a tank through a pipe. So far I have used the assumption that the pressure in the pipe is the same as atmospheric but I feel this is wrong, and therefore my use of SQRT(2*g*height difference) is incorrect to calculate the velocity out of the pipe. How would I go about finding the pressure in the pipe? And how would I take into account surface roughness effects along the length of pipe?