On the effects of photoionization feedback on second-generation star formation in globular clusters of different masses

We simulate the formation of second-generation stars in young clusters with masses of $10^{5}$ and $10^6\ {\rm M_\odot}$ within $30-100\ {\rm Myr}$ after the formation of clusters. We assume the clusters move through a uniform interstellar medium with gas densities of $10^{-24}$ and $10^{-23}\ {\rm gcm}^{-3} $ and consider the stellar winds from asymptotic giant branch (AGB) stars, gas accretion onto the cluster, ram pressure, star formation, and photoionization feedback of our stellar systems including binary stars. We find that second-generation (SG) stars can be formed only within the $10^6\ {\rm M_\odot}$ cluster in the high-density simulation, where the cluster can accrete sufficient pristine gas from their surrounding medium, leading to efficient cooling required for the ignition of SG formation and sufficient dilution of the AGB ejecta. Hence, our results indicate that a denser environment is another requirement for the AGB scenario to explain the presence of multiple populations in globular clusters. On the other hand, the ionizing feedback becomes effective in heating the gas in our low-density simulations. As a result, the clusters cannot accumulate a considerable amount of pristine gas at their center. The gas mass within the clusters in these simulations is similar to that in young massive clusters (YMCs). Hence, our studies can provide a possible reason for the lack of gas, star formation, and SG stars in YMCs. Our results indicate that the ionizing stellar feedback is not a severe problem for SG formation; rather, it can help the AGB scenario to account for some observables.


INTRODUCTION
Globular clusters (GCs), containing low-metallicity ([Fe/H]≲ 1 ), low-mass (≲ 0.75 M ⊙ ), and old (≳ 1Gyr) stars (Cadelano et al. 2020), can provide useful information as early star-forming subsystems to study the formation history of their parent galaxies (Larson 1996).Recent observations have revealed that GC stars display anomalous variations in light elements (e. g.He, C, N, O, Na, Al, and sometimes Mg) that are not expected to be due low-mass stars during stellar evolutionary processes (Prantzos et al. 2007;Carretta et al. 2009;Piotto et al. 2015).Together with another population characterized by a composition similar to normal field stars, such anomalous stars build Multiple Stellar Populations (MSPs) observed in GCs.The anomalous stars are enriched in N and Na and depleted in C and O, whereas the sum of the C, N, and O abundances inside these stars are observed to be generally constant within the measurement errors (Dickens et al. 1991;Yong et al. 2015).Additionally, except for some massive GCs such as  Cen (Johnson & Pilachowski 2010), no considerable spread in Fe abundance and heavy elements has been found in GCs hosting MSPs (Gratton et al. 2004(Gratton et al. , 2012)).This specific abundance pattern makes it difficult to explain how MSPs have been formed in GCs; hence their formation remains a mystery.
★ E-mail:asiyeh.yaghoobi@gmail.comSuch an abundance pattern is expected from the yields of hot hydrogen burning within intermediate-mass and massive stars (Renzini et al. 2015).Hence, most scenarios proposed for the formation of MSPs are based on the ejecta of these stars, fuelling the formation of the SG stars, where MSPs are subsequent generations.The population with the same composition as the field stars at the same metallicity [Fe/H] is referred to as the first generation (FG) or first population.Stars within GCs showing variation in the light elements compared to the first population are commonly categorized as the second generation (SG) or second population (Bastian & Lardo 2018;Milone & Marino 2022).To date, the suggested FG candidates are intermediate-mass asymptotic giant branch stars (AGBs; 4 ≤ / M ⊙ ≤ 8; D' Ercole et al. 2008;Conroy & Spergel 2011;D'Ercole et al. 2016;Bekki 2017), fast rotating massive stars (FRMS, 20 ≤ / M ⊙ ≤ 120; Decressin et al. 2007a,b;Krause et al. 2013), and supermassive stars (/ M ⊙ ≥ 10 4 ; Denissenkov & Hartwick 2014;Denissenkov et al. 2015).Alternative scenarios propose different mechanisms in which the MSPs may be coeval.For example, in the early disc accretion scenario, the FG low-mass stars accrete enriched stellar winds from more massive interacting binary stars, resulting in different abundances (Bastian et al. 2013a).
Each proposed scenario has its own advantages and drawbacks, but none of them has been able to explain all the observed properties of MSPs (see Renzini et al. 2015;Bastian & Lardo 2018), such as the observed chemical anomalies.To solve this issue, the ejecta need to be diluted by pristine gas, i.e. the gas with the same composition as the one that formed the FG stars.In addition, most models, such as AGB and FRMS scenarios, encounter a "mass budget problem" to produce a cluster with a SG fraction similar to observed values, between ∼ 30 and 90 percent for Galactic GCs (Milone et al. 2017).One problem is that, assuming a standard initial mass function (IMF), the FG ejecta do not contain enough mass to make up the entirety of the observed SG mass.This problem might be alleviated in specific conditions, such as a top-heavy IMF for FG stars and a binary fraction close to unity (D'Ercole et al. 2008;Khalaj & Baumgardt 2015;Krause et al. 2016;Vesperini et al. 2021).While generally not clear from observations, the epoch of SG formation and age difference between populations depend on the proposed scenario.In models based on massive and very massive stars, SG formation should occur within a short time-scale after the formation of FG stars and before the start of type II supernova explosions to avoid the incorporation of newly produced Fe and a significant metallicity spread (e. g.Krause et al. 2013).On the other hand, in the AGB scenario, the SG formation starts after the end of supernovae (SNe) (about 30 Myr) and lasts for roughly a few ten Myrs.(D'Ercole et al. 2008(D'Ercole et al. , 2016;;Calura et al. 2019).
The presence of MSPs with anomalous chemical compositions is found to be specific to only massive GCs older than 2 Gyr (Bastian & Lardo 2018).It is not clear yet whether young massive clusters (YMCs, with a mass range of [10 4 − 10 5.5 ] M ⊙ and ages ≲ 100 Myr) host MSPs with such anomalous chemical compositions (Portegies Zwart et al. 2010).Nevertheless, observationally these clusters do not show any significant amount of gas (Bastian et al. 2013b(Bastian et al. , 2014;;Hollyhead et al. 2015;Cabrera-Ziri et al. 2015) and any evidence for ongoing star formation (SF) (Bastian et al. 2013b).As their age can be compared with the proposed epoch for SG formation in scenarios, in principle these facts can constrain SG formation models (Bastian et al. 2013b;Bastian & Strader 2014;Bastian et al. 2014), assuming that YMCs are equivalent to proto-GCs.But some rely on the idea that the SG formation is limited to only the early Universe, not the present-day one (D'Ercole et al. 2016;Renzini et al. 2015).For example, D' Ercole et al. (2016) show that the AGB scenario needs ambient surrounding properties of GCs consistent with those of star-forming disk galaxies observed at redshifts > 2.Moreover, the fact that YMCs are almost gas free (Bastian et al. 2013b(Bastian et al. , 2014;;Hollyhead et al. 2015;Cabrera-Ziri et al. 2015) indicates that they efficiently expel their intracluster medium (ICM), despite significant mass-loss from their stars and their capability to accrete gas from the ambient medium.This raises another question: under which physical conditions can a young cluster get rid of its ICM?To answer this question, we require more comprehensive theoretical studies of the gas dynamics in young clusters, including the key processes, including supernova (SN) feedback, ram pressure, radiative feedback, cluster potential, and stellar wind heating (Conroy & Spergel 2011;Calura et al. 2015;Gavagnin et al. 2017;Wünsch et al. 2017;Naiman et al. 2018;Chantereau et al. 2020).
Since a few years, we have focused on the gas accumulation and SG formation in young (> 30 Myr) clusters with different masses [10 5 − 10 7 M ⊙ ] based on the AGB scenario (Calura et al. 2019;Lacchin et al. 2021;Yaghoobi et al. 2022a,b;Lacchin et al. 2022).In this scenario, the origin of SG stars is a mixture of the AGB stellar winds and pristine gas accumulated in clusters.D 'Ercole et al. (2016) investigate the origin of the pristine gas and its dynamics during the phase of SG formation.Their model follows three requirements; i) the pristine gas should initially be removed from the cluster by type II SN explosions within about 30 Myr after the birth of the first generation of stars; ii) the cluster should be able to accrete the pristine gas within about 60 Myr; iii) the SN II ejecta should not contaminate the pristine gas.They show that these conditions can explain the origin of SG stars only in massive clusters that formed in the disks of galaxies at  > 2 (Kravtsov & Gnedin 2005;Kruĳssen 2015).
Using 3D hydrodynamical simulations, we investigated this model for clusters of different masses in Calura et al. (2019) and Yaghoobi et al. (2022a) (hereafter PaperI).We performed a parameter study of the gas density of the ISM with values 10 −24 and 10 −23 g cm −3 , roughly corresponding to the values observed in star-forming galaxies at low and high redshifts (Marcolini et al. 2003;Wardlow et al. 2017;D'Ercole et al. 2016) to explore the effect of different environments on the formation of SG stars.We found that the properties of the SG population depend significantly on the surrounding environment of the clusters.In the high-density simulations, massive clusters (with masses ≥ 10 6 M ⊙ ) could overcome the ram pressure, accrete pristine gas, and retain their own stellar winds, producing a massive SG.Positive correlations were also found for the SG mass fraction and maximum He enhancement in GCs versus the cluster mass.
In Yaghoobi et al. (2022b), hereafter PaperII, we included ionizing radiation from stars in our simulations and found that the gravitational potential of a very massive cluster (10 7 M ⊙ , with half-mass radius 30 pc) is strong enough to accumulate both accreted pristine gas and AGB ejecta at its center.Photoionization heating was found to be efficient in warming up and expanding the gas for only about the first 50 Myrs from the FG formation.After that, the gas cooling dominates the radiative heating and the gas accumulated in the innermost regions results in star formation.However, due to ionizing feedback effects, the total SG mass became a factor two lower than in the run without ionizing radiation at the end of simulations (100 Myr after the cluster formation).Nevertheless, the SG mass fraction within the cluster reached 40% in the high-density model, comparable with observed fractions for Galactic GCs (Milone et al. 2017).However, in the low-density case, the gas content and SG fraction were very low (∼ 4%).To further explore the viability of this scenario, our study including the photoionization feedback needs to be expanded to clusters with different structural parameters, since it is shown that the cooling and heating processes depend on the properties of the cluster (Wünsch et al. 2017;Yaghoobi et al. 2022a).Particularly, we are interested in studying the SF in the clusters expected to be equivalent to proto-GCs and YMCs to explore the role of stellar feedback in SG formation.Moreover, we investigate how results are sensitive to the different environments, which are expected to be different for GCs and YMCs.
This study is a follow-up to PaperII to investigate the SF and gas content in young clusters with different properties (mass and halfmass radius).We aim at checking whether these clusters can retain their stellar winds, accrete the pristine gas from the ambient medium, and cool their ICM in the presence of ionizing radiation.The paper is organized as follows.In Section 2, we describe the simulation set-up and main assumptions of our model.In Section 3, we present the results of our simulations, and in Section 4 discuss them.Finally, in Section 5, we list the main conclusions of our study.

SIMULATION SETUP
The simulation setup in this study is the same as PaperII for a cluster with the mass of 10 7 M ⊙ and half-mass radius of 23 pc, except that we study the SG formation within FG clusters with masses of 10 5 and 10 6 M ⊙ , and half-mass radius of 4 pc, moving through a homogeneous ISM with uniform density.These masses are comparable Table 1.Main parameters of our simulations for both cases of RT and NoRT.Column description: M FG is the mass of the cluster;  pg the gas density of the pristine gas;  I the time when the cluster reaches the ISM (Section 2.1) at the time reference of this paper (the FG formation).Note that the AGB ejecta in all simulations start at  AGB = 39 Myr.
M5Infall24 10 5 10 −24 33.9 M5Infall23 10 5 10 −23 30.0 M6Infall24 10 6 10 −24 42.5 M6Infall23 10 6 10 −23 33.9 with the initial masses derived for GCs by calculating the cluster orbits backward in time (Baumgardt et al. 2019).To study the role of environments in SF formation, we consider different values for ISM densities; 10 −24 g cm −3 for a typical dwarf galaxy (Marcolini et al. 2003) and 10 −23 g cm −3 as a representative value for star-forming regions in galaxies at high redshifts (Wardlow et al. 2017).As in PaperII, we consider the effects of the ionizing FG and SG radiation using radiation-transfer simulations (RT simulations).We also run their analogs without radiation (NoRT) to better understand the role of stellar radiative feedback in SG formation.The main simulations of this study and their relevant characteristics are listed in Table 1.
We use Ramses-rt (Rosdahl et al. 2013;Rosdahl & Teyssier 2015), the radiative hydrodynamics version of the Ramses (Teyssier 2002) code.The code uses a second-order Godunov scheme to solve the Euler equations and a particle-mesh solver to compute the dynamical evolution of particles.In PaperI, the appropriate simulation volume for the 10 5 and 10 6 M ⊙ clusters was found to be about 50 pc.However, we find that we need to consider a larger box to achieve convergence in results due to gas expansion resulting from photoionization heating.We find that a cube with a width of 128 pc and inflow boundaries can fulfill this goal.Moreover, we use the AMR strategy with a maximum size of Δ max = 1 pc ( min = 7 in the Ramses code) and a minimum size Δ min = 0.062 pc ( max = 11).Cells are refined to smaller sizes if their mass exceeds 10 M ⊙ .As in PaperI, we performed a series of tests assuming different resolutions, ranging from Δ min = 1 pc to Δ min = 0.062, indicating that the chosen setup is sufficient for our results to converge.
The simulation setup of our model has been discussed extensively in PaperII.Here, we briefly recap it and encourage the reader to consult PaperI, PaperII, and Calura et al. (2019) for more details.In our notation, time  = 0 corresponds to the birth time of the first generation of stars.

Initial conditions
We set the initial conditions of our simulations as proposed in D' Ercole et al. (2016).Type II SN explosions of FG stars have formed a bubble of hot and diffuse gas around the cluster at the end of their activity, assumed to be 30 Myr after the birth of the first generation.The bubble radius depends on the cluster mass, ISM density, and velocity with respect to the gas (see Calura et al. 2019).It is assumed that the bubble is filled with extremely diffuse gas in hydrostatic equilibrium with the cluster.Thus, FG stars are not initially in direct contact with the pristine ISM gas until they traverse this radius and reach the ISM.After that, the pristine gas encounters the cluster and starts to dilute the enriched AGB ejecta.We also assume that the injection of AGB ejecta starts at  AGB = 39 Myr.Following this model, we consider the velocity of clusters to be 23 km s −1 , of the order of the gas velocity dispersion in an ionized medium, and assume it to be constant during the simulations.Accordingly, the time at which the cluster reaches the ISM ( I ) can be estimated, as described in PaperI. I s for our simulations are computed by means of Eq. 11 of D' Ercole et al. (2016) and presented in the fourth column of Table 1.With the exception of the M6Infall24 model, the infall starts earlier than stellar winds in all our simulations.This is visible from the comparison of  I and  AGB in Table 1.All simulations finish at  = 100 Myr at the start of FG Type I SNe (D'Ercole et al. 2008).
The FG stars are modeled by a static Plummer (1911) density profile: where  is the distance from the center of the cluster,  p = 3 pc and  FG are the Plummer radius and the cluster mass, respectively.We neglect any changes in the FG stellar distributiofn due to cluster evolution during the simulation.We perform the simulations in the reference frame of the cluster.Therefore, we assume a static FG cluster at the center of the box and, after a time of  I , the ISM gas enters into the box from the left side with the velocity of the cluster (23 km s −1 ).Hence, the cluster is exposed to the ram pressure of the incoming gas and can accumulate it to form new stars.

Stellar winds of the FG stars
Stellar winds from the AGB stars are assumed to start at  AGB = 39 Myr after the formation of the FG stars.Following the models described in Calura et al. (2019), the rate of injected mass by AGB stars can be modeled as a function of time  (expressed in yr) as: where  = 0.065  −1.01  −1 is the specific injection rate.We add this rate as a source term into the continuity equation for gas density.We specify these ejecta with a different He abundance from the pristine gas.To do that, we define a passive scalar advected with the gas density and follow the evolution of helium (He) mass fraction for all the gas in the box.The He mass fraction of the ejecta is assumed to slightly change from  ( = 39 Myr) = 0.36 to  ( = 100 Myr) = 0.32 (Ventura & D'Antona 2011), whereas for the pristine gas we assume  = 0.25.

Star formation
We use the star formation model described in Rasera & Teyssier (2006) to turn gas mass into "star" particles in eligible cells for SF based on the standard Schmidt (1959) law.Thus a source term is added to the continuity equation as: where the  * is the SF timescale which is assumed to be 0.1 Gyr, as in Calura et al. (2019).In this paper, we adopt four physical criteria for SF: i) a gas temperature less than 2 × 10 4 K, ii) a converging gas velocity (∇ • v < 0), iii) a local Jeans' length smaller than 4 (finest) cell width, i.e. less than 0.25 pc, and iv) a density higher than 6 × 10 −23 g cm −3 .When these criteria are fulfilled, star particles are formed stochastically.The stellar particle mass is an integer multiple of  * = 0.4 M ⊙ , sampled from a Poisson probability distribution as described in Rasera & Teyssier (2006).The star particles are placed at the center of their parent cell, with a velocity, metallicity, and He abundance equal to their natal gas.

Radiative transfer
The Ramses-rt code is a momentum-based radiative transfer code that couples the hydrodynamics equations to the radiative transfer equations using the M1 closure for the Eddington tensor.It models the propagation of ionizing radiation and its interplay with gas via non-equilibrium thermochemistry for hydrogen and helium.The frequency range of photons is split into discrete photon groups, and then the radiative transfer equations can be solved separately for each group.In this study, we assume three photon groups (HI, HeI, and He II ionizing photons) with mean energies of 18.2, 33.0, and 61.3 eV, as described in PaperII.Thus in every cell, the evolution of ionization fractions for hydrogen and helium is followed (Rosdahl et al. 2013;Rosdahl & Teyssier 2015).Using this code, we study the effects of photoionization heating, cooling, and radiation pressure of ionizing radiation from the FG and SG stars as our luminous sources.Note though that additional simulations, not included in this paper, show that radiation pressure has no role in gas evolution and SF and that all effects of the ionizing radiation presented in the next sections are due to photoionization heating.The number of injected photons by the FG and SG is estimated by a spectral energy distribution (SED) model, depending on the mass, age, and metallicity of stars.
In our simulations, we use the binary population and spectral synthesis (BPASS) code (Eldridge et al. 2017) and assume a metallicity of  = 0.001 and a standard Kroupa  (2022b).Moreover, we assume a reduced speed of light 0.002 to reduce the computational cost of simulations.

Cooling and Heating
In Ramses-rt, radiative heating and cooling processes contribute with positive and negative rates in the energy equation, respectively.They are functions of the gas temperature, density, photon properties, and ionization fractions, as described in Rosdahl et al. (2013).The cooling processes considered for hydrogen and helium are collisional ionization, excitations, recombinations, dielectronic recombinations, bremsstrahlung, and Compton cooling, and metal cooling.Following Calura et al. (2019), we also include the heating effects of stellar winds from the AGB stars in the energy equation as: where  is the one-dimensional velocity dispersion of the cluster,  wind is the wind velocity of the AGB stars, and  is the local gas velocity (D'Ercole et al. 2008).We assume a wind velocity of  wind = 20 km s −1 and an adiabatic index of  = 5/3.The stellar winds from other sources, e. g. main-sequence stars, can be neglected due to their low mass-loss rates (PaperII).

RESULTS
Our recent studies (Calura et al. 2019;PaperI) showed that the gravitational potential of massive clusters (10 6 and 10 7 M ⊙ ) can overcome ram pressure and stellar wind heating.As a result, clusters can accumulate a significant amount of gas within their central regions, where the accreted pristine gas dilutes the ejecta.In PaperII, we showed that stellar radiative feedback can also not resist against the potential of the cluster.However, it delays the formation of SG stars in massive clusters of 10 7 M ⊙ and decreases the total SG mass by 50%.In this  section, we describe the results of our simulations listed in Table 1 with lower mass clusters and explore how the radiative feedback can affect the gas accumulation, of both retained AGB ejecta and accreted pristine gas.We set our simulations to start at  =  AGB for M6Infall24 and at  =  I for three other simulations.Note that the 64 pc distance between the left side and the center of the cluster causes a time delay of about 1.8 Myr for incoming gas to reach the cluster center.To take this into account, we allow the incoming gas to come into the simulation box at  =  I − 1.8 Myr so that it passes the center at  I .

Low-mass clusters
In PaperI, we found that without the effects of photoionization, the ram pressure exerted by the ambient medium can limit the ability of the gravitational potential of a 10 5 M ⊙ cluster to retain its stellar winds and accrete the pristine gas.However, it did not suppress the gas accumulation at the center entirely.As a result, SG stars with high-(≈ 0.06) and intermediate-He (≈ 0.12) enhancements were formed within the cluster center in low-and high-density simulations, respectively.These results were in contrast with the He enhancements observed (≤ 0.01) in low-mass clusters (Milone et al. 2020).Here we include the ionizing feedback in our simulations with 10 5 M ⊙ to explore how this process affects the formation of SG stars.

M5Infall24
According to the model proposed by D'Ercole et al. ( 2016), we assume that the cluster in this simulation has already traversed the bubble radius created by SN feedback and reached the ISM.Therefore, the incoming gas reaches the cluster's center at  I = 33.9Myr (fourth column of Table 1), while the injection of mass and energy from the AGB stars begins at  AGB = 39 Myr. Figure 1 shows the density (upper panels) and temperature (lower panels) maps in the x-y plane for our RT and NoRT simulations with 10 5 M ⊙ clusters at the final time (100 Myr).The arrows on the temperature maps indicate the velocity field of the gas.In the NoRT simulation (right column of Figure 1, also discussed in PaperI), the cluster could retain some of the ejecta in the central regions, accrete a marginal amount of pristine gas, and results in SG stars with a total mass of about 3 × 10 3 M ⊙ formed from almost-pure AGB ejecta.The left panels show that the photo-ionizing feedback of FG stars has increased the temperature and pressure of the gas within the cluster, leading to its expansion in the central regions.In the upper left panel of Figure, a shell is seen at a distance of about 60 pc from the center, due to the expanding bubble hitting the incoming pristine gas.The bottom-left panel shows that the gas inside the shell is warm, with  > 10 4 , and therefore ionized.Hence, this shell specifies the region affected by the FG radiation around the cluster.Moreover, the maps display a weak shock in the central regions due to the ICM hitting the ISM.Therefore, gas heating exceeds the gas cooling within the cluster, resulting in no SG star formation in this simulation.

M5Infall23
In the M5Infall23 simulation, the ambient gas density is ten times more than in the previous simulation.The model starts with the infall of pristine gas at  I = 30 Myr, and about 9 Myr later is followed by the injection of the AGB ejecta. I is shorter than in the previous model because the first-generation SN feedback is expected to be less effective in pushing the ICM out into the higher-density medium.
As can be seen in the right panels of Figure 2, a denser medium makes ram pressure stronger in the corresponding NoRT case and suppresses SF but does not completely stop the accumulation of the ejecta into the cluster.However, we reported in PaperI that a low-mass SG can be formed in the case of high-density simulation.This different result comes from the fact that in this study, we have assumed the Jeans' length threshold (0.25 pc) that prevents forming stars in cells in which the Jeans' length is larger than four cell width (see Section 2.3).The left panels of Figure 2 correspond to the gas density and temperature maps of the RT simulation of M5Infall23 at the final time.Again, two shocks are visible in the central regions but not close to the left boundary.The region affected by the ionizing heating is less extended than in the previous simulation due to a denser infall.Within this region, the gas density is much lower than in the other parts of the box due to the higher pressure and temperature of the gas inside the shock.Therefore, the gas conditions inside the cluster are again not appropriate for forming SG stars within the first 100 Myr from the formation of the FG stars.
Thus, in low-mass clusters, photo-ionization heating and ram pressure overcome the FG potential, prevent a significant accumulation of cold gas inside the cluster, and result in no SG star formation within 100 Myr of the FG formation.

Massive clusters
From theoretical consideration, a 10 6 M ⊙ cluster can overcome the ram pressure and accumulate gas in the NoRT case (Lin & Murray 2007).We numerically confirmed this conclusion in PaperI and showed that not only could the cluster retain its AGB ejecta and accrete the pristine gas, but also that efficient cooling occurred in the central regions, leading to the formation of a massive SG.The more massive the cluster, the more accreted pristine gas, and the more massive the SG cluster and with lower He abundances.We now study the effects of ionizing radiation on SG formation for this cluster mass.

M6Infall24
A massive cluster in a low-density medium is assumed to create the largest SN bubble among our models.Thus, it takes more time for the incoming gas to reach the cluster's center.Therefore, this simulation starts with the injection of the AGB ejecta at 39Myrs after the birth of the FG stars, and after about 3.5 Myr the incoming pristine gas passes through the cluster center.
Figure 3 shows the density and temperature maps at different times for our simulations with massive clusters.The white contours on the density maps display the SG stars formed in the simulation box.The leftmost panel in the top row shows that the AGB ejecta are already accumulating at the center of the cluster at  = 42 Myr, even before the infall reaches the center.All the gas in the simulation box is immediately exposed to the FG radiation and becomes ionized.As a result, at distances larger than ∼ 10 pc from the center of the cluster, the photoionization heating by FG stars pushes the ICM off, as can be seen from the arrows in the temperature map.After the cluster enters the dense ISM, all the gas within the box becomes ionized and warm.As the simulation proceeds, a slight gas accumulation is seen in the cluster center until the end, but it does not result in sufficient cooling for SF.This situation is more or less unchanged until the end of the simulation.The minimum temperature in this run is 3 × 10 4 K. Therefore, the suitable conditions for SF are not met in this case.The two upper right panels show the final results of the NoRT simulation in which a SG with the mass of ≈ 6 × 10 4 M ⊙ has been formed.Comparing to the final results of the RT with NoRT simulations, the ionizing radiation suppresses the SF at least for 100 Myr, as predicted by Conroy & Spergel (2011).

M6Infall23
In a denser medium, the infall reaches the center at  = 33.9, and the cluster accretes more pristine gas.Eventually, efficient cooling occurs only at the center of the box and stars start forming at about 40 Myr after the formation of the FG.The two bottom left panels of Figure 3 display that two shocks formed at  = 42 Myr, as seen in the previous simulations.The white contour on the density map shows the first SG stars formed at this time.Moreover, the dense shell due to the ionizing radiation is formed ahead of the cluster at a distance of about 40 pc from the center, showing that the radiation of FG stars is not sufficient to ionize all the gas in the simulation box, in contrast to M6Infall24.As the simulation proceeds, a cold gaseous tail is formed behind the cluster due to the higher gas accretion rate.However, this tail has a lower density than in the simulation without radiation, resulting in no star formation on the tail, unlike the NoRT case (see the last column).As a consequence, SG stars are more concentrated in the cluster center than in the NoRT case.
The top and bottom panels of Figure 4 show the cumulative SG mass and the star formation rate (SFR) versus time for the RT and NoRT simulations, in which the mass contributions of the pristine gas (dotted line) and AGB ejecta (dashed line) are shown.Moreover, the mass injection rate from the AGB stars is shown with dash-dotted lines.As seen in the top panel, the amount of recycled AGB ejecta is the same for both RT and NoRT simulations at the end of the simulations, whereas the contribution of the accreted pristine gas in SF has decreased by almost 50% in the case of RT.Therefore, the inclusion of ionizing radiation leads to a 30% drop in the final SG mass (10 5 M ⊙ ) due to the lower amount of accreted pristine gas.This result is in agreement with previous analytic studies, showing that the accreted mass decreases with higher temperature (Naiman et al. 2011).The bottom panel shows that the ionizing radiation produces a 2 Myr delay in star formation.In the NoRT simulation, the SFR fluctuates around an almost constant value.This rate is larger than the rate of mass injection from AGB stars and can be attributed to the accretion rate of the pristine gas.In the case of the RT run, the SFR experiences a visible drop at ≈ 50 Myr related to the ionizing feedback of the first SG stars and then follows approximately the NoRT rate until the end of the simulation.
Figure 5 shows the He distribution of SG stars formed in the simulations at different times.The SG stars with the highest He abundances are formed in the first Myrs of the simulation when the dilution degree of the AGB ejecta is still low.Later the cluster accretes further pristine gas and the distribution eventually tends towards lower helium abundances.Comparing the final NoRT (dashed line) and RT distributions (gray region), SG stars generally have a higher He mass fraction in the RT simulation because the ionizing radiation limits the pristine gas accretion.While no extremely He-rich (Y 0.36) stars are formed in this run, the maximum He abundance of SG stars is 0.34.

DISCUSSION
In a previous study (PaperII), we investigated the effects of ionizing feedback on the formation of SG stars in a very massive cluster (10 7 M ⊙ ) in the context of the AGB scenario of D' Ercole et al. (2016).To explore the role of different environments in SG star formation, we assumed that the cluster moves through a medium of different densities, i.e. 10 −24 and 10 −23 g cm −3 .In the low-and high-density simulations, we found that the total SG masses formed within 100 Myr after the FG formation were a fraction of 0.06 and 0.6 of the FG mass, respectively.In this work, we expand the study to FG clusters with the different masses of 10 5 and 10 6 M ⊙ and assume a half-mass radius of 4 pc, estimated to be typical for proto-GCs and YMCs (Baumgardt et al. 2019;Krumholz et al. 2019).In both our low-and high-density simulations with the cluster mass 10 5 M ⊙ , the radiative heating dominates the ram pressure and gravitational potential of the cluster.Hence, it does not allow the gas inside the cluster to accumulate at its center, and as a result, star formation is suppressed throughout the entire time of the simulation (100 Myr, Figure 1 and 2).For 10 6 M ⊙ clusters, our results are density-dependent.In the low-density simulation (M6Infall24), the FG ionizing radiation heats and expands the gas inside the cluster, resulting in no SG stars formed until the end of the simulation (the first two rows in Figure 3).On the other hand, in the high-density case (M6Infall23), a higher accretion rate on the cluster occurs, causing the ICM to cool efficiently at the cluster's center.Eventually, a more compact SG cluster than in the NoRT case is formed, with a mass of 0.1 of FG mass (Figure 3).
To explore the role of ionizing feedback in the SG formation, we assume the maximum possible luminosities for our stellar populations, including binary stars (BPASS model, Eldridge et al. 2017).As in PaperII, we assume a bottom-heavy IMF for the SG stars so that the mass of SG stars is truncated at 8 M ⊙ .Hence Type II SNe  simulation and corresponding NoRT run as a function of time, along with the contribution from processed AGB matter and pristine gas.Bottom: SFR of the SG versus time for these runs.The lines are color-coded as follows: the solid, dashed, and dotted lines show the final SG stellar mass, the mass formed from AGB ejecta, and the mass formed from the pristine gas, respectively.The dash-dotted lines display the rate of stellar mass return injected into the simulation box.for SG stars are not included in our simulations, and SG luminosities are not as high as the FG ones.
In Table 2, we report the final properties of the SG population obtained at the end of our RT simulations with cluster masses 10 6 (this work) and 10 7 M ⊙ (PaperII).The SG masses in our high-density simulations exhibit an increasing trend with FG cluster mass.The reason is that more massive clusters can accrete more pristine gas, leading to the formation of more massive SG clusters.Assuming that the FG and SG stars have the same initial mass function at 100 Myr, the SG mass fraction and SG number ratio are equivalent.Therefore, the AGB model can qualitatively explain the observed positive correlation between the SG fraction and cluster mass for the GCs hosting MSPs (see PaperI).However, the observed SG fractions (0.1−0.9) are higher than the ratios computed in our simulations.This difference might come from the fact that our simulations can account only for the first 100 Myr of the evolution, whereas the observed systems have undergone several Gyrs of dynamical evolution.The SG-to-FG ratio is expected to increase during the dynamical evolution (D'Ercole et al. 2008;Vesperini et al. 2021) due to the depletion of FG stars.It is found that most SG stars are retained within clusters because they are located in the central regions.In PaperI, we showed that assuming factors between 5 and 201 for the ratio between the initial mass of the cluster and the present-day mass, allows us to account for the observed correlation between SG fraction and cluster mass.A similar conclusion can be obtained for our RT simulations of different masses.The dilution of the AGB ejecta in the RT-M6Infall23 simulation results in the formation of SG stars with He mass fractions of 0.26 <  < 0.34.The contribution of pristine gas in forming the second generation is about 10 percent of the FG mass, which is consistent with the value proposed by D' Ercole et al. (2011).In fact, based on the observed Na-O anticorrelation, they show that the amount of pristine gas cannot be larger than ∼ 0.1 FG .On the other hand, the 10 7 M ⊙ clusters can form SG stars with extreme-He mass fractions (≈ 0.36, see last two columns of Table 2), showing that some of the SG stars originate out of pure AGB ejecta.It is worth noting that the dilution process of the enriched ejecta has a longer delay in massive clusters, due to the formation of a larger hot bubble by FG type II SNe around the cluster.This causes some SG stars to form from enriched materials only before the dilution of stellar winds.This result is consistent with what was proposed by D'Ercole field stars of the Fornax dwarf galaxy can at most be 4-5 times larger than that of his globular clusters.In case the field stars have all been lost from the GCs, this result imposes an upper limit on their initial mass.However, an important quantity currently unknown is the mass of Fornax, which in the past could have been greater than today.The factor 20 comes from the argument that it is possible to show that approximately 5% (i.e.1/20) of the first-generation mass comes out with the right composition, in terms of He abundance and p-process elements, to produce second-generation stars (Renzini 2013), assuming a 100% star formation efficiency.2016) to explain the existence of extreme-He fraction in SG stars in massive GCs.From our high-density simulations with cluster masses of 10 6 and 10 7 M ⊙ , the maximum He enhancement shows an increasing trend with cluster mass.In principle, this increasing trend can explain the observed positive correlation between maximum He enhancement and cluster mass (Milone et al. 2020).The capability of reproducing this trend is a promising result for the AGB scenario.Moreover, we found in PaperI that in NoRT simulations corresponding to M5Infall24, M5Infall23, and M6Infall24, SG stars with extreme-He fractions could be formed, which is not in agreement with observations.This study shows that the radiative feedback suppresses the SF in these simulations and prevents the formation of these extreme-He stars.Moreover, it suppresses SF in low-mass clusters, regardless of the density of the external gas.Therefore, our results indicate that the ionizing stellar feedback is not a severe problem for SG formation.Rather, it can help the AGB scenario to account for some observables, such as the lack of extreme He-rich stars in lowest mass GCs.However, other issues, such as the mass budget problem and the assumption of a bottom-heavy IMF for SG stars, still need further investigation.
Our study confirms that only massive GCs can form a new generation from their AGB ejecta and accreted pristine gas, as already proposed for this model (D'Ercole et al. 2008(D'Ercole et al. , 2016)).Moreover, we introduce another requirement for this scenario; these massive clusters should be located in dense environments to accrete sufficient pristine gas, in order to fulfill two requirements.First, to provide a significant gas accumulation within clusters, for the efficient cooling required for star formation.Second, to supply the pristine gas required for appropriate dilution of the AGB ejecta, so that the chemical compositions of SG stars can be comparable to observations.Therefore, our simulations with photoionization heating confirm the key role of pristine gas accretion in SG formation in diluting the AGB ejecta and can solve the abundance problem.In addition, we confirm its undeniable role in efficient cooling within young clusters.
The density of 10 −23 g cm −3 , used in our high-density simulations, is found in star-forming disk galaxies observed at redshift  > 2, in agreement with the D'Ercole et al. ( 2016) assumption that the formation of SG stars is limited to these redshifts.On the other hand, this point can explain why no strong evidence has been found so far for the presence of MSPs in YMCs (Mucciarelli et al. 2008(Mucciarelli et al. , 2014;;Martocchia et al. 2018).Probably they could not be able to accumulate a considerable amount of pristine gas at their center, because they are located in lower-density environments than the ones assumed here for the formation of MPs, and their ionizing feedback becomes effective in heating the ICM.As a result, the necessary conditions for SG star formation may not be satisfied in these clusters.This can also explain why YMCs do not show evidence of ongoing star formation and why they are gas free (Bastian et al. 2013b).We can check the gas content within young clusters in our simulations with the caveat that the assumed metallicity in our model is lower than in local galaxies, with possible effects on radiative cooling.
Figure 6 shows the evolution of the ICM mass in the radii of 1 (dash-dotted line), 2 (thin solid line), and 5 pc (thick solid line) from the cluster's center for the simulations of this study.To better follow how gas mass inside the cluster depends on the radius, the colored shaded regions indicate the areas covered by lines corresponding to each simulation.The gas mass quickly increases after the infall passes through the cluster center and then settles on to an approximately constant value.This translates into an equilibrium state between the FG gravity, ram pressure, and FG ionizing feedback.Bastian et al. (2013b) estimate the mass of ionized gas within a sphere of radius 1 pc in YMCs according to their   flux.They find that the gas mass within YMCs should be lower than 100 M ⊙ .As can be seen in Figure 6, the gas mass within 1 pc for those simulations in which no SG stars form (M5Infall24,M5Infall23, and M6Infall24), including both low-density simulations, is much lower than this value (grey dashed line), while it is larger in the M6Infall23 simulation.Therefore, our study suggests that radiative feedback can prevent the accumulation of gas and star formation inside clusters of masses ≤ 10 6 M ⊙ in local galaxies.However, further simulations specific to YMCs should be performed to confirm this result.This topic represents an interesting subject for future work.

CONCLUSIONS
Using hydrodynamical simulations, we have investigated the effects of photoionization feedback on star formation and gas content in young clusters with masses of 10 5 and 10 6 M ⊙ within 30 − 100 Myr from the birth of clusters.We assume that the clusters move in a uniform interstellar medium with gas densities of 10 −24 and 10 −23 g cm −3 to explore the effect of different environments on the amount of gas accretion onto clusters and SG formation.These simulations are designed to check the predictions of the AGB scenario in the formation of a new generation from the stellar winds of AGB stars and accreted pristine gas in the presence of photoionization heating.Our main results can be summarized as follows.
• In the simulations with a 10 5 M ⊙ cluster, the radiative heating dominates the ram pressure and gravitational potential of the cluster.Then, it does not allow the gas inside the cluster to accumulate at its center and create any low-mass stellar aggregate.As a result, star formation is suppressed until the end of simulations.
• For 10 6 M ⊙ clusters, we find that our results are densitydependent.In the low-density simulation (M6Infall24), the FG ionizing radiation heats and expands the gas inside the cluster, resulting in no SG stars formed until  = 100 Myr.On the other hand, in the high-density case (M6Infall23), a higher accretion rate on the cluster occurs, causing the ICM to cool efficiently at the cluster's center.Eventually, a more compact SG cluster than in the NoRT case is formed, with a mass of 0.1 of FG mass.Due to ionizing effects, the cluster accretes less pristine gas, and therefore the new generation has a lower mass (30%) and higher He abundances in comparison to the simulation without radiation.
• We confirm the key role of pristine gas accretion in SG formation and introduce another requirement for the AGB scenario: massive clusters should be located in dense environments to accrete sufficient pristine gas to fulfill two goals.First, to provide a significant gas accumulation within clusters for the efficient cooling required for star formation.Second, to supply the pristine gas required to dilute the AGB ejecta and produce an increasing trend between maximum Y variation and mass.
• From the results of our study, it is apparent that not only the ionizing stellar feedback is not a severe problem for SG formation, but it can help the AGB scenario to account for some observables, such as the lack of extreme He-rich stars in lowest mass GCs.Moreover, the SG masses and maximum He enhancement in high-density simulations exhibit increasing trends with FG cluster mass.
• In our low-density simulations, the gas content is too low so that it can be compared with estimated values for YMCs.In addition, these simulations do not show star formation, as seen in YMCs.Hence, our high-density simulations can better be matched to observations corresponding to GCs hosting MSPs, while our low-density ones can quantitatively explain the properties of young clusters in the local Universe.Therefore, the AGB model can provide a reason why YMCs do not show evidence of SG formation and any significant ICM.
(2001) IMF for the FG stars.The same metallicity is considered for the SG stars but assuming a truncated IMF with maximum mass of  = 8 M ⊙ to neglect the SN feedback effects, as assumed in Calura et al. (2019); Yaghoobi et al.

Figure 1 .
Figure 1.Gas density (top panels) and temperature (bottom panels) maps for the M5Infall24 model in the cases with (RT, left column) and without (NoRT, right column) photoionization feedback at the end of the simulation, i. e. at  = 100 Myr (after the FG formation).The black arrows represent the gas velocity field.Photoionization heating has caused the gas inside the cluster to expand.In contrast, radiative cooling is insufficient to cool the gas at the center of the cluster.As a result, no stars can form within ∼ 100 Myr in these low-mass clusters.

Figure 2 .
Figure 2. The same as Figure 1 but for the M5Infall23 simulation.

Figure 3 .
Figure 3. Gas density and temperature maps for the M6Infall24 (first and second rows from top) and M6Infall23 (third and fourth rows) simulations at different times for RT runs.The right column shows the results of the corresponding NoRT runs at the final time.The white and orange contours show regions in which the SG stellar densities are 10 −6 (i.e. the extent of all SG stars) and 10 −3 times the maximum central density, respectively.

Figure 4 .
Figure 4. Top: cumulative stellar mass of SG stars formed in the M6Infall23simulation and corresponding NoRT run as a function of time, along with the contribution from processed AGB matter and pristine gas.Bottom: SFR of the SG versus time for these runs.The lines are color-coded as follows: the solid, dashed, and dotted lines show the final SG stellar mass, the mass formed from AGB ejecta, and the mass formed from the pristine gas, respectively.The dash-dotted lines display the rate of stellar mass return injected into the simulation box.

Figure 5 .
Figure 5. Mass distribution of SG stars versus He abundance Y for the M6Infall23 simulation at different times.The He mass fraction of the SG stars varies between Y = 0.26, which is a little higher than the helium mass fraction of the pristine ISM gas (and FG stars, Y = 0.245) at the end of the simulation, and Y = 0.34, corresponding to the SG stars formed from less-diluted ejecta at the beginning of the simulations.

Figure 6 .
Figure 6.Gas mass within different radii from 1 pc to 5 pc in the clusters studied in this paper as a function of time.

Table 2 .
Main results obtained at the end of M6Infall23 simulation in this study and in PaperII with a 10 7 M ⊙ cluster.From left to right, the columns show the name of the model, the mass of the FG cluster, the final SG mass, the final SG mass fraction, the fraction of AGB ejecta, pristine gas incorporated in SG stars, and the minimum and maximum He abundance of SG stars.