Simulations of the mean solar magnetic field during sunspot cycle 21