Solution (source code)

= Solution

Let $F(x,z,t)=z-\eta(x,t)$. The interface is a material surface for both fluids: its <material derivative> vanishes on $F=0$. With $u_j=\partial_x\phi_j$ and $w_j=\partial_z\phi_j$, this gives
$$
0=\frac{D_jF}{Dt}=w_j-\partial_t\eta-u_j\partial_x\eta,
\qquad
w_j=\partial_t\eta+u_j\partial_x\eta.
$$
Thus the <kinematic boundary condition> says that particles stay on the moving interface. The tangential <velocities> can differ; each side has its own <material derivative>. Replacing both <derivatives> by one background speed would be incorrect.

The <dynamic boundary condition for an inviscid interface> is <pressure continuity>, because the fluids have no viscous normal stress and there is no <surface tension>. The unsteady <Bernoulli equation> in each layer of <irrotational flow> reads
$$
p_j=\rho_j\left[C_j(t)-\partial_t\phi_j-\frac12|\nabla\phi_j|^2-gz\right].
$$
Equating these pressures at $z=\eta$ gives the required <dynamic boundary condition for an inviscid interface>. Choose the potential gauges so that $\rho_1C_1=\rho_2C_2$, or set both constants to zero relative to a common reference <pressure>. For example, $\phi_j=U_jx-\tfrac12U_j^2t+\phi'_j$ removes the distinct uniform-stream Bernoulli constants without changing either <velocity>. \b[Material-interface kinematics and <pressure continuity> supply the two matching conditions], with the Bernoulli gauge understood.