I guess I am not sure what you are asking.

Do you want to compute the flux out of the top half of the sphere using the divergence theorem?

If so you end up with the integral

If you convert to spherical coordinates you get

Note that phi is the plane angle and theta is the angle measured from the positive z axis