  Detailed observations of globular clusters (GCs) have revealed evidence of
self-enrichment: some of the heavy elements that we see in stars today were
produced by cluster stars themselves. Moreover, GCs have internal
subpopulations with different elemental abundances, including, in some cases,
in elements such as iron that are produced by supernovae. This paper presents a
theoretical model for GC formation motivated by observations of Milky Way star
forming regions and simulations of star formation, where giant molecular clouds
fragment into multiple clumps which undergo star formation at slightly
different times. Core collapse supernovae from earlier-forming clumps can
enrich later-forming clumps to the degree that the ejecta can be retained
within the gravitational potential well, resulting in subpopulations with
different total metallicities once the clumps merge to form the final cluster.
The model matches the mass-metallicity relation seen in GC populations around
massive elliptical galaxies, and predicts metallicity spreads within clusters
in excellent agreement with those seen in Milky Way GCs, even for those whose
internal abundance spreads are so large that their entire identity as a GC is
in question. The internal metallicity spread serves as an excellent measurement
of how much self-enrichment has occurred in a cluster, a result that is very
robust to variation in the model parameters.
