Solution (source code)

= Solution

<Incompressibility> and $\mathbf u=\nabla\phi$ give $\boxed{\nabla^2\phi=0}$. The permitted vector identity, with zero <vorticity>, gives $(\mathbf u\cdot\nabla)\mathbf u=\nabla(|\mathbf u|^2/2)$. Substituting into Euler's equation yields
$$
\nabla\left(\rho\phi_t+\frac\rho2|\nabla\phi|^2+p+\rho gz\right)=0.
$$
The bracket is spatially constant in a connected fluid region, so
$$
\boxed{\rho\phi_t+\frac\rho2|\nabla\phi|^2+p+\rho gz=F(t).}
$$
Adding a function of time to the potential changes only $F(t)$ and leaves the <velocity> unchanged.