Solution (source code)

= Solution

Treat the <free surface> as the material level set $F(x,y,t)=y-\eta(x,t)=0$. The <kinematic boundary condition> $DF/Dt=0$, with $\mathbf u=\nabla\phi$, gives
$$
-\eta_t-\phi_x\eta_x+\phi_y=0,
\qquad
\boxed{\phi_y=\eta_t+\phi_x\eta_x\quad\text{on }y=\eta.}
$$
This says that fluid initially on the <free surface> remains on it.

For constant <mass density> $\rho$, the <Euler momentum equation> under <gravity> is $D\mathbf u/Dt=-\nabla p/\rho-g\mathbf e_y$. Since the flow is <irrotational>, $(\mathbf u\cdot\nabla)\mathbf u=\nabla(|\mathbf u|^2/2)$. Integration in space therefore gives the <Unsteady Bernoulli equation>
$$
\phi_t+\frac12|\nabla\phi|^2+\frac p\rho+gy=B(t).
$$
At the <free surface>, $p=P_a$ and $y=\eta$. Adding a function $G(t)$ to the <velocity potential> leaves the <velocity field> unchanged; choose $G'=P_a/\rho-B(t)$. With this choice the surface <dynamic boundary condition for an inviscid interface> becomes
$$
\boxed{\phi_t+\frac12|\nabla\phi|^2+g\eta=0\quad\text{on }y=\eta.}
$$
The constant atmospheric <pressure> has been absorbed into this choice of potential.