I have the following 2D vector field $U=(u,v)=\frac{1}{x^2+y^2}(y,-x)$. When taking the curl of this field it returns zero. But when I take the circulation of the field defined as $$\Gamma=\oint_C U\cdot dl$$ it returns $\Gamma=2\pi$ which implies according to Stokes theorem that $\nabla \times U\ne0$.
Is there a way I can more accurately represent $\nabla\times U$ to account for the discrepancy? Also what is the physical reasoning for $\nabla\times U=0$ despite $\Gamma=\iint_\partial\nabla\times U\cdot \hat ndS=2\pi$?
Changing to polar coordinates, the velocity field is $\displaystyle \mathbb{u} = \frac1{r}\mathbb{e}_\theta.$ There is a singularity at $(0,0)$.
The circulation is
$$\Gamma=\oint_C U\cdot dl = \int_0^{2\pi}\frac1{r}r \, d\theta = 2\pi$$
Stokes theorem in 2D is
$$\oint_C u\,dx + v \, dy = \int\int_R \left(\frac{\partial v}{\partial x}- \frac{\partial u}{\partial y}\right)dxdy,$$
where $R$ is the region enclosed by $C$.
This fails here because $(0,0) \in R$ and the velocity components are not continuously differentiable.
Formally we can equate the two integrals by treating the vorticity as a generalized (Dirac delta) function. This, in fact, is the model for a point vortex that generates the given velocity field:
$$\mathbb{\omega}= 2\pi \delta(\mathbb{x})\mathbb{e}_z.$$