# A Comprehensive Study on the Relation between the Metal Enrichment of Ionized and Atomic Gas in Star-forming Galaxies

M. Arabsalmani, L. Garratt-Smithson, N. Wijers, J. Schaye, A. Burkert, C. D. P. Lagos, E. Le Floc'H, D. Obreschkow, C. Peroux, B. Schneider

► To cite this version:

M. Arabsalmani, L. Garratt-Smithson, N. Wijers, J. Schaye, A. Burkert, et al., A Comprehensive Study on the Relation between the Metal Enrichment of Ionized and Atomic Gas in Star-forming Galaxies. The Astrophysical Journal, 2023, 952, 10.3847/1538-4357/acd4b7. insu-04479073

HAL Id: insu-04479073

https://insu.hal.science/insu-04479073

Submitted on 5 Mar 2024

**HAL** is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire **HAL**, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
OPEN ACCESS

<figure><img src="image_2.png" /></figure>

CrossMark

# A Comprehensive Study on the Relation between the Metal Enrichment of Ionized and Atomic Gas in Star-forming Galaxies

M. Arabsalmani¹,²,*, L. Garratt-Smithson³,⁴, N. Wijers⁵,⁶,†, J. Schaye⁵,†, A. Burkert⁷,⁸,†, C. D. P. Lagos³,⁴,⁹, E. Le Floc'h¹⁰, D. Obreschkow³, C. Peroux¹¹,¹², and B. Schneider¹⁰,†

¹ Excellence Cluster, ORIGINS, Boltzmannstraße 2, D-85748 Garching, Germany; maryam.arabsalmani@origins-cluster.de

² Ludwig-Maximilians-Universität, Schellingstraße 4, D-80799 München, Germany

³ International Centre for Radio Astronomy Research (ICRAR), University of Western Australia, 35 Stirling Hwy., Crawley, WA 6009, Australia

⁴ ARC Centre of Excellence for All Sky Astrophysics in 3 Dimensions (ASTRO 3D), Australia

⁵ Leiden Observatory, Leiden University, Niels Bohrweg 2, NL-2333 CA Leiden, The Netherlands

⁶ CIERA and Department of Physics and Astronomy, Northwestern University, 1800 Sherman Ave., Evanston, IL 60201, USA

⁷ University Observatory Munich (USM), Scheinerstraße 1, D-81679 München, Germany

⁸ Max-Planck-Institut für extraterrestrische Physik (MPE), Giessenbachstr. 1, D-85748 Garching, Germany

⁹ Cosmic Dawn Center (DAWN), Denmark

¹⁰ CEA, IRFU, DAP, AIM, Université Paris-Saclay, Université Paris Cité, Sorbonne Paris Cité, CNRS, F-91191 Gif-sur-Yvette, France

¹¹ European Southern Observatory, Karl-Schwarzschildstrasse 2, D-85748 Garching bei München, Germany

¹² Aix Marseille Université, CNRS, LAM (Laboratoire d'Astrophysique de Marseille) UMR 7326, F-13388, Marseille, France

Received 2022 June 10; revised 2023 May 8; accepted 2023 May 9; published 2023 July 18

## Abstract

We study the relation between the metallicities of ionized and atomic gas in star-forming galaxies at $z=0-3$ using the Evolution and Assembly of GaLaxies and their Environments (EAGLE) cosmological, hydrodynamical simulations. This is done by constructing a dense grid of sight lines through the simulated galaxies and obtaining the star formation rate- and H I column density-weighted metallicities, $Z_{SFR}$ and $Z_{H I}$, for each sightline as proxies for the metallicities of ionized and atomic gas, respectively. We find $Z_{SFR} \gtrsim Z_{H I}$ for almost all sight lines, with their difference generally increasing with decreasing metallicity. The stellar masses of galaxies do not have a significant effect on this trend, but the positions of the sight lines with respect to the galaxy centers play an important role: the difference between the two metallicities decreases when moving toward the galaxy centers, and saturates to a minimum value in the central regions of galaxies, irrespective of redshift and stellar mass. This implies that the mixing of the two gas phases is most efficient in the central regions of galaxies where sight lines generally have high column densities of H I. However, a high H I column density alone does not guarantee a small difference between the two metallicities. In galaxy outskirts, the inefficiency of the mixing of star-forming gas with H I seems to dominate over the dilution of heavy elements in H I through mixing with the pristine gas. We find good agreement between the available observational data and the $Z_{SFR}-Z_{H I}$ relation predicted by the EAGLE simulations. Though, observed regions with a nuclear starburst mode of star formation appear not to follow the same relation.

*Unified Astronomy Thesaurus concepts: Galaxy chemical evolution (580); Metallicity (1031); Hydrodynamical simulations (767); Interstellar medium (847)*

## 1. Introduction

The content of heavy elements in galaxies over cosmic time provides essential information on how galaxies form and evolve. The metal enrichment of galaxies is not only linked to their star formation history but is also related to outflowing and infalling gas in galaxies, through which metals are lost or diluted with pristine gas (e.g., Silk & Mamon 2012; Naab & Ostriker 2017; Dayal & Ferrara 2018). Metallicity is therefore one of the key properties of galaxies, and its relation with other galaxy properties provides crucial information on the mechanisms involved in galaxy formation and evolution (e.g., Tremonti et al. 2004; Mannucci et al. 2009, 2010; Bothwell et al. 2013; Møller et al. 2013; Zahid et al. 2014; Arabsalmani et al. 2015, 2018; Yabe et al. 2015).

The metallicity of a galaxy is defined as the ratio between the abundance of the elements heavier than helium (metals) and

that of hydrogen+helium in the galaxy. This is observationally obtained from the abundance of elements in stellar populations or in the interstellar medium (ISM) of a galaxy. The latter measurements are derived separately for the ionized and the atomic gas phases. The ionized gas metallicities are generally measured from the ratios of strong emission lines in the spectra of galaxies. Such measurements are based on calibrations that are only well constrained at low redshifts (and only within a metallicity range) and may not hold at higher redshifts (e.g., see Maiolino et al. 2008; Steidel et al. 2014). Moreover, it is shown that different calibrations give rise to metallicities that differ significantly for a given galaxy, even at low redshifts (Kewley & Ellison 2008). The atomic gas metallicity measurements are instead based on the ratio between the column densities of heavy elements and atomic hydrogen derived from ISM absorption lines against background continuum sources. These measurements provide more reliable estimates of metal enrichment up to very high redshifts ($z > 5$; Sparre et al. 2014; Hartoog et al. 2015) and do not rely on any calibration (negligible ionization corrections and also dust corrections are assumed for these measurements). However, they provide the

<figure><img src="image_3.png" /></figure>

Original content from this work may be used under the terms
of the Creative Commons Attribution 4.0 licence. Any further
distribution of this work must maintain attribution to the author(s) and the title
of the work, journal citation and DOI.
metallicity measurement only in a narrow beam along the bright background source—typically the quasars (QSOs) or the afterglows of gamma-ray bursts (GRBs)—unlike the case of ionized gas metallicities measured from emission lines where the metallicity measured is representative of an entire galactic region. Note that these ratios measure the metal enrichment of the atomic gas, and not that of the combined neutral molecular and atomic gas.

Despite the crucial role of the metal enrichment of galaxies in our understanding of galaxy formation and evolution, measurements of the true metallicities of galaxies remain uncertain. It is not clear whether the metallicities derived from the stellar populations are/should be the same as those obtained for the gas. Even the metallicities derived for different gas phases (ionized and atomic) in a galaxy might yield different values. Understanding how these measurements relate to each other will not only provide essential information on the mixing of metals in different gas phases but is also required for interpreting the measurements derived with different methods.

To date, there are only a handful of measurements for the metallicities of both ionized and atomic phases of gas in the same galaxies. These are mainly obtained for intervening galaxies along quasar sight lines, showing deviations between the two measurements (see e.g., Christensen et al. 2014; Friis et al. 2015; Péroux et al. 2016; Rahmani et al. 2016; Hamanowicz et al. 2020). In several cases, the measurements are obtained for nearby galaxies (e.g., Heckman et al. 2001; Thuan 2002, 2005; Cannon et al. 2005; Lebouteiller et al. 2009, 2013; Hernandez et al. 2021). Given the rarity of these measurements, cosmological hydrodynamical simulations (e.g., Schaye et al. 2015; Pillepich et al. 2018; Maio et al. 2022) offer a natural test bed to explore the relationship between the metallicities of ionized and atomic gas, which can also be confronted to the few observational constraints.

In this paper, we present a detailed and comprehensive analysis of the relation between the atomic and ionized gas metallicities in star-forming galaxies in the redshift range 0 $\le z \le 3$ and investigate the dependence of this relation on various parameters, such as the global properties of galaxies as well as the local properties of regions of interest. For this study, we use the Evolution and Assembly of GaLaxies and their Environments (EAGLE) set of cosmological hydrodynamical simulations (Schaye et al. 2015). We describe the numerical methods in Section 2. The results and discussion are presented in Section 3. We summarize our findings in Section 4. We use a solar metallicity value of 0.0127 throughout this work. This is the default value used in CLOUDY v7.02 (last documented in Ferland et al. 1998), with element abundances from Grevesse & Sauval (1998), Allende Prieto et al. (2001), Holweger (2001), and Allende Prieto et al. (2002).

## 2. Numerical Methods

### 2.1. Simulations

This paper uses the publicly available cosmological hydrodynamical simulation EAGLE RecallL025N0752 (Crain et al. 2015; Schaye et al. 2015; McAlpine et al. 2016; The EAGLE team 2017). The correlations between metallicity and other galaxy properties, such as stellar mass, star formation rate (SFR), specific star formation rate, and gas fraction, have been extensively studied using EAGLE (e.g., Lagos et al. 2016; De Rossi et al. 2017; Trayford & Schaye 2019; van Loon et al. 2021), with

authors finding a good agreement with observed trends down to stellar masses of $10^9 M_\odot$ using the EAGLE run Recall L0025N0752. This is the highest-resolution EAGLE simulation and is consequently the simulation we use for this analysis. Particularly relevant to this work, EAGLE has been shown to reproduce both the observed radial metallicity gradients within the central part of galaxies ($<0.5$ times the half-mass radius; Collacchioni et al. 2020), along with $z \sim 0$ metallicity gradients within star-forming regions of disk galaxies (within observed scatter; Tissera et al. 2019), and the redshift evolution of the metallicity gradient within star-forming regions (although deviations in scatter were seen between the simulations and observations; Tissera et al. 2022). However, it is worth noting the recent paper by Yates et al. (2021), where it was highlighted that the cosmic metal density of the neutral gas phase at high redshift ($3 \le z \le 5$) is significantly lower in existing cosmological simulations (including EAGLE) than observations of damped Ly$\alpha$ systems (systems with $N(H\ I) \ge 2 \times 10^{20} \text{ cm}^{-2}$) imply. This tension was seen across different cosmological simulations; hence, it is not clear whether one simulation is favored over another for this type of metallicity study (note that the study presented in this paper is focused on $z \le 3$). Our choice to use EAGLE for this analysis was further motivated by the fact the RecallL025N0752 run has been shown to reproduce the $z=0$ global H$_2$ scaling relations (e.g., Lagos et al. 2015), alongside the H I scaling relations (e.g., Crain & Bahé 2017) and the H I column density distribution function (e.g., Rahmati et al. 2015).

The simulations follow the evolution of a cubic volume of side length 25 cMpc of the universe to $z=0$, where "c" denotes "comoving." They use a dark matter particle mass of $1.21 \times 10^6 M_\odot$ and an (initial) gas particle mass of $2.26 \times 10^5 M_\odot$. These simulations use an updated version of the hybrid N-body Tree-PM/smooth particle hydrodynamics (SPH) code GADGET 3, presented in Springel (2005). The modifications to the numerical methods in GADGET, i.e., the inclusion of an artificial thermal conduction switch (Price 2008), a viscosity switch (Cullen & Dehnen 2010), a time-step limiter (Durier & Dalla Vecchia 2012), and the pressure-entropy formalism described in Hopkins (2013), are collectively known as "Anarchy" and are described in the Appendix of Schaye et al. (2015) and in Schaller et al. (2015). The EAGLE simulations also model processes such as star formation and stellar/active galactic nucleus (AGN) feedback using subgrid prescriptions, where the feedback efficiencies are calibrated (Crain et al. 2015) to match the $z=0$ galaxy stellar mass function, the sizes of disk galaxies, and the observed black hole mass-stellar mass relation.

The star formation and metal enrichment/stellar-mass-loss subgrid prescriptions are of particular importance to this work. Within the simulation, stellar populations are represented by star particles. These are formed using a metallicity-dependent density threshold designed to track the transition from the warm, atomic to the cold, molecular interstellar gas-phase (first described in Schaye 2004), alongside a pressure-dependent SFR that reproduces the observed Kennicutt-Schmidt star formation law (as described in Schaye & Dalla Vecchia 2008). Star particle formation is stochastic, with a probability linked to the SFR of a gas particle. Further, as described in Wiersma et al. (2009), the stellar mass loss for each star particle is approximated using the metallicity-dependent lifetimes presented in Portinari et al. (1998) and the AGN/stellar wind/core-collapse supernovae yields given in Marigo (2001) and
Portinari et al. (1998), on top of the mass loss associated with Type 1a supernovae. EAGLE tracks nine elements individually; H, He, C, N, O, Ne, Mg, Si, and Fe (Wiersma et al. 2009). These elements are distributed across the neighbors of each star particle using the SPH kernel weighting. For this paper, we use the metallicities associated with each particle, as opposed to the SPH-smoothed version of the metallicities (those used in the cooling calculations of the simulation, though not when calculating the SFR of each particle; see The EAGLE team 2017). This is because in Equation (2) we are interpolating to a grid, and hence by smoothing the metallicities we would smooth twice, which in return would artificially decrease the resolution. Further, when we do use the SPH-smoothed version of the particle metallicities we see an artificial reduction in scatter at high impact parameters/low densities, driven by the fact the metallicity is smoothed over larger distances in the outskirts of the galaxy/circumgalactic medium (CGM). These differences highlight the constraints of the simulation; since the resolution of SPH simulations naturally follows mass, the CGM/intergalactic medium (IGM) remain poorly resolved, and hence the metallicity values of any H I in these regions should be interpreted with caution. For completeness, we reproduce all the plots presented in Section 3 using the SPH-smoothed version of the particle metallicities and present them in the Appendix.

## 2.2. The Atomic Gas Phase

Similar to other cosmological-scale simulations (e.g., Dubois et al. 2014; Pillepich et al. 2018), EAGLE does not have the resolution to follow the cold gas phase of the galaxy; instead, it imposes a density-dependent pressure floor, normalized to $8000$ K at $n_H = 10^{-1}$ cm$^{-3}$. Therefore, the simulation needs to be postprocessed in order to estimate the neutral (atomic and molecular) gas fraction of each gas particle. We do this using the method described in Figure 1 of Garratt-Smithson & Power (2021), based on previous works (e.g., Lagos et al. 2015; Bahé et al. 2016; Crain & Bahé 2017; Diemer et al. 2018). Note that we obtain both the atomic gas fraction and molecular gas fraction separately and use the former in order to estimate the metallicity of the atomic gas. We summarize the method in the following five steps.

(i) First, we calculate the total nonionized hydrogen fraction, which combines molecular hydrogen and H I. We do this according to the prescription of Rahmati et al. (2013), assuming a Haardt & Madau (2012) photoionizing background. In this prescription, the photoionization rate is estimated using a density-dependent fitting function. The fitting function was calibrated using cosmological simulations that included radiative transfer calculations. This photoionization rate is then used to estimate the fraction of nonionized hydrogen in each gas particle. In the next steps, we calculate the molecular hydrogen fraction in the nonionized gas, which allows us to calculate the H I fraction.

(ii) From here, the molecular-dissociating UV flux is estimated for each gas particle. The method we utilize here depends on whether the gas particle is star-forming or not. If it is, the flux is estimated using the ratio between the SFR density of the particle and that of the solar neighborhood (as in Lagos et al. 2015). If it is non-star-forming, the particle uses a minimum value set by the

Haardt & Madau (2012) UV background. Additionally, following the work by Diemer et al. (2018), later adapted for EAGLE in Garratt-Smithson & Power (2021), we assume 10% of the UV photons emitted by star-forming particles escape and propagate through the surrounding medium (assumed to be optically thin). This provides an additional source of UV for non-star-forming particles.

(iii) We then calculate two theoretically motivated density floors for the cold neutral medium; the first assumes a two-phase ISM model (following Wolfire et al. 2003). The second is the minimum density of the cold neutral medium required to maintain pressure equilibrium (as described in Krumholz 2013).

(iv) Next, we take the maximum of these density floors and use this value, alongside the molecular-dissociating radiation field, to estimate the optical depth of dust grains (following Krumholz et al. 2009; Krumholz 2013) —fundamental to the formation of molecular hydrogen.

(v) Lastly, we calculate the fraction of molecular hydrogen using both the UV flux and the optical depth of dust, utilizing the method described in McKee & Krumholz (2010). The atomic gas, H I, defined in this study excludes the molecular hydrogen as well as helium.

To illustrate our postprocessing method, Figure 1 plots the gas phase diagram for all gas particles associated with $10 z = 0$ systems taken from our sample. Here we use all gas particles found within the virial radius of each system. This will therefore include the CGM alongside the ISM. The top plot is colored by the H I mass fraction ($f_{H I}$), the middle plot shows the molecular hydrogen mass fraction ($f_{H2}$), and the lower plot uses the ionized gas fraction ($f_{ion}$). Here we can see high $f_{H I}$ and $f_{H2}$ values are associated with the low-temperature (in particular, note the large values of $f_{H I}$ and $f_{H2}$ at $T \sim 10^4$ K), high-density regime, while the opposite is true for gas particles with high $f_{ion}$. In particular, galaxies sitting on the artificial pressure floor (seen in the bottom right of the phase diagram) are typically $H_2$ dominated.

## 2.3. Constructing Artificial Sight Lines

We constructed artificial sight lines for the simulation box using an $N = 8000^2$ grid, with each grid cell representing a single sightline (each cell has a side length 3.125 ckpc). The box was then sliced into five in order to approximate typical velocity cuts used in observations (as in Rahmati et al. 2015). The metallicity of each pixel in our grid was calculated using a cloud-in-cell (CIC) algorithm. The CIC algorithm is a multi-linear interpolation scheme to evaluate fields on a regular grid based on irregularly placed particles. Here each particle contributes a metallicity weighted by the H I mass or SFR that the gas particle contributed to the cell, i.e.,

$$Z_{SFR} = \frac{\sum_{i=1}^{N} \text{SFR}_{\text{cic},i} \times Z_i}{\sum_{i=1}^{N} \text{SFR}_{\text{cic},i}}, \quad (1)$$

where $SFR_{cic,i}$ is the CIC contribution of the $i$th particle to the SFR of the cell and $Z_i$ is the metallicity of the $i$th particle. Similarly,

$$Z_{H I} = \frac{\sum_{i=1}^{N} \text{MHI}_{\text{cic},i} \times Z_i}{\sum_{i=1}^{N} \text{MHI}_{\text{cic},i}}, \quad (2)$$
<figure><img src="image_4.png" /><figcaption>**Figure 1.** Gas phase diagram for the gas particles associated with $z=0$ systems in our sample, with points colored by the H I mass fraction ($f_{H I}$; upper plot), the molecular hydrogen mass fraction ($f_{H2}$; middle plot), and the ionized gas mass fraction ($f_{ion}$; lower plot), respectively. Only gas particles at radii below the virial radius of each system were included. Note the large molecular hydrogen mass fractions as well as the large H I mass fractions at $T \sim 10^4$ K.</figcaption></figure>

where $\text{MH}_{\text{cic},i}$ is the CIC contribution of the $i$th particle to the total H I mass of the cell. The metallicities weighted by H I mass and SFR provide proxies for the metallicities of atomic gas and ionized gas, respectively; thus, we can compare the typical metallicity as measured using global cold gas in galaxies, with the metallicity of the star-forming regions. We mention again that throughout this paper, we use the metallicity of atomic gas, as the neutral gas metallicities obtained from observations in the literature refer to the metal enrichment of only atomic gas. Given that the EAGLE simulations reproduce the Kennicutt–Schmidt star formation law (as described in Schaye & Dalla Vecchia 2008), we expect the H$_2$-weighted metallicities to be very similar to SFR-weighted metallicities. We investigate this and we indeed find this to be the case.

In order to investigate the relation between the H I-weighted metallicity and the SFR-weighted metallicity on a galaxy-by-galaxy level, we also took all central galaxies with a stellar mass of $>10^8 M_{\odot}$ out of Recall025N0752 and created a grid centered on each individual galaxy, using a side length of $2R_{200}$—the physical radius within which density is 200 times the critical density of the universe, calculated for each halo

identified via the friends-of-friends algorithm. Here we negate any projection effects by explicitly rotating each system so that we are observing it perpendicularly to the angular momentum axis of the star particles. Further, the size of each pixel is set to 2 pkpc, independent of the value of $R_{200}$. This means there will be a smaller number of pixels for lower-mass galaxies. As above, we then use this grid to interpolate $Z_{H I}$ and $Z_{SFR}$, along with the H I column density $N(H I)$ for each pixel. In observations, the impact parameter of a sightline, $b$, is defined as the projected distance between the sightline and the center of its corresponding galaxy. We also calculate the impact parameter, $b$, using the center of each pixel in the 2D $x-y$ plane (where the $z$ direction is the rotation axis). Figure 2 shows an example of this process for two galaxies of stellar mass $2 \times 10^9 M_{\odot}$ (top row) and $9 \times 10^9 M_{\odot}$ (bottom row).

In the following section, we present and discuss our findings using the sight lines constructed for individual galaxies. This is to ensure that there is no more than one galaxy per sightline, which is likely not the case for sight lines in the entire box (the sight lines constructed in the full box might correspond to more than one galaxy). We note that the results show the same trends no matter if we use all sight lines in the simulation box, or the sight lines produced using galaxies cut out from the simulation.

## 3. Results

### 3.1. $Z_{H I} - Z_{SFR}$ Plane of EAGLE Galaxies

The SFR- and H I-weighted metallicities ($Z_{SFR}$ and $Z_{H I}$, respectively) of all the sight lines, excluding those with zero SFR or zero H I, in EAGLE galaxies at $z=2$ are presented in Figure 3. The first notable finding is that for almost all the sight lines, the $Z_{SFR}$ values are larger than the $Z_{H I}$ values. This implies that the star-forming gas in all regions of the galaxies is more enriched with metals than the H I gas located along the sight lines passing the same regions. It is also apparent that the majority of the sight lines have $Z_{SFR}$ above ~0.1 solar metallicity. For the same sight lines, the $Z_{H I}$ values can be 1 order of magnitude lower. The saturation of the $Z_{SFR}$ values could be a result of the local star formation enriching the surrounding gas to $Z_{SFR} \gtrsim 0.1 Z_{\odot}$.

To undertake a more quantitative investigation, we use the medians of the $Z_{SFR}$ values, $Z_{SFR,med}$, within bins of $Z_{H I}$. The medians are marked with the pink diamonds in Figure 3, and the shaded area in the plot shows the $1\sigma$ region around the median values. In each $Z_{H I}$ bin, we measure the difference between $\log_{10}(Z_{SFR,med}/Z_{\odot})$ and the central $\log_{10}(Z_{H I}/Z_{\odot})$ value of the bin, and refer to it as $\delta$. $\delta$ clearly increases with a decrease in $Z_{H I}$ and consequently a decrease in $Z_{SFR,med}$: for a $Z_{SFR,med}$ of $Z_{\odot}$, $\delta$ is about 0.2 dex, while its value increases to 1.2 dex for a $Z_{SFR,med}$ of 0.3 $Z_{\odot}$. Equivalently, $\delta$ increases from 0.2 to 1.2 dex when $Z_{H I}$ decreases from 0.5 $Z_{\odot}$ to 0.02 $Z_{\odot}$. The scatter in the $Z_{H I}-Z_{SFR}$ relation also increases with decreasing metallicity. The $1\sigma$ (68%) spread around $Z_{SFR,med}$ varies from 0.4 to 0.7 dex between $Z_{SFR,med}$ values of $Z_{\odot}$ and 0.3 $Z_{\odot}$ (or equivalently between $Z_{H I}$ values of 0.5 $Z_{\odot}$ and 0.02 $Z_{\odot}$).

The large differences between the metallicities of the two gas phases in the low-metallicity regime indicate that the low metallicities of the atomic gas could have a large contribution from the dilution of heavy elements through mixing with the metal-poor, infalling pristine gas that is not yet enriched by heavy elements. We note that the metals in the EAGLE simulation remain fixed to their Lagrangian resolution element
<figure><img src="image_5.png" /><figcaption>**Figure 2.** Example of the construction of artificial sight lines about two galaxies of stellar mass $2 \times 10^9 M_\odot$ (top row) and $9 \times 10^9 M_\odot$ (bottom row). The four columns from left to right show the maps of gas metallicity, the H I column density, the star formation rate surface density, and $\log_{10}(Z_{SFR,med}/Z_{H1})$ defined as $\delta$ (see Section 3), respectively. Each grid has a set pixel size of 2 kpc. The side length is determined by $2R_{200}$, though in the interest of comparison, only the inner 100 kpc for each galaxy is shown here.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>**Figure 3.** The $Z_{H1}-Z_{SFR}$ plane for all the sight lines in EAGLE galaxies at $z=2$. The medians of the $Z_{SFR}$ values in each $Z_{H1}$ bin are shown with pink diamonds. The shaded area shows the $1\sigma$ spread around the medians of the $Z_{SFR}$ values. The $x=y$ line in the plane is presented by a dashed line.</figcaption></figure>

after being injected by a stellar population. Therefore, the mixing we refer to here is not an exchange of metals between resolution elements. Here, “mixing” refers to the gas (resolution elements) moving in(to) and out of the galaxy, intermingling, and transporting metals and pristine gas, or, in other words, it refers to the effective distribution of metals in

the galaxy through multiple feedback events. The dilution by inflowing pristine gas is particularly expected in the outskirts of galaxies, where the infall of gas from the IGM reduces the average metal enrichment of the diffuse H I without directly affecting the metallicity of the ionized gas (Collacchioni et al. 2020; Wright et al. 2021). On the other hand, the decreased difference between the two metallicities in the high-metallicity regime could also imply that the mixing of neutral and ionized gas in metal-rich regions (such as the central regions of galaxies) is more efficient, leading to a more uniform metal enrichment in different gas phases. The enrichment of metals due to gas mixing in different phases, and the dilution of heavy elements in neutral gas by mixing with the pristine gas, are both likely to contribute to the difference between the metallicities of atomic and ionized gas. Although, the contributions of these two effects seem to depend on, directly or indirectly, the metallicity regime.

It is important to note that the sight lines with low metallicities in Figure 3 not only sample the (metal-poor) outskirts of galaxies (independent of the stellar mass regime) but also sample the entire extent of the low-mass galaxies, irrespective of the positions of the sight lines in galaxies with respect to the galaxy centers (given the mass-metallicity relation of star-forming galaxies; Lequeux et al. 1979; Tremonti et al. 2004; Zahid et al. 2014; Kudritzki et al. 2015). The large $\delta$ values in the low-metallicity regime therefore raise the following questions: “is the mixing of gas in low-mass galaxies less efficient than in massive galaxies?,” “does the position of a sightline with respect to the center of the galaxy have a significant effect on the mixing of gas?,” and “does the stellar mass of a galaxy affect the contribution of the
<figure><img src="image_7.png" /><figcaption>**Figure 4.** The $Z_{H I}-Z_{SFR}$ plane for the sight lines at $z=2$ in three bins of stellar mass (rows) and four bins of impact parameters (columns). The color of the points indicates the $N(H\ i)$ value of each sightline, with the color bar presented on the right side of each row. The gray lines show the $Z_{SFR,med}$ values in each plot. The $x=y$ line in the plane is presented by a dashed line. Note that $R_{200}$ varies between ~40 and 90 kpc for galaxies with stellar masses between $10^8$ and $10^{10} M_{\odot}$.</figcaption></figure>

pristine gas in diluting the metal enrichment of H I in the system and result in lower values of $\delta$?"

To answer these questions one needs to separately investigate the effects of the stellar mass and the impact parameter on the $Z_{H I}-Z_{SFR}$ relation. Considering that lower-mass galaxies are smaller in size (see e.g., Shen et al. 2003; Graham & Worley 2008; Maltby et al. 2010; van der Wel et al. 2014, for the stellar-mass-size relation of galaxies), they are expected to host sight lines with generally smaller impact parameters. We therefore use the impact parameter of the sight lines, normalized by the $R_{200}$ values of galaxies (varying between ~40 and 90 kpc for galaxies with stellar masses between $10^8$ and $10^{10} M_{\odot}$) in our analysis. The large values of $b/R_{200}$ therefore correspond to the outskirts of galaxies, independent of the stellar mass or, equivalently, the size of a galaxy.

Figure 4 compares the effects of the stellar mass and the impact parameter on the $Z_{H I}-Z_{SFR}$ relation at $z=2$. Each row in the figure represents a stellar mass bin, and each column represents a specific range of the normalized impact parameter. The coloring of the points is according to the H I column densities along the sight lines. It is clear that at a given metallicity the sight lines with smaller normalized impact parameters are more concentrated around the $x=y$ line. In

other words, the difference between the $Z_{H I}$ and $Z_{SFR}$ values reduces in the central regions of galaxies, irrespective of their stellar mass.

The stellar mass of galaxies does not seem to have a direct impact on the relation between $Z_{H I}$ and $Z_{SFR}$. Of course, galaxies with higher stellar mass would have larger sizes and naturally would accommodate more sight lines at larger impact parameters. Therefore, the increase in $\delta$ and also the scatter of the relation at larger impact parameters (see the column for $0.1 \le b/R_{200} < 0.3$) in galaxies with higher stellar mass is expected. At small impact parameters (see the column for $b/R_{200} < 0.05$), both $\delta$ and the scatter in the $Z_{H I}-Z_{SFR}$ relation appears to decrease as the stellar mass of the host galaxies increases. But noting the smaller spread of H I column densities in massive galaxies in this regime of impact parameters, the smaller deviation between the two metallicities is likely not directly due to larger stellar mass, but is plausibly linked to the column density of H I. In fact, the smaller deviations between the two metallicities and the smaller scatter of the relation in low impact parameters in all stellar mass bins could be a result of higher column densities—H I column densities are generally higher in the central regions of galaxies.

To investigate the effect of the $N(H\ i)$ on $\delta$ and the scatter of the $Z_{H I}-Z_{SFR}$ relation, we consider only the sight lines with
<figure><img src="image_8.png" /><figcaption>**Figure 5.** The $Z_{H I}-Z_{SFR}$ plane for sight lines at $z=2$ selected based on $N(H\dot{I})$ and impact parameter. The $Z_{SFR,med}$ values are shown with black diamonds and the $x=y$ line is presented with the dashed lines. Top panels: sight lines with H I column densities of $10^{20} \text{ cm}^{-2} \le N(H\dot{I}) < 10^{21} \text{ cm}^{-2}$ and $N(H\dot{I}) \ge 10^{21} \text{ cm}^{-2}$ in the left and right panels, respectively. All the presented sight lines are within the $0.3 R_{200}$ from galaxy centers. The color bar represents the value for $b/R_{200}$. Bottom panels: sight lines with $0.02 < b/R_{200} \le 0.05$ in the left panel and those within the $0.02 R_{200}$ central regions of galaxies in the right panel, respectively. The color bar represents the H I column density of the sight lines.</figcaption></figure>

high H I column densities—$N(H\dot{I}) \ge 10^{20} \text{ cm}^{-2}$, the column density typically found within the optical disks of galaxies. We also restrict the sight lines to be within a distance of $b/R_{200} \le 0.3$ from the galaxy centers. The $Z_{H I}-Z_{SFR}$ plots for these sight lines at $z=2$ are presented in the top panels of Figure 5. $\delta$ and the scatter in the $Z_{H I}-Z_{SFR}$ relation remain quite large even at such high column densities. In fact, there is a significant fraction of sight lines with high H I column densities for which the difference between the two metallicities exceeds 0.5 dex.

On the other hand, when we consider the sight lines within the $0.02 R_{200}$ central regions of galaxies (irrespective of their H I column densities), $\delta$ and the overall scatter on the $Z_{H I}-Z_{SFR}$ relation appear to be much smaller. The $Z_{H I}-Z_{SFR}$ plot for these sight lines is shown in the bottom right panel of Figure 5. It is clear from this figure that these sight lines have large $N(H\dot{I})$ values, as expected to be the case in the central regions of galaxies.

Note that the region within $0.02 R_{200}$ corresponds to the ~1 kpc, ~1.5 kpc, and ~2 kpc central regions of galaxies with stellar masses of $10^8 M_{\odot}$, $10^9 M_{\odot}$, and $10^{10} M_{\odot}$, respectively. The gravitational softening length of 0.35 kpc in the simulations thus allows us to explore the separation of metallicity between gas phases at spatial scales of $0.02 R_{200}$.

In order to quantitatively compare the role of $N(H\dot{I})$ and the impact parameter on the difference between the two metallicities, we measure $\delta$ and the $1\sigma$ scatter of the $Z_{H I}-Z_{SFR}$ relation for the sight lines with $N(H\dot{I}) \gtrsim 10^{21} \text{ cm}^{-2}$ (shown in the top right panel of Figure 5) and also the sight lines located within the $0.02 R_{200}$ central regions of galaxies (presented in the bottom right panel of Figure 5). For the $Z_{SFR,med}$ values of $\gtrsim 0.3 Z_{\odot}$, $\delta$ remains around 0.2 dex for both of the groups, and the $1\sigma$ scatter around $\delta$ remains around 0.1–0.2 dex for both of the groups as well. The $Z_{H I}-Z_{SFR}$ relation in this metallicity regime, therefore, is very similar for sight lines with $N(H\dot{I}) \gtrsim 10^{21} \text{ cm}^{-2}$ and sight lines in the $0.02 R_{200}$ central regions of
<figure><img src="image_9.png" /><figcaption>**Figure 6.** Left: the $Z_{H I} - Z_{SFR}$ relation for all the sight lines of EAGLE galaxies at redshifts $z = 0, 1, 2$, and 3. The $Z_{SFR,med}$ values are marked with diamonds and the 1$\sigma$ scatter around the medians are shown with shaded areas. Right: the $Z_{SFR,med}$ values and the 1$\sigma$ scatter around them for sight lines within the 0.02 $R_{200}$ central regions of galaxies at four redshifts.</figcaption></figure>

However, both $\delta$ and the 1$\sigma$ scatter increase rapidly for the former group at $Z_{SFR,med} \lesssim 0.3Z_{\odot}$.

We can therefore safely state that the location of a sightline being within the 0.02 $R_{200}$ central regions of galaxies guarantees a small, systematic difference between $Z_{H I}$ and $Z_{SFR}$ with $\delta = 0.2$ dex. This finding implies that the mixing between star-forming gas and the H I gas is efficient in the central regions of galaxies (the mixing timescale is shorter than the typical gas depletion time). Note that this is not a direct consequence of a subgrid model for mixing since the simulations do not model subgrid diffusion. The efficiency of mixing seems to reduce by moving outwards from the galaxy centers, as indicated by the large values of $\delta$ in large impact parameters. We find this to be independent of the stellar mass of the galaxies, and hence the metallicity regime, as discussed before (see Figure 5).

On the other hand, a high H I column density of a sightline alone does not imply a small difference between the two metallicity measurements, and depending on the metallicity regime, $\delta$ could be as high as $\sim 1.5$ dex even for a sightline with $N(H I) \gtrsim 10^{21} \text{cm}^{-2}$. Sight lines located at large distances from galaxy centers, even those with high H I column densities, are less enriched with heavy elements compared to the ionized gas in projected regions that are more metal enriched due to local star formation. We note that some of these sight lines could be associated with low-mass satellite galaxies, and some could be linked to the IGM, appearing at certain impact parameters due to projection effects. But given the significant number of high $N(H I)$ sight lines with large $\delta$ values, a large number of them should be associated with the outskirts of galaxies. Given the high $N(H I)$ of these sight lines, they are less likely to be affected by mixing with pristine gas. Therefore, their large $\delta$ values should be mainly due to the inefficiency of the mixing of star-forming gas with H I. This implies that the inefficiency of the mixing of the two gas phases should be the dominant effect compared to the metal dilution in H I through mixing with pristine gas in the outskirts. Mitchell et al. (2020) and Wright et al. (2021) used the EAGLE simulations and showed that accreting gas in massive galaxies has more contributions from the recycled (hence, more metal-rich) gas compared to low-

mass galaxies. Given that the stellar mass has an insignificant role in the $Z_{H I} - Z_{SFR}$ relation, the findings of Mitchell et al. (2020) and Wright et al. (2021) support the dominant effect of the mixing of the two gas phases in the outskirts of galaxies.

We also investigate the redshift evolution of the $Z_{H I} - Z_{SFR}$ relation in the redshift range $z = 0-3$. The left panel of Figure 6 shows the $Z_{SFR,med}$ values and the 1$\sigma$ scatter of the relation for all the sight lines at redshifts $z = 0, 1, 2$, and 3. The $Z_{H I} - Z_{SFR}$ relation appears to have a slight evolution with redshift: the $Z_{SFR,med}$ of sight lines at a fixed $Z_{H I}$ slightly decreases with increasing redshift. This is consistent with the overall decrease in the average ionized gas metallicity in galaxies measured from observations. However, the relation between the two metallicities does not vary much with redshift for sight lines in the central regions of galaxies, as demonstrated in the right panel of Figure 6. The small, systematic difference between $Z_{H I}$ and $Z_{SFR}$ in the central regions of galaxies remains around 0.2 dex between $z = 0$ to $z = 3$. This suggests the efficiency of gas mixing in the central regions of galaxies to be very similar at $z = 0-3$.

## 3.2. Comparison with Observations

To compare our findings from simulations with the available observations, we use the metallicity measurements of both ionized and atomic phases of gas in the same galaxies reported in the literature. These measurements and the relevant references are provided in Table 1. The gathered observational data are for 22 intervening galaxies along quasar lines of sight, 1 gamma-ray burst (GRB) host galaxy, and 7 nearby galaxies.

For the nearby galaxies, the metallicity of H I gas is obtained from the ratio between the column densities of heavy elements (such as argon, nitrogen, and oxygen) and H I, derived from the imprinted absorption lines on the continuum emission from the bright UV targets (such as UV-bright massive stars) within these galaxies. The reported atomic metallicities of these galaxies in Table 1 are all based on the abundance of oxygen. For all of these galaxies, except M83, the values of $Z_{atomic}$ and $Z_{ionized}$ are the average values over the entire galaxies. For galaxy M83, the reported metallicities of both gas phases are
<table><caption>**Table 1**
Systems with Measured Ionized and Atomic Gas Metallicities, Gathered from the Literature</caption><thead><tr><th>Name</th><th>z</th><th>log<sub>10</sub>(N(H I)/cm<sup>-2</sup>)</th><th>b (kpc)<br>QSO Absorbers</th><th>Z<sub>atomic</sub>/Z<sub>☉</sub></th><th>Z<sub>ionized</sub>/Z<sub>☉</sub></th><th>References</th></tr></thead><tbody><tr><td>Q0302-223</td><td>1.009</td><td>20.36</td><td>25</td><td>-0.51 ± 0.12</td><td>0.04 ± 0.20</td><td>1,2</td></tr><tr><td>Q0452-1640</td><td>1.007</td><td>20.98</td><td>16</td><td>-0.96 ± 0.08</td><td>-0.46 ± 0.20</td><td>2,3</td></tr><tr><td>Q1009-0026</td><td>0.887</td><td>19.48</td><td>39</td><td>0.25 ± 0.06</td><td>0.04 ± 0.8</td><td>1,2</td></tr><tr><td>J1422-0001</td><td>0.91</td><td>20.40</td><td>12</td><td>-0.1 ± 0.4</td><td>0.04 ± 0.2</td><td>4</td></tr><tr><td>J1659+3735</td><td>0.1998</td><td>18.89</td><td>58</td><td>-1.12 ± 0.02</td><td>-0.21 ± 0.08</td><td>5</td></tr><tr><td>J2222-0946</td><td>2.354</td><td>20.65</td><td>6.3</td><td>-0.49 ± 0.05</td><td>-0.30 ± 0.13</td><td>2,3</td></tr><tr><td>HE2243-60</td><td>2.324</td><td>20.60</td><td>26</td><td>-0.72 ± 0.05</td><td>-0.32 ± 0.10</td><td>6</td></tr><tr><td>Q0235+164ID2</td><td>0.5243</td><td>21.70</td><td>13.2</td><td>-0.60 ± 0.41</td><td>-0.19 ± 0.15</td><td>7</td></tr><tr><td>Q0439-433</td><td>0.101</td><td>19.85</td><td>7.2</td><td>-0.20 ± 0.30</td><td>0.33 ± 0.14</td><td>7</td></tr><tr><td>Q0918+1636</td><td>2.5832</td><td>20.96</td><td>16.2</td><td>-0.12 ± 0.05</td><td>0.01 ± 0.20</td><td>7</td></tr><tr><td>Q2222-0946</td><td>2.354</td><td>20.65</td><td>6.3</td><td>-0.46 ± 0.07</td><td>-0.44 ± 0.19</td><td>7</td></tr><tr><td>J0238+1636</td><td>0.5253</td><td>21.70</td><td>7</td><td>-0.6 ± 0.4</td><td>-0.3 ± 0.2</td><td>8</td></tr><tr><td>J0304-2211</td><td>1.0095</td><td>20.36</td><td>25</td><td>-0.51 ± 0.12</td><td>0.04 ± 0.2</td><td>8</td></tr><tr><td>J0441-4313</td><td>0.1010</td><td>19.63</td><td>7</td><td>0.10 ± 0.15</td><td>0.50 ± 0.16</td><td>8</td></tr><tr><td>J0452-1640</td><td>1.007</td><td>20.98</td><td>16</td><td>-0.96 ± 0.10</td><td>-0.46 ± 0.20</td><td>8</td></tr><tr><td>J0918+1636</td><td>2.583</td><td>20.96</td><td>16</td><td>-0.12 ± 0.05</td><td>0.04 ± 0.2</td><td>8</td></tr><tr><td>J0958+0549</td><td>0.6546</td><td>20.54</td><td>20</td><td>-1.33 ± 0.23</td><td>-0.81 ± 0.06</td><td>8</td></tr><tr><td>J1009-0026</td><td>0.8864</td><td>19.48</td><td>39</td><td>0.25 ± 0.06</td><td>0.04 ± 0.8</td><td>8</td></tr><tr><td>J1138+0139</td><td>0.6126</td><td>21.25</td><td>12</td><td>-0.78 ± 0.16</td><td>-0.41 ± 0.18</td><td>8</td></tr><tr><td>J1204+0953</td><td>0.6390</td><td>21.04</td><td>10</td><td>-0.72 ± 0.16</td><td>-0.15 ± 0.14</td><td>8</td></tr><tr><td>J1436-0051</td><td>0.7390</td><td>20.08</td><td>50</td><td>-0.05 ± 0.12</td><td>0.33 ± 0.30</td><td>8</td></tr><tr><td>J1544+5912</td><td>0.0102</td><td>20.35</td><td>1</td><td>-0.50 ± 0.33</td><td>-0.4 ± 0.30</td><td>8</td></tr><tr><td colspan="7" style="text-align: center; font-weight: bold;">GRB Host Galaxies</td></tr><tr><td>GRB 121024A</td><td>2.30</td><td>21.88</td><td></td><td>-0.6 ± 0.2</td><td>-0.1 ± 0.2</td><td>9</td></tr><tr><td colspan="7" style="text-align: center; font-weight: bold;">M83</td></tr><tr><td>M83-3</td><td></td><td>18.94</td><td>0.2</td><td>1.19 ± 0.27</td><td>0.16 ± 0.15</td><td>10</td></tr><tr><td>M83-4</td><td></td><td>19.55</td><td>0.2</td><td>1.01 ± 0.23</td><td>0.17 ± 0.14</td><td>10</td></tr><tr><td>M83-6</td><td></td><td>20.72</td><td>3.1</td><td>0.12 ± 0.11</td><td>0.17 ± 0.20</td><td>10</td></tr><tr><td>M83-8</td><td></td><td>20.65</td><td>3.8</td><td>0.09 ± 0.09</td><td>0.24 ± 0.14</td><td>10</td></tr><tr><td>M83-9</td><td></td><td>20.56</td><td>5.1</td><td>0.08 ± 0.1</td><td>-0.05 ± 0.14</td><td>10</td></tr><tr><td>M83-12</td><td></td><td>20.98</td><td>3.3</td><td>-0.12 ± 0.07</td><td>0.15 ± 0.15</td><td>10</td></tr><tr><td>M83-14</td><td></td><td>20.43</td><td>3.2</td><td>0.18 ± 0.15</td><td>0.20 ± 0.14</td><td>10</td></tr><tr><td>M83-POS1</td><td></td><td>19.92</td><td>0.2</td><td>0.59 ± 0.09</td><td>0.31 ± 0.14</td><td>10</td></tr><tr><td>M83-POS2</td><td></td><td>18.91</td><td>0.2</td><td>0.69 ± 0.10</td><td>0.20 ± 0.14</td><td>10</td></tr><tr><td colspan="7" style="text-align: center; font-weight: bold;">Local Dwarfs</td></tr><tr><td>POX36</td><td></td><td>20.28</td><td></td><td>-1.38 ± 0.41</td><td>-0.61 ± 0.05</td><td>11</td></tr><tr><td>IZW18</td><td></td><td>21.34</td><td></td><td>-1.66 ± 0.15</td><td>-1.48 ± 0.06</td><td>12</td></tr><tr><td>SBS0335-052</td><td></td><td>21.86</td><td></td><td>-1.73 ± 0.55</td><td>-1.39 ± 0.01</td><td>13</td></tr><tr><td>IZw36</td><td></td><td>21.30</td><td></td><td>-1.76 ± 0.50</td><td>-0.89 ± 0.05</td><td>14</td></tr><tr><td>Mark59</td><td></td><td>20.85</td><td></td><td>-1.68 ± 0.3</td><td>-0.7 ± 0.003</td><td>15</td></tr><tr><td>NGC1705</td><td></td><td>20.18</td><td></td><td>-1.23 ± 0.22</td><td>-0.45 ± 0.07</td><td>16</td></tr></tbody></table>

**Note.** Columns: (1) name of the system, (2) redshift, (3) H I column density, (4) impact parameter, (5) metallicity of atomic gas, (6) metallicity of ionized gas, and (7) references. References: (1) Péroux et al. (2011); (2) Augustin et al. (2018); (3) Péroux et al. (2012); (4) Bouché et al. (2016); (5) Kacprzak et al. (2014); (6) Bouché et al. (2013); (7) Christensen et al. (2014) and references therein; (8) Rahmani et al. (2016) and references therein; (9) Friis et al. (2015); (10) Hernandez et al. (2021); (11) Lebouteiller et al. (2009); (12) Lebouteiller et al. (2013); (13) Thuan (2005); (14) Lebouteiller et al. (2004); (15) Thuan (2002); and (16) Heckman et al. (2001).

derived in individual regions in the galaxy. The impact parameters of all these regions are provided in Table 1.

The metallicities of H I in the QSO absorbers and the GRB host are derived based on the ratio between the column densities of heavy elements (such as Zn and S) and H I, obtained from ISM absorption lines imprinted on the quasar/GRB spectrum. These metallicities are therefore measured for a narrow beam along the sight lines of the bright background quasars or GRBs. The ionized gas metallicities, on the other hand, are derived from the flux measurement of the bright nebular lines, originating from the star-forming regions in

galaxies. These metallicities therefore provide an average value over the entire galaxies.

For a fair comparison between the measurements from observations and our findings from simulations, we require a representative $Z_{SFR}$ value for each of the EAGLE galaxies, which is measured over the entire star-forming disk of the galaxy, similar to the metallicity that is measured for ionized gas in galaxies based on observations. We obtain this value in two different ways: (i) we measure the mean SFR-weighted metallicity of all star-forming particles within the stellar half-mass radius of the galaxy, and (ii) we obtain the mean of the
projected regions that are more metal enriched due to local star formation. In fact, we find a significant number of sight lines with $N(\text{HI}) \ge 10^{20} \text{ cm}^{-2}$ to be associated with large impact parameters and large values of $\delta$. Some of these sight lines could be associated with low-mass satellite galaxies and some could be linked to the IGM appearing at certain impact parameters due to projection effects. But a large number of them are associated with the outskirts of galaxies. This suggests that in the galaxy outskirts, the large $\delta$ values are mainly due to the inefficiency of the mixing of star-forming gas with HI rather than the dilution of heavy elements in HI through mixing with the pristine gas.

Mitchell et al. (2020) and Wright et al. (2021) used the EAGLE simulations and showed that accreting gas in massive galaxies has more contributions from the recycled (hence, more metal-rich) gas compared to low-mass galaxies. Given that the stellar mass has an insignificant role in the $Z_{HI}-Z_{SFR}$ relation, the findings of Mitchell et al. (2020) and Wright et al. (2021) support the dominant effect of the mixing of the two gas phases in the outskirts of galaxies.

We use the metallicity measurements of the ionized and atomic gas from observations, available in the literature, and compare them with the simulations. We find these observational measurements to be in a good agreement with the $Z_{HI}-Z_{SFR}$ relation of galaxies in the EAGLE simulations. There is, however, an indication that systems with the starburst mode of star formation are likely to follow a different relation. Further analysis is required to investigate whether and how the presence of a starburst can affect the metal enrichment of different gas phases.

Increasing the number of observational data points is essential for drawing conclusions on the relation between the metallicity of the atomic and ionized gas phases in galaxies. Although there are a very large number of intervening systems detected in quasar sight lines with accurate atomic gas metallicities, the presence of the bright background quasars makes the ionized gas metallicity measurements quite challenging. Additionally, quasar sight lines typically trace the gas in the outskirts of the intervening systems, located at large distances ($>10$ kpc) from the star-forming regions where the ionized gas resides, making it even more challenging to measure the metallicity of the ionized gas in the same sightline. GRB sight lines, on the other hand, originate within the star-forming regions of their host galaxies. Therefore, the metallicities measured from the bright emission lines from the host galaxies are more likely to be representative of the metallicity of ionized gas in the GRB sight lines. This provides a better chance to have a fair comparison between the metallicity of the ionized gas in GRB sight lines (even without direct measurements) with the atomic gas metallicity obtained from imprinted absorption lines on GRB spectra. Moreover, GRBs are transients, and hence they do not interfere with the observations of the bright emission lines from their host galaxies after they fade away. Observations with the James Webb Space Telescope will allow an increase in the number of GRB hosts with metallicity measurements from both methods (Schady et al. 2021). This, however, is limited by the number of detected GRB host galaxies.

Detailed studies of individual galaxies in subkiloparsec scales, such as the study presented in Hernandez et al. (2021), are proposed to be carried out by combining the integral field unit observations of galaxies with observations of bright

background sources in order to derive the metallicities of both the gas phases in similar regions of nearby galaxies (see James et al. 2020; Kulkarni et al. 2020). Extending such studies to a large number of galaxies will allow us to test the findings presented in this paper, predicted by EAGLE, and will bring invaluable insights to our understanding of metal enrichment in galaxies.

## Acknowledgments

M.A. thanks Vianney Lebouteiller, Martin A. Zwaan, and Lise Christensen for helpful discussions. The presented study is funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany's Excellence Strategy—EXC-2094—390783311. We acknowledge the Virgo Consortium for making their simulation data available. The EAGLE simulations were performed using the DiRAC-2 facility at Durham, managed by the ICC, and the PRACE facility Curie based in France at TGCC, CEA, Bruyères-le-Châtel. This work was supported by resources provided by the Pawsey Supercomputing Centre with funding from the Australian Government and the Government of Western Australia. D.O. is a recipient of an Australian Research Council Future Fellowship (FT190100083) funded by the Australian Government. N. W. was supported by a CIERA Postdoctoral Fellowship.

## Appendix

In the main body of the paper, we have used the metallicities associated with each particle, as opposed to the SPH-smoothed version of the metallicities. Here in Figures 8–12 we present all the plots presented in Section 3 using the SPH-smoothed version of the particle metallicities.

<figure><img src="image_10.png" /><figcaption>**Figure 8.** The $Z_{HI}-Z_{SFR}$ plane for all the sight lines in EAGLE galaxies at $z=2$ with smoothed metallicities. The medians of the $Z_{SFR}$ values in each $Z_{HI}$ bin are shown with pink diamonds. The shaded area shows the $1\sigma$ spread around the medians of the $Z_{SFR}$ values. The $x=y$ line in the plane is presented by a dashed line.</figcaption></figure>
<figure><img src="image_11.png" /><figcaption>**Figure 9.** The $Z_{H I} - Z_{SFR}$ plane with smoothed metallicities for the sight lines at $z = 2$ in three bins of stellar mass (rows) and four bins of impact parameter (columns). The color of the points indicates the $N(H I)$ value of each sightline, with the color bar presented on the right side of each row. The gray lines show the $Z_{SFR,med}$ values in each plot. The $x = y$ line in the plane is presented by a dashed line. Note that $R_{200}$ varies between ~40 and 90 kpc for galaxies with stellar masses between $10^8$ and $10^{10} M_{\odot}$.</figcaption></figure>
<figure><img src="image_12.png" /><figcaption>**Figure 10.** The $Z_{H I}-Z_{SFR}$ plane with smoothed metallicities for sight lines at $z=2$ selected based on $N(H I)$ and impact parameters. The $Z_{SFR,med}$ values are shown with black diamonds and the $x=y$ line is presented with the dashed lines. Top panels: sight lines with H I column densities of $10^{20} \text{ cm}^{-2} \le N(H I) < 10^{21} \text{ cm}^{-2}$ and $N(H I) \ge 10^{21} \text{ cm}^{-2}$ in the left and right panels, respectively. All the presented sight lines are within the $0.3 R_{200}$ from galaxy centers. The color bar represents the value for $b/R_{200}$. Bottom panels: sight lines with $0.02 < b/R_{200} \le 0.05$ in the left panel and those within the $0.02 R_{200}$ central regions of galaxies in the right panel, respectively. The color bar represents the H I column density of the sight lines.</figcaption></figure>
<figure><img src="image_13.png" /><figcaption>**Figure 11.** Left: the $Z_{H I} - Z_{SFR}$ relation with smoothed metallicities for all the sight lines of EAGLE galaxies at redshifts $z = 0, 1, 2$, and 3. The $Z_{SFR,med}$ values are marked with diamonds and the $1\sigma$ scatter around the medians are shown with shaded areas. Right: the $Z_{SFR,med}$ values of smoothed metallicities and the $1\sigma$ scatter around them for sight lines within the 0.02 $R_{200}$ central regions of galaxies in four redshifts.</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>**Figure 12.** The ionized and atomic gas metallicity measurements from observations, in comparison with the obtained metallicities of EAGLE galaxies using smoothed metallicities. The quasar absorbers are shown with pink squares, and the host galaxy of GRB 121024 is presented with a purple square. Nearby dwarf galaxies are marked by black diamonds. The individual regions of M83 are shown by gray stars. The x values for these systems are measured in a single sightline from the ratio between the column densities of heavy elements and H I, obtained from ISM absorption lines. The y values for these systems are obtained from the flux measurement of the bright nebular lines coming from the entire star-forming disk of the galaxy. The size of the squares are proportional to the redshift of the system. The blue points show the EAGLE galaxies at $z = 0 - 3$ in the $Z_{H I,mean} - Z_{SFR,mean}$ plane. The quasar absorbers are shown with pink squares and the host galaxy of GRB 121024 is presented with a purple square. The x values for these systems are measured in a single sightline from the ratio between the column densities of heavy elements and H I, obtained from ISM absorption lines. The y values for these systems are obtained from the flux measurement of the bright nebular lines coming from the entire star-forming disk of the galaxy. The size of the squares are proportional to the redshift of the system. The blue points show the EAGLE galaxies at $z = 0 - 3$ in the $Z_{H I,mean} - Z_{SFR,mean}$ plane.</figcaption></figure>

## ORCID iDs

M. Arabsalmani https://orcid.org/0000-0001-7680-509X

N. Wijers https://orcid.org/0000-0001-6374-7185

J. Schaye https://orcid.org/0000-0002-0668-5560

A. Burkert https://orcid.org/0000-0001-6879-9822

B. Schneider https://orcid.org/0000-0003-4876-7756

## References

Allende Prieto, C., Lambert, D. L., & Asplund, M. 2001, ApJL, 556, L63

Allende Prieto, C., Lambert, D. L., & Asplund, M. 2002, ApJL, 573, L137

Arabsalmani, M., Møller, P., Fynbo, J. P. U., et al. 2015, MNRAS, 446, 990

Arabsalmani, M., Møller, P., Perley, D. A., et al. 2018, MNRAS, 473, 3312

Augustin, R., Péroux, C., Møller, P., et al. 2018, MNRAS, 478, 3120

Bahé, Y. M., Crain, R. A., Kauffmann, G., et al. 2016, MNRAS, 456, 1115

Bothwell, M. S., Maiolino, R., Kennicutt, R., et al. 2013, MNRAS, 433, 1425

Bouché, N., Finley, H., Schroetter, I., et al. 2016, ApJ, 820, 121

Bouché, N., Murphy, M. T., Kacprzak, G. G., et al. 2013, Sci, 341, 50

Cannon, J. M., Skillman, E. D., Sembach, K. R., & Bomans, D. J. 2005, ApJ, 618, 247

Christensen, L., Møller, P., Fynbo, J. P. U., & Zafar, T. 2014, MNRAS, 445, 225

Collacchioni, F., Lagos, C. D. P., Mitchell, P. D., et al. 2020, MNRAS, 495, 2827

Crain, R. A., Bahé, Y. M., Lagos, C. d. P., et al. 2017, MNRAS, 464, 4204

Crain, R. A., Schaye, J., Bower, R. G., et al. 2015, MNRAS, 450, 1937

Cullen, L., & Dehnen, W. 2010, MNRAS, 408, 669

Dayal, P., & Ferrara, A. 2018, PhR, 780, 1

De Rossi, M. E., Bower, R. G., Font, A. S., Schaye, J., & Theuns, T. 2017, MNRAS, 472, 3354

Diemer, B., Stevens, A. R. H., Forbes, J. C., et al. 2018, ApJS, 238, 33

Dopita, M. A., Blair, W. P., Long, K. S., et al. 2010, ApJ, 710, 964

Dubois, Y., Pichon, C., Welker, C., et al. 2014, MNRAS, 444, 1453

Durier, F., & Dalla Vecchia, C. 2012, MNRAS, 419, 465

Ferland, G. J., Korista, K. T., Verner, D. A., et al. 1998, PASP, 110, 761

Friis, M., De Cia, A., Krühler, T., et al. 2015, MNRAS, 451, 167

Garratt-Smithson, L., & Power, C. 2021, MNRAS, 501, 4396

Graham, A. W., & Worley, C. C. 2008, MNRAS, 388, 1708

Grevesse, N., & Sauval, A. J. 1998, SSRv, 85, 161

Haardt, F., & Madau, P. 2012, ApJ, 746, 125

Hamanowicz, A., Péroux, C., Zwaan, M. A., et al. 2020, MNRAS, 492, 2347

Hartoog, O. E., Malesani, D., Fynbo, J. P. U., et al. 2015, A&A, 580, A139

Heckman, T. M., Sembach, K. R., Meurer, G. R., et al. 2001, ApJ, 554, 1021

Hernandez, S., Aloisi, A., James, B. L., et al. 2021, ApJ, 908, 226
Holweger, H. 2001, in AIP Conf. Ser. 598, Joint SOHO/ACE Workshop "Solar and Galactic Composition", ed. R. F. Wimmer-Schweingruber (Melville, NY: AIP), 23

Hopkins, P. F. 2013, MNRAS, 428, 2840

James, B. L., Aloisi, A., Emerick, A., Hernandez, S. S., & Kumari, N. 2020, Pinning down Multi-phase Mixing of Metals within Star-forming Galaxies, HST Proposal, Cycle 28, ID.#16240

Kacprzak, G. G., Martin, C. L., Bouché, N., et al. 2014, ApJL, 792, L12

Kewley, L. J., & Ellison, S. L. 2008, ApJ, 681, 1183

Krumholz, M. R. 2013, MNRAS, 436, 2747

Krumholz, M. R., McKee, C. F., & Tumlinson, J. 2009, ApJ, 699, 850

Kudritzki, R.-P., Ho, I. T., Schruba, A., et al. 2015, MNRAS, 450, 342

Kulkarni, V. P., Bershady, M. A., Lundgren, B. F., et al. 2020, The Baryonic Content of Galaxies Mapped by MaNGA and Gas Flows Around Them, HST Proposal, Cycle 28, ID. #16242

Lagos, C. d., Crain, R. A., Schaye, J., et al. 2015, MNRAS, 452, 3815

Lagos, C. d., Theuns, T., Schaye, J., et al. 2016, MNRAS, 459, 2632

Lebouteiller, V., Heap, S., Hubeny, I., & Kunth, D. 2013, A&A, 553, A16

Lebouteiller, V., Kunth, D., Lequeux, J., et al. 2004, A&A, 415, 55

Lebouteiller, V., Kunth, D., Thuan, T. X., & Désert, J. M. 2009, A&A, 494, 915

Lequeux, J., Peimbert, M., Rayo, J. F., Serrano, A., & Torres-Peimbert, S. 1979, A&A, 80, 155

Lyman, J. D., Levan, A. J., Tanvir, N. R., et al. 2017, MNRAS, 467, 1795

Maio, U., Péroux, C., & Ciardi, B. 2022, A&A, 657, A47

Maiolino, R., Nagao, T., Grazian, A., et al. 2008, A&A, 488, 463

Maltby, D. T., Aragón-Salamanca, A., Gray, M. E., et al. 2010, MNRAS, 402, 282

Mannucci, F., Cresci, G., Maiolino, R., et al. 2009, MNRAS, 398, 1915

Mannucci, F., Cresci, G., Maiolino, R., Marconi, A., & Gnerucci, A. 2010, MNRAS, 408, 2115

Marigo, P. 2001, A&A, 370, 194

McAlpine, S., Helly, J. C., Schaller, M., et al. 2016, A&C, 15, 72

McKee, C. F., & Krumholz, M. R. 2010, ApJ, 709, 308

Mitchell, P. D., Schaye, J., & Bower, R. G. 2020, MNRAS, 497, 4495

Møller, P., Fynbo, J. P. U., Ledoux, C., & Nilsson, K. K. 2013, MNRAS, 430, 2680

Naab, T., & Ostriker, J. P. 2017, ARA&A, 55, 59

Péroux, C., Bouché, N., Kulkarni, V. P., York, D. G., & Vladilo, G. 2011, MNRAS, 410, 2237

Péroux, C., Bouché, N., Kulkarni, V. P., York, D. G., & Vladilo, G. 2012, MNRAS, 419, 3060

Péroux, C., Quiret, S., Rahmani, H., et al. 2016, MNRAS, 457, 903

Pillepich, A., Springel, V., Nelson, D., et al. 2018, MNRAS, 473, 4077

Portinari, L., Chiosi, C., & Bressan, A. 1998, A&A, 334, 505

Price, D. J. 2008, JCoPh, 227, 10040

Rahmani, H., Péroux, C., Turnshek, D. A., et al. 2016, MNRAS, 463, 980

Rahmati, A., Pawlik, A. H., Raičević, M., & Schaye, J. 2013, MNRAS, 430, 2427

Rahmati, A., Schaye, J., Bower, R. G., et al. 2015, MNRAS, 452, 2034

Schady, P., Tanvir, N. R., Arabsalmani, M., et al. 2021, Mapping Emission and Absorption Line Metallicities onto the same Univeral Scale, JWST Proposal, Cycle 1, ID. #2344

Schaller, M., Dalla Vecchia, C., Schaye, J., et al. 2015, MNRAS, 454, 2277

Schaye, J. 2004, ApJ, 609, 667

Schaye, J., Crain, R. A., Bower, R. G., et al. 2015, MNRAS, 446, 521

Schaye, J., & Dalla Vecchia, C. 2008, MNRAS, 383, 1210

Shen, S., Mo, H. J., White, S. D. M., et al. 2003, MNRAS, 343, 978

Silk, J., & Mamon, G. A. 2012, RAA, 12, 917

Sparre, M., Hartoog, O. E., Krühler, T., et al. 2014, ApJ, 785, 150

Springel, V. 2005, MNRAS, 364, 1105

Steidel, C. C., Rudie, G. C., Strom, A. L., et al. 2014, ApJ, 795, 165

The EAGLE team 2017, arXiv:1706.09899

Thuan, T. X., Lecavelier des Etangs, A., & Izotov, Y. I. 2002, ApJ, 565, 941

Thuan, T. X., Lecavelier des Etangs, A., & Izotov, Y. I. 2005, ApJ, 621, 269

Tissera, P. B., Rosas-Guevara, Y., Bower, R. G., et al. 2019, MNRAS, 482, 2208

Tissera, P. B., Rosas-Guevara, Y., Sillero, E., et al. 2022, MNRAS, 511, 1667

Trayford, J. W., & Schaye, J. 2019, MNRAS, 485, 5715

Tremonti, C. A., Heckman, T. M., Kauffmann, G., et al. 2004, ApJ, 613, 898

van der Wel, A., Franx, M., van Dokkum, P. G., et al. 2014, ApJ, 788, 28

van Loon, M. L., Mitchell, P. D., & Schaye, J. 2021, MNRAS, 504, 4817

Wiersma, R. P. C., Schaye, J., Theuns, T., Dalla Vecchia, C., & Tornatore, L. 2009, MNRAS, 399, 574

Wofford, A., Leitherer, C., & Chandar, R. 2011, ApJ, 727, 100

Wolfire, M. G., McKee, C. F., Hollenbach, D., & Tielens, A. G. G. M. 2003, ApJ, 587, 278

Wright, R. J., Lagos, C. d., Power, C., & Correa, C. A. 2021, MNRAS, 504, 5702

Yabe, K., Ohta, K., Akiyama, M., et al. 2015, PASJ, 67, 102

Yates, R. M., Péroux, C., & Nelson, D. 2021, MNRAS, 508, 3535

Zahid, H. J., Dima, G. I., Kudritzki, R.-P., et al. 2014, ApJ, 791, 130