Solution (source code)

= Solution

The velocity field is <incompressible flow>[incompressible] because
$$
\nabla\cdot\mathbf u
=\frac{\partial u_x}{\partial x}+\frac{\partial u_y}{\partial y}
=\cos x\cos y-\cos x\cos y=0.
$$
With the convention $u_x=\psi_y$ and $u_y=-\psi_x$, a <stream function> is
$$
\boxed{\psi(x,y)=\sin x\sin y}.
$$
The <vorticity> is vertical:
$$
\boldsymbol\omega=\nabla\times\mathbf u
=(0,0,\partial_xu_y-\partial_yu_x)
=\boxed{(0,0,2\sin x\sin y)}=2\psi\,\mathbf e_z.
$$
For a steady inviscid incompressible flow, the <vorticity equation> is $(\mathbf u\cdot\nabla)\boldsymbol\omega=(\boldsymbol\omega\cdot\nabla)\mathbf u$. Here the right side is zero because the flow is independent of $z$, while the left side is $2(\mathbf u\cdot\nabla\psi)\mathbf e_z=0$ because velocity is tangent to the level sets of $\psi$. Thus the equation is satisfied.

The <streamlines> are the level curves $\sin x\sin y=\text{constant}$. The lines $x=\pi$ and $y=\pi$, together with the boundary, are separatrices; each of the four cells contains closed nested curves around a centre at $(\pi/2,\pi/2)$, $(3\pi/2,\pi/2)$, $(\pi/2,3\pi/2)$, or $(3\pi/2,3\pi/2)$.

\Image[/past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2019/ib/paper-2-cellular-flow-streamlines.png]
{title=<Streamlines> of a cellular fluid flow}