Solution (source code)

= Solution

The <velocity potential> gives horizontal and vertical <velocity> components $(\phi_x,\phi_z)$. The <kinematic boundary condition> at each fixed impermeable wall is zero normal fluid velocity, hence
$$
\boxed{\phi_x=0\text{ at }x=0,L,\qquad\phi_z=0\text{ at }z=-h}.
$$
Let $\eta(x,t)$ be the <surface elevation>. To first order in its <amplitude>, the <kinematic boundary condition for a free-surface graph> gives $\eta_t=\phi_z$ at $z=0$. The <dynamic boundary condition for an inviscid interface> fixes the surface <pressure> to atmospheric pressure. The unsteady <Bernoulli equation>, after choosing the time-dependent gauge of $\phi$, then gives $\phi_t+g\eta=0$ at $z=0$: the quadratic velocity term is second order in <amplitude>. Differentiate this last equation in time and eliminate $\eta_t$ to obtain the <linearized free-surface boundary conditions> in combined form,
$$
\boxed{\phi_{tt}+g\phi_z=0\qquad(z=0)}.
$$