  Magnetic flux is continuously being removed and replenished on the solar
surface. To understand the removal process we carried out 3D radiative MHD
simulations of the evolution of patches of photospheric magnetic field with
equal amounts of positive and negative flux. We find that the flux is removed
at a rate corresponding to an effective turbulent diffusivity, of 100--340
km^2/s, depending on the boundary conditions. For average unsigned flux
densities above about 70 Gauss, the percentage of surface magnetic energy
coming from different field strengths is almost invariant. The overall process
is then one where magnetic elements are advected by the horizontal granular
motions and occasionally come into contact with opposite-polarity elements.
These reconnect above the photosphere on a comparatively short time scale after
which the U loops produced rapidly escape through the upper surface while the
downward retraction of inverse-U loops is significantly slower, because of the
higher inertia and lower plasma beta in the deeper layers.
