Solution (source code)

= Solution

For a steady flow the local time <derivative> in the <Euler equations> vanishes. The vector identity
$$
(u\cdot\nabla)u=\nabla\frac{|u|^2}{2}-u\times(\nabla\times u)
$$
reduces to a gradient when the <vorticity> $\nabla\times u$ is zero. With constant density and gravity $-gk$, the momentum equation becomes
$$
\nabla\left(\frac p\rho+\frac{|u|^2}{2}+gz\right)=0.
$$
Thus on each connected flow region,
$$
\boxed{p+\frac12\rho|u|^2+\rho gz=\text{constant}.}
$$
This is <Bernoulli's theorem> for a steady irrotational flow: irrotationality makes the same constant apply throughout a connected region, rather than only along an individual streamline.