Deriving shallow water equations: why is the vertical velocity equal to the material derivative of the surface level?
This is a statement of the kinematic free surface boundary condition: there can be no normal flow through the boundary, only tangential flow along it. Equivalently, the normal velocity (relative to the interface) of the free surface position is the same as the velocity of the fluid.
Defining the position of the free surface as
$$ z = \eta(x,y,t) $$
then taking the material derivative
$$\frac{\partial z}{\partial t} + 
u\frac{\partial z}{\partial x} +
v\frac{\partial z}{\partial y} +
w\frac{\partial z}{\partial z} =
\frac{D\eta}{Dt} 
$$
Every term on the LHS besides $\frac{\partial z}{\partial z}=1$ goes to $0$ due to the fact that $z$ is an independent coordinate (see this answer for reference), leaving us with
$$w(z=\eta) = \frac{D\eta}{Dt}$$