Solution (source code)

= Solution

Assume $a>0$ and choose the outward <orientation>. On the <sphere>, $\mathbf n=(x,y,z)/a$, so $\mathbf F\cdot\mathbf n=(x^2+y^2+2z^2)/a=(a^2+z^2)/a$. In <spherical coordinates>, $z=a\cos\theta$ and $dS=a^2\sin\theta\,d\theta\,d\phi$. The direct <surface integral> is
$$
\begin{aligned}
\oiint_S\mathbf F\cdot\mathbf n\,dS
&=a^3\int_0^{2\pi}\!d\phi\int_0^\pi(1+\cos^2\theta)\sin\theta\,d\theta\\
&=2\pi a^3\left(2+\frac23\right)
=\boxed{\frac{16\pi a^3}{3}}.
\end{aligned}
$$
Independently, $\nabla\cdot\mathbf F=1+1+2=4$. Its <volume integral> over the ball is
$$
\iiint_V4\,dV=4\int_0^a r^2\,dr\int_0^\pi\sin\theta\,d\theta\int_0^{2\pi}d\phi
=\boxed{\frac{16\pi a^3}{3}}.
$$
The two calculations agree exactly with the <divergence theorem>. The expression requested is a scalar <flux> of a <vector field>, namely the <dot product> with the directed <surface area element>.