Solution (source code)

= Solution

For steady, inviscid, <incompressible flow>, Euler's equation integrated along a <streamline> gives
$$
\boxed{p+\tfrac12\rho v^2+\rho gz=\text{constant along that streamline}.}
$$
This is <Bernoulli's equation>. The constant is common to different <streamlines> if the flow is also irrotational; incompressibility alone does not imply that. Viscous loss or work by a pump requires additional terms.

A <Pitot-static tube> compares <stagnation pressure> $p_0$ at a forward-facing opening with nearby static <pressure> $p$. For equal height, the stagnation point has $v=0$, so
$$
\boxed{v=\sqrt{2(p_0-p)/\rho}.}
$$
This measures flow speed when compressibility corrections are negligible.

In a flowmeter using the <Venturi effect>, continuity gives $A_1v_1=A_2v_2$. For a horizontal constriction with $A_2<A_1$, Bernoulli gives $p_1-p_2=\rho(v_2^2-v_1^2)/2$, hence
$$
\boxed{v_1=\sqrt{\frac{2(p_1-p_2)}{\rho[(A_1/A_2)^2-1]}}.}
$$
The fluid accelerates and static <pressure> falls in the throat. This is a second practical application of the conversion between <pressure> and <kinetic energy>; real instruments need calibration for flow losses.