Let $\Lambda\subseteq\mathbb R^2$ be open, $u\in C^1(\Lambda,\mathbb R^2)$ with $\nabla\cdot u=0$ and $$w:=\frac{\partial u_2}{\partial x_1}-\frac{\partial u_1}{\partial x_2}.$$
How can we show that $$\int_\Lambda w=0?\tag1$$
Since $\nabla\cdot u=0$, $$\int_\Lambda(u\cdot\nabla)\varphi=-\int_\Lambda(\nabla\cdot u)\varphi=0\;\;\;\text{for all }\varphi\in C_c^\infty(\Lambda)\tag2.$$ On the other hand, $$\int_\Lambda w\varphi=\int u_1\frac{\partial\varphi}{\partial x_2}-u_2\frac{\partial\varphi}{\partial x_1}\;\;\;\text{for all }\varphi\in C_c^\infty(\Lambda)\tag3.$$
I guess I've made a mistake at any point above, since the desired conclusion seems to require that $\int w\varphi=\int u_1\frac{\partial\varphi}{\partial x_1}-u_2\frac{\partial\varphi}{\partial x_2}$ instead (since this is equal to $\int_\Lambda(u\cdot\nabla)\varphi$).
This is false. Take $u=(-x_2,x_1)$. Then $w=2$ everywhere.
EDIT: With periodic boundary conditions on the square $S$, by Green's Theorem $\int_S w = \int_{\partial S} u\cdot dr = 0$.