Solution (source code)

= Solution

For
$$
\phi=Z(z)\cos\frac{\pi x}{L}
\cos\frac{2\pi y}{L}F(t),
$$
the normal derivative at $x=0,L$ contains $\sin(\pi x/L)$ and the normal derivative at $y=0,L$ contains $\sin(2\pi y/L)$. Both therefore vanish at the side walls.

At $z=0$, $\phi_t$ has exactly the same horizontal dependence as the imposed pressure. The dynamic boundary condition is consequently consistent provided $\eta$ has that same horizontal mode. This is the <rectangular standing surface-gravity mode> selected by the forcing.