Theoretical investigation on the anisotropic magnetocaloric effect: Application to DyAl2