Modelling self-pollution of globular clusters from AGB stars