  We investigate the possibility that multiple populations in globular clusters
arise as a natural by-product of massive star-cluster formation. We use 3D
radiative hydrodynamics simulations for the formation of young massive clusters
to track their chemical self-enrichment during their first 5 Myr. These
clusters form embedded within filamentary Giant Molecular Clouds by a
combination of gas accretion and rapid merging of protoclusters. Chemical
enrichment is a dynamic process happening as the young cluster assembles, so
that the original (1P) and enriched (2P) subpopulations of stars form almost
simultaneously. Here we test two simple and opposite extremes for the injection
of enriched material into the intracluster gas: we assume either continuous
injection in a way that tracks the star formation rate; or sudden injection by
a single instantaneous event. Using helium abundance as a proxy for the
enrichment, we find that realistic multiple population features can be
reproduced by injecting a total helium mass amounting to a few percent of the
cluster's total mass. The differences in individual growth histories can lead
to widely differing 1P/2P outcomes. These models suggest that dual or multiple
populations can emerge rapidly in massive star clusters undergoing the typical
mode of star cluster formation.
