Solution (source code)

= Solution

The general <continuity equation> is $\rho_t+\nabla\cdot(\rho u)=0$, or $D\rho/Dt+\rho\nabla\cdot u=0$. An <incompressible flow> has $D\rho/Dt=0$, so for positive density \b[$\boxed{\nabla\cdot u=0}$].

For the displayed velocity field, on $x^2+y^2>0$,
$$
\partial_x\frac{y}{x^2+y^2}=-\frac{2xy}{(x^2+y^2)^2},\qquad
\partial_y\frac{-x}{x^2+y^2}=\frac{2xy}{(x^2+y^2)^2}.
$$
The sum is zero. A <stream function> with the required sign convention is
$$
\boxed{\psi(x,y)=\frac12\log(x^2+y^2)+C.}
$$
Its derivatives give exactly $u=(\psi_y,-\psi_x)$. The origin is excluded because the prescribed velocity is singular there.