Solution (source code)

= Solution

Read the given <vector field> as the three-dimensional field $\mathbf F=(x,y,0)$. Its <divergence> is the sum of the three matching-coordinate <partial derivatives>:
$$
\boxed{\nabla\cdot\mathbf F=\frac{\partial x}{\partial x}+\frac{\partial y}{\partial y}+\frac{\partial0}{\partial z}=2}.
$$
The absence of a $z$ component does not make the three-dimensional <flux> vanish: the field still flows outward through surface normals with horizontal components.