Dynamics of Agulhas Retroflection and Ring Formation in a Numerical Model. Part I: The Vorticity Balance