Magnetic field amplification in cosmological zoom simulations from dwarf galaxies to galaxy groups

Magnetic fields are ubiquitous in the Universe. Recently, cosmological simulations of galaxies have successfully begun to incorporate magnetic fields and their evolution in galaxies and their haloes. However, so far they have mostly focused on Milky Way-like galaxies. Here we analyse a sample of high resolution cosmological zoom simulations of disc galaxies in haloes with mass $M_\mathrm{200c}$ from $10^{10}\,\mathrm{M}_\odot$ to $10^{13}\,\mathrm{M}_\odot$, simulated with the Auriga galaxy formation model. We show that with sufficient numerical resolution the magnetic field amplification and saturation is converged. The magnetic field strength reaches equipartition with turbulent energy density for galaxies in haloes with $M_\mathrm{200c}\gtrsim 10^{11.5}\,\mathrm{M_\odot}$. For galaxies in less massive haloes, the magnetic field strength saturates at a fraction of equipartition that decreases with decreasing halo mass. For our lowest mass haloes, the magnetic field saturates significantly below $10\%$ of equipartition. We quantify the resolution we need to obtain converged magnetic field strengths and discuss our resolution requirements also in the context of the IllustrisTNG cosmological box simulations. We show that, at $z=0$, rotation-dominated galaxies in our sample exhibit for the most part an ordered large scale magnetic field, with fewer field reversals in more massive galaxies. Finally, we compare the magnetic fields in our cosmological galaxies at $z=0$ with simulations of isolated galaxies in a collapsing halo setup. Our results pave the way for detailed studies of cosmic rays and other physical processes in similar cosmological galaxy simulations that crucially depend on the strength and structure of magnetic fields.


INTRODUCTION
Our present-day Universe is almost completely ionised and permeated by magnetic fields (Beck 2015).In the Milky Way and nearby disc galaxies magnetic fields are observed with various tracers to be consistent with equipartition between magnetic energy density and turbulent energy density (Boulares & Cox 1990;Beck et al. 1996;Beck 2015), though with significant systematic uncertainties.
For Milky Way-like galaxies we typically observe magnetic fields with strengths of order 1 − 10 G (Beck & Wielebinski 2013).To reach such magnetic field strengths an efficient amplification of the magnetic fields over many orders of magnitude starting from a physically plausible magnetic seed field which typically has strengths of 10 −20 G is needed (Durrer & Neronov 2013;Subramanian 2016).
In most of the gas in galaxies and on larger scales, magnetic fields are frozen into gas so we can model them with ideal magnetohydrodynamics (MHD).Magnetic fields are amplified by stretching, twisting, turning, and reconnecting them as they move with the gas, ★ rpakmor@mpa-garching.mpg.de which involves magnetic resistivity that can be modelled explicitly or numerically (for a recent overview about various proposed dynamo models see, e.g.Rincon 2019;Brandenburg & Ntormousi 2023).
The efficient amplification of magnetic fields leads to a strong coupling between the magnetic-field evolution and the details of the gas flows (Brandenburg & Subramanian 2005;Shukurov et al. 2006).In the context of galaxies, this specifically applies to the inflow of gas onto galaxies, to cooling and star formation in the interstellar medium, and also to feedback processes which act on galaxy scales but can affect the whole halo.
Observations have also been claimed to show that small scale turbulent magnetic fields contribute more to the total magnetic pressure than large scale ordered magnetic fields (Beck 2015), though the separation of scales is not straightforward (Hollins et al. 2022).However, it seems possible that observed variations on small scales, for example in Faraday rotation maps of the Milky Way (Oppermann et al. 2015), are caused by variations in the electron density rather than variations in the magnetic field (Pakmor et al. 2018;Reissl et al. 2023).
addressed by high resolution cosmological simulations of galaxies.These simulations should account for the full formation history and environment of galaxies whilst, at the same time, having sufficient resolution to capture the turbulent gas flows in the interstellar medium.Over the course of the past decade, significant progress has been made in this regard.Simulations of galaxies within a cosmological context (see, e.g.Guedes et al. 2011;Agertz et al. 2011;Vogelsberger et al. 2014;Schaye et al. 2015;Marinacci et al. 2014;Grand et al. 2017;Hopkins et al. 2018;Agertz et al. 2021) are now able to produce a reasonable galaxy population which matches many properties of observed galaxies.Similarly, the inclusion of magnetic fields in these simulations has aided the understanding of the processes that amplify and shape the magnetic fields we observe in galaxies today (Pakmor et al. 2014(Pakmor et al. , 2017;;Grand et al. 2017;Rieder & Teyssier 2017;Martin-Alvarez et al. 2018, 2022;Liu et al. 2022).
In particular, the magnetic fields in the Auriga simulations have been shown to reproduce the strength and structure of the magnetic field in the Milky Way disc at  = 0 reasonably well (Pakmor et al. 2017(Pakmor et al. , 2018)).Moreover, magnetic fields have been shown to be important for the overall evolution of galaxies at the very least in major mergers (Whittingham et al. 2021(Whittingham et al. , 2023)).They are also consistent with observational limits and the very recent first detection of magnetic fields in the circumgalactic medium (CGM) of the Milky Way (Pakmor et al. 2020;Mannings et al. 2023;Heesen et al. 2023).
However, similar cosmological simulations using different numerical schemes (the adaptive mesh refinement code ramses) and a more explicit stellar feedback model are only able to see an efficient turbulent dynamo at much higher numerical resolution and are so far not able to amplify small magnetic seed fields to saturation for Milky Way-like galaxies (Martin-Alvarez et al. 2018, 2022) or dwarf galaxies (Rieder & Teyssier 2017).Interestingly though, the strength and structure of the magnetic fields in the Auriga simulations at  = 0 has recently been reproduced for a very similar setup with an additional subgrid model for the turbulent mean-field dynamo (Liu et al. 2022) and in simulations at  = 2 − 1 with much stronger initial seed fields that do not require significant amplification via a turbulent dynamo before they saturate (Martin-Alvarez et al. 2021, 2023).
Current cosmological simulations sketch a mostly coherent picture for Milky Way-like galaxies, where a high redshift turbulent dynamo amplifies a tiny magnetic seed field to roughly ∼ 10% of equipartition between magnetic and turbulent energy density.Then, after the formation of a rotating gas disc, the magnetic field in this disc is further amplified to equipartition and ordered on large scales (Pakmor et al. 2017).Sufficient numerical resolution is crucial to accurately model the high redshift turbulent dynamo and to simulate its saturation before the formation of the disc (Pakmor et al. 2017).Alternatively, subgrid models for turbulent dynamos lead to very similar results (Liu et al. 2022).Note that the resolution requirements might critically depend on the numerical diffusion of the scheme used for MHD (Guillet et al. in prep).
So far cosmological zoom-in simulations that include magnetic fields have mostly focused on detailed studies of Milky Way-like galaxies (Pakmor et al. 2014(Pakmor et al. , 2017;;Hopkins et al. 2020;Ramesh et al. 2023).The IllustrisTNG simulations include magnetic fields at the resolution of typical cosmological box simulations focused on galaxy formation and evolution (TNG100, TNG300, Marinacci et al. 2018).The highest resolution box of the IllustrisTNG simulations (TNG50, Nelson et al. 2019;Pillepich et al. 2019) reaches a similar mass resolution than lower resolution zoom-in simulations.Despite the lower resolution of box simulations compared to zoom-in simulations, the box simulations allow for the analysis of magnetic field amplification over a much larger range of galaxy masses and for many more galaxies.
It is important to understand the resolution requirements for modelling magnetic fields in galaxies before we put too much weight on their physical interpretation.We should confine our interpretation to properties that we know are reasonably well converged in the simulations, i.e., whose values do not change much with numerical resolution.Converged magnetic fields are also crucial for the structure of gas flows in the CGM (van de Voort et al. 2021) and for a range of other physical processes that are starting to be studied and included in new generations of galaxy simulations.
Possibly among the most important physical processes to better model the evolution of galaxies, the modelling of cosmic ray prop-agation and their dynamic back reaction on gas requires reliable magnetic fields (Ruszkowski & Pfrommer 2023).In particular in cosmological simulations this is especially true, where the magnetic field is not a free parameter but completely determined by gas dynamics, essentially independently from the initial seed fields if properly resolved (Pakmor et al. 2014;Garaldi et al. 2021).
Proper resolution studies of the magnetic field evolution in cosmological simulations have so far only been done for galaxies in the mass range of the Milky Way with cosmological zoom-in simulations (Pakmor et al. 2014(Pakmor et al. , 2017).Here we extend previous studies of cosmological zoom-in simulations beyond Milky Way-like galaxies by considering disc galaxies in haloes ranging in  200c mass from 10 10 M ⊙ to 10 13 M ⊙ , and by simulating them at different numerical resolutions.Doing this with zoom-in simulations allows us to reach drastically higher numerical resolution for low mass galaxies than what is possible in cosmological box simulations.
We aim to understand how magnetic fields evolve over time, what minimum resolution is required to obtain converged results for our galaxy formation model, what physical processes govern the amplification and saturation of magnetic fields and set their present time structure, and how all of those change with halo mass.
The paper is structured as follows.In Section 2 we describe the simulations, simulation methods, and halo selection.In Section 3 we look at global properties of our disc galaxies at  = 0.In Section 4 we analyse the amplification of magnetic fields, its dependence on numerical resolution, and the physical properties that determine the saturation strength of magnetic fields.We then look in detail at the high redshift turbulent dynamo in galaxies over a wide range of halo masses in Section 5.In Section 6, we analyse the structure of the magnetic field in the galaxy discs at  = 0. Finally we summarise our results and provide an outlook of future work in Section 7.

METHODS AND HALO SELECTION
We simulate 14 cosmological haloes with  = 0 halo masses ( 200c ) in the range 10 10 M ⊙ to 10 13 M ⊙ using the cosmological zoom-in technique.Here we define the halo properties  200c and  200c such that the average density in a sphere of radius  200c is 200 times the critical density of the universe and  200c is the mass enclosed by  200c .
We selected the haloes from the dark matter-only EAGLE box (Schaye et al. 2015) and re-simulated them with a substantially increased resolution within a volume that encompasses the Lagrangian region of all dark matter particles in the halo at  = 0 and those surrounding it out to 5 200c .To encompass the entire mass range, we selected two haloes at each 0.5 dex in halo mass, facilitating a direct comparison with isolated galaxies analysed using a collapsing halo setup in the same range (Jacob et al. 2018).In particular, for low mass haloes we chose our haloes such that they host galaxies which are more disc dominated than is typical in this mass range.This allows us to compare more fairly and directly to the isolated galaxies which are typically disc dominated by construction.
We run our simulations with the arepo code (Springel 2010;Pakmor et al. 2016a;Weinberger et al. 2020).arepo solves ideal MHD on a moving Voronoi mesh with a second order finite volume scheme (Pakmor et al. 2011;Pakmor & Springel 2013).It computes selfgravity using a tree-PM scheme and couples it to MHD with a second order Leapfrog scheme (Springel 2010;Springel et al. 2021).We implement additional physical processes relevant for the formation and evolution of galaxies in the auriga galaxy formation model (Grand et al. 2017).It includes radiative cooling of hydrogen and helium, metal line cooling, heating from a spatially uniform time-evolving UV background (Vogelsberger et al. 2013), an effective model for the multiphase interstellar medium (Springel & Hernquist 2003), a stochastic model for star formation, metal production and mass loss from star particles by stellar winds and supernovae (Vogelsberger et al. 2013), an effective model for galactic winds, as well as a model for the formation and growth of supermassive black holes and their feedback (Grand et al. 2017).
The model has been widely used and tested in detail for Milky Way-like galaxies, their CGM, and for their satellites (see, e.g.Grand et al. 2017;van de Voort et al. 2019;Simpson et al. 2018;Grand et al. 2021).Here, we apply this model to a significantly wider range of halo masses and focus in particular on the amplification of magnetic fields.We aim to understand how the physical processes governing magnetic fields in galaxies change with halo mass and numerical resolution.
We seed magnetic fields with a spatially uniform seed field at the start of the simulations at  = 127 with a comoving strength of 10 −14 G.Note that neither the exact strength of the seed field (Pakmor et al. 2014) nor the detailed seeding mechanism (Garaldi et al. 2021) change the properties of magnetic fields in Milky Way-like galaxies and their CGM at low redshift, provided sufficient numerical resolution is achieved.The turbulence erases all memory of the seed field at high redshift (Pakmor et al. 2014(Pakmor et al. , 2017) ) and magnetised outflows from the galaxy set the early magnetisation of the CGM (Pakmor et al. 2020).Based on establishing the conditions (in particular in terms of numerical resolution) to obtain converged magnetic fields, we augment the simulations with cosmic rays (Pfrommer et al. 2017;Pakmor et al. 2016b;Buck et al. 2020) in forthcoming work (Bieri et al. in prep).
To understand the effects of numerical resolution, we ran half of the haloes (one per mass bin) additionally at different, lower resolution levels.For our simulations one resolution level lower means that all high resolution resolution elements (gas, stars, wind particles, and dark matter particles) have an eight times larger mass.The lower resolution runs use identical model parameters, in particular for star formation and feedback.We only increase all gravitational softenings by a factor of 2 for every factor of 8 in increase of the mass of resolution elements, as we have done in the past for the auriga simulations.
We also compare the global properties of our galaxies with isolated galaxy simulations in the collapsing halo setup (Jacob et al. 2018;Pakmor et al. 2016c;Pfrommer et al. 2022).This setup starts from a sphere of dark matter and gas that each follow an NFW mass density profile (Navarro et al. 1996).The gas is initially in hydrostatic equilibrium, rotating as a solid body with a dimensionless spin parameter of  = 0.3, and permeated by a uniform magnetic field with an initial strength of 10 −10 G. From the beginning of the simulation the gas starts to cool radiatively and quickly collapses into a gas disc that forms stars and provides stellar feedback.
We focus our comparison on global properties of the galaxies and the properties of the magnetic fields.We aim to understand how well the more idealised isolated galaxy setup matches the selfconsistent cosmological setup, and to get an idea to what degree we can expect the results from those isolated simulations (see, e.g.Pakmor & Springel 2013;Pakmor et al. 2016c;Jacob et al. 2018;Pfrommer et al. 2022) to hold in cosmological galaxy simulations.
Note, however, that this comparison is not completely fair, as the Face-on and edge-on stellar light projections of our galaxies at  = 0 at the highest resolution level available for each galaxy.The -axis is oriented along the eigenvector of the moment of inertia tensor of all stars within 0.1 200c that is closest to the total angular momentum vector of those stars.We selected one galaxy per 0.5 dex in halo mass to illustrate the halo mass dependence and focus most of our analysis on this subsample.Dashed circles in the face-on projections show the size of the gas disc.
two setups have substantial differences.While the isolated and cosmological simulations use the same model for star formation and the interstellar medium, the isolated galaxies do not include an effective model for galactic winds, but instead include cosmic rays only (albeit without explicit supernova feedback), which leads to an emerging galactic wind.The isolated galaxies also do not include supermassive black holes and their associated feedback, which is problematic for the more massive galaxies.Naturally, they also lack a fully self-consistent CGM, and their stellar population is fundamentally younger.At the same time, the simulations are computationally much cheaper and can be run at a higher resolution.Here we compare to the simulations by Jacob et al. (2018) that resolve their halos with 10 6 cells each.More recent simulations with the same setup use 10 7 or more cells (Pfrommer et al. 2022).Additionally, a higher degree of control over the properties of the galaxy can be achieved through changes to parameters in the initial conditions.

GLOBAL GALAXY PROPERTIES AT THE PRESENT TIME
We list the global properties of all cosmological haloes and their central galaxies at  = 0 in Table 1 for the highest resolution simulation of each halo.In the remaining parts of the paper, we will only use these highest resolution simulations, except when we explicitly study the resolution dependence.
We first focus on global properties of the galaxies and their magnetic fields and how they depend on halo mass.We show face-on and edge-on stellar light projections at  = 0 in Figure 1.To simplify the overview and visualisation of the halo mass dependence, we display only one galaxy per mass bin.
Except for the smallest dwarf galaxy in the 10 10 M ⊙ halo, all galaxies in Figure 1 feature clear stellar discs at  = 0.Even the smallest galaxy is still flattened.This is not surprising even in the lowest halo mass bins, as we selected the most disc-like galaxies (by eye), with average stellar masses (for the sample) of an original Face-on and edge-on gas surface density at  = 0. Dashed circles in the face-on projections show the size of the gas disc  disc , defined as the circle with an average surface density of 10 M ⊙ pc −2 .Dashed cylinders in the edge-on projections show radius  disc and height ℎ disc of the gas disc.We discuss our definition of radius and height of the gas disc in detail in Section 3.For the lowest mass halo (top left panel) we cut at 1 M ⊙ pc −2 instead.sample of 10 galaxies per decade in halo mass to compare them with isolated disc galaxies.
We show face-on and edge-on gas surface density projections at  = 0 in Figure 2.Here we also orient our galaxies according to the stellar angular momentum vector for consistency.The dashed circles in the face-on projections mark the cylindrical radius that has an average surface density of 10 M ⊙ pc −2 including all gas bound to the halo.We define this to be the disc radius.The smallest galaxy (top left panel) does not reach this threshold at all so we adopt a cut at 1 M ⊙ pc −2 instead.The dashed rectangles in the edge-on projections show a cylinder with a radius equal to the disc radius and a height such that the averaged surface density is, again, 10 M ⊙ pc −2 .We define the disc height to be half of the height of this cylinder.We see that galaxies in haloes with  200c > 10 11.5 M ⊙ (top right and all bottom panels of Figures 1 and 2) show clearly flattened discs.The galaxies in the 10 10.5 M ⊙ and 10 11 M ⊙ haloes show signs of discs, albeit very puffy ones.
We present a quantitative comparison of global properties of all cosmological galaxies with a set of isolated galaxies in Figure 3.The cosmological galaxies are shown at  = 0.For the stellar-mass halo-mass relation (top left panel) we also include the very high resolution cosmological dwarf galaxies of the LYRA suite (Gutcke et al. 2022), for comparison.They are run at an even higher baryonic mass resolution of 4 M ⊙ and include cooling below 10 4 K and explicit thermal feedback from individual resolved supernovae instead of an effective model for the ISM.In all panels of Figure 3 we compare to the isolated galaxies from Jacob et al. (2018) at  = 3 Gyr.At later times the isolated galaxies deviate more from the cosmological galaxies as their gas reservoir depletes.
In the top left panel of Figure 3, we see that the stellar-mass ) and ratio between total magnetic and total turbulent energy in the disc (bottom right panel) for all cosmological galaxies at  = 0 (blue symbols).The light blue diamonds (A) denote the subset of galaxies shown in the 7-panel figures, for example in Fig. 1.The dark blue diamonds (B) show the other 7 halos.For comparison we also show the LYRA sample (gray squares) of cosmological dwarf galaxies (Gutcke et al. 2022) and different empirical relations between stellar mass and halo mass (Moster et al. 2010(Moster et al. , 2013;;Behroozi et al. 2013;Girelli et al. 2020) in the top left panel.Moreover, we also include the set of isolated galaxies with cosmic ray driven outflows by Jacob et al. (2018) at 3 Gyr in all panels (red circles).The isolated galaxies agree well with the cosmological simulations over the full range of halo masses with a saturated magnetic field strength about 2-3 times lower than in the cosmological simulations.
halo-mass relation is consistent between cosmological and isolated galaxies.The most massive haloes, with  200c = 10 13 M ⊙ , have too high stellar mass compared to relations inferred from observations, likely due to shortcomings of the AGN model.At the low mass end, our galaxies are roughly consistent with the most massive galaxies from the very high resolution LYRA simulations (Gutcke et al. 2022).Note, however, that a wide range of stellar masses has been obtained in dedicated cosmological simulations of low mass haloes (Oñorbe et al. 2015;Macciò et al. 2017;Agertz et al. 2020).Still it might be a bit surprising that the Auriga interstellar medium (ISM) model produces galaxies with reasonable stellar masses at this halo mass scale.We will explore the implications of this, along with a detailed comparison between effective (Springel & Hernquist 2003) and resolved (Gutcke et al. 2022) ISM models at the same accessible mass scale, in future work.
In the top right panel of Figure 3 we show the sizes of gas discs at Magnetic field amplification over time for galaxies in haloes of different  200c and for different mass resolution.Solid lines show the volume-weighted root mean square magnetic field strength in the gas disc, dotted lines in the halo.The magnetic field strength in the disc is computed in a fixed physical cylindrical volume set by  disc and ℎ disc at  = 0 and rotated according to the current orientation of the stellar disc.The magnetic field strength in the halo is computed for 0.25 200 <  <  200 at each time.All galaxies show exponential amplification of the magnetic field at early times until the magnetic field saturates.The saturation strength is similar as long as a minimum required resolution is reached.This minimum resolution increases for smaller haloes.Saturation in the halo is reached at roughly the same time or only slightly later than in the galaxy.
= 0.The sizes of the cosmological galaxies are consistent with the isolated galaxies, with the exception of one of the two galaxies in the most massive 10 13 M ⊙ haloes (1e13_h7) that has essentially no gas left in its central galaxy at  = 0, likely due to feedback from active galactic nuclei.
The bottom left panel of Figure 3 shows the volume averaged root mean square magnetic field strength in the disc at  = 0.It is qualitatively similar between cosmological and isolated galaxies, but a factor of 2-3 higher in the cosmological galaxies in comparison to the isolated galaxies.For both sets there is only a weak trend of magnetic field strength in the disc with halo mass.Only the smallest galaxy of the isolated sample has a significantly lower magnetic field strength.
Finally, the bottom right panel of Figure 3 shows the ratio of the total magnetic energy to the total turbulent energy in the disc at  = 0. Here, we estimate the turbulent energy density as 1.5 times the sum of the kinetic energy densities in the radial and vertical components of the velocity field, assuming that these components are dominantly turbulent, and the azimuthal component of the velocity field has a turbulent contribution of equal strength.We focus on the comparison between total magnetic energy and total turbulent energy, because we expect the turbulent dynamo to saturate when the magnetic energy density reaches several 10% of the turbulent energy density, though it might be as high as unity under certain conditions (Federrath 2016;Kriel et al. 2023).Similarly, for most large scale dynamos the small scale velocity field likely sets the saturation strength of the total magnetic field (Rincon 2019).Moreover, equipartition between total magnetic energy density and turbulent energy density is consistent with observations of nearby galaxies (see, e.g.Beck 2015).
In cosmological simulations of Milky Way-like galaxies we have seen saturation of the turbulent dynamo at high redshift when the magnetic energy density reaches a few 10% of the turbulent energy density.We then observe further amplification to equipartition between turbulent and magnetic energy density after the formation of a rotating gas disc (Pakmor et al. 2017).Except for the galaxies in the lowest mass haloes  200c ≤ 10 10 M ⊙ , all cosmological galaxies as well as all isolated galaxies reach at least 10% of equipartition between magnetic and turbulent energy.Galaxies in haloes with  200c ≥ 10 11.5 M ⊙ are consistent with equipartition, except for the 1e13_h7 that has no dense starforming gas left at  = 0.
The isolated galaxies show comparable levels of saturation of the magnetic energy density for  200c ≥ 10 11.5 M ⊙ .For galaxies in less massive haloes the saturation level is systematically higher in isolated galaxies.Together with the bottom left panel of Figure 3, which shows the magnetic field strength, this paints a consistent picture in which the turbulent energy density is significantly lower in isolated galaxies.This is likely due to two combined reasons.Turbulent driving by accretion/shear against the CGM is reduced, as the isolated galaxies have been depleted of gas.Moreover, isolated galaxies have weaker outflows because of the absence of the effective galactic wind model, which plays an important role in the cosmological galaxies.The general good agreement in many properties .Radial profiles of kinetic, turbulent, magnetic, and thermal energy densities in cylindrical coordinates in the disc at  = 0. We estimate the turbulent energy density as 1.5 times the sum of kinetic energy densities in the radial and vertical components of the velocity field.Galaxies in haloes with  200c > 11.5 M ⊙ reach equipartition between turbulent and magnetic energy density.Galaxies in smaller haloes saturate their magnetic field significantly below equipartition.
[erg pc log 10 (M 200c /M ) = 10.9 . Radial profiles of kinetic, magnetic, and thermal energy densities in spherical coordinates in the whole halo at  = 0, excluding satellite galaxies.In haloes more massive than  200c > 10 11 M ⊙ the magnetic energy density saturates at around 10% of the kinetic energy density in the CGM.For smaller haloes, the magnetic field in the CGM is barely amplified at all.At the smallest radii, where the profile measures the energies in the central galaxies, the magnetic energy density reaches equipartition with the thermal energy density for haloes more massive than  200c > 10 11 M ⊙ .between cosmological and isolated galaxies is quite surprising given the differences in feedback models, but clearly demonstrates the usefulness of the collapsing halo setup to study galaxy formation and evolution in comparison to setups that do not follow the formation of galactic discs self-consistently, but require additional assumptions for example on the properties the magnetic fields (like isolated discs or tallbox setups).

AMPLIFICATION AND SATURATION OF MAGNETIC FIELDS
For Milky Way-like galaxies we have found in previous work that the magnetic field amplification proceeds in two steps.Once the galaxy has grown sufficiently large, a turbulent dynamo amplifies the magnetic field at high redshift.It saturates when the magnetic energy density reaches a few 10% of the turbulent energy density.
For sufficiently high resolution this happens long before the galaxy forms a disc.Later, after the formation of a disc, the magnetic field is ordered and further amplified to equipartition where it remains until  = 0 (Pakmor et al. 2014(Pakmor et al. , 2017)).The CGM is magnetised slightly later than the central galaxy, primarily by magnetised outflows from the central galaxy, until at low redshift an in-situ dynamo in the halo contributes as well (Pakmor et al. 2020).We now aim to understand to what degree this picture holds in less massive and more massive haloes, and whether we need to adapt it.
In Figure 4 we show the time evolution of the magnetic field strength in the disc (solid lines) and the halo (dotted lines) for one halo per mass bin, and for three different numerical resolution levels per halo.We compute the magnetic field of the disc in the physical volume of the disc cylinder at  = 0, as defined in Section 3, even if there is no disc yet.We orient the cylinder according to the stars at the current time.We compute the magnetic field in the halo in a volume given by 0.25  200c <  <  200c , where we use the value of  200c at that time, meaning that the physical volume we consider changes with time.Note that for different resolution levels the disc sizes change by less than a factor of 2 and typically only by 20% − 30%, and that  200c is essentially identical.
Figure 4 shows a clear exponential amplification of the magnetic field in galaxies of all halo masses at high redshift, provided that the simulations are run with sufficient numerical resolution.In this case, the magnetic field strength saturates at essentially the same strength, independent of resolution.This resolution requirement, however, depends significantly on the halo mass.
The converged saturated magnetic field strength in all galaxies is several orders of magnitude larger than expected from purely adiabatic changes of the initial seed field.For purely adiabatic changes, i.e. the magnetic field strength scales with  2/3 (see also Equation 1for a more detailed discussion), we would roughly expect a magnetic field strength of 10 −4 G at densities of 1 cm −3 that are typical for the ISM.The magnetic field strengths we see in our galaxies (e.g. in Figure 4) are at least of order G, which requires an efficient dynamo to operate.
For the lowest mass haloes,  200c ≤ 10 10.5 M ⊙ , the simulation with a mass resolution of  gas = 6 × 10 3 M ⊙ is insufficient to properly saturate the magnetic field strength, the simulation with  gas = 8 × 10 2 M ⊙ seems to reach the physical saturation level only at low redshift (after  = 1), and only the highest resolution simulation with a mass resolution of  gas = 10 2 M ⊙ has a saturated magnetic field strength at high redshift.
For haloes with masses  200c = 10 11 M ⊙ and  200c = 10 11.5 M ⊙ we find that we need a resolution of 5 × 10 4 M ⊙ to saturate the magnetic field strength at sufficiently high redshift, well before a gas disc forms.For Milky Way-like galaxies with a halo mass close to  200c = 10 12 M ⊙ a resolution of 4 × 10 5 M ⊙ is sufficient, and for more massive haloes even at a mass resolution of 3 × 10 6 M ⊙ the magnetic field is quickly amplified and saturates at high redshift.For the most massive halo, the magnetic field strength is lower at the highest resolution because the disc contains significantly less gas.
Note that these quantitative resolution requirements almost certainly depend on the details of the numerical scheme, in particular its numerical viscosity and resistivity.The resolution requirements will also depend on the galaxy formation and feedback model employed, and are directly applicable only for simulations ran with the Auriga model (Grand et al. 2017).Nevertheless, they can at least give us an idea to what degree we can trust the magnetic field properties in the large cosmological box simulations of the IllustrisTNG project (Marinacci et al. 2018) that employ a galaxy formation model (Weinberger et al. 2017;Pillepich et al. 2018) which is, in many aspects, similar to the Auriga model.Directly adopting our resolution requirements, we can infer that the magnetic field of galaxies in TNG100, that used a mass resolution of 10 6 M ⊙ , is reliable down to halo masses of  200c ≳ 10 12 M ⊙ , and in galaxies in TNG50 with its mass resolution of 8 × 10 4 M ⊙ down to halo masses of  200c ≳ 10 11 M ⊙ .
We next look for the physical cause of the saturation strength of the magnetic field.In Figure 5 we compare the radial profiles of different energy densities at  = 0 in cylindrical shells with the height of the gas disc of the highest resolution simulation of each galaxy.The saturation strength is consistent with equipartition between magnetic energy density and thermal or turbulent energy density in galaxies of haloes with  200c ≥ 10 11.5 M ⊙ .For smaller haloes a dynamo is still clearly present, but the magnetic energy density saturates below equipartition with the thermal or turbulent energy density.This gap widens for progressively lower halo masses.
Interestingly, in the galaxies that reach equipartition the kinetic energy in ordered rotation clearly dominates over turbulent, thermal, and magnetic energy.For galaxies in less massive haloes ordered rotation becomes less and less important, and at the same time the ratio between magnetic energy density and turbulent and thermal energy density decreases.For the galaxy in the smallest 10 10 M ⊙ halo the kinetic energy is dominated by turbulent energy, and ordered rotation is mostly absent for the gas.For this galaxy the magnetic field saturates at only a few percent of equipartition.Importantly, the saturation strength seems to be set by physical properties of the galaxy for all galaxies, because it is converged with resolution (see Figure 4).
The magnetic field strength in the halo is shown in Figure 4 by the dotted lines.The picture that emerges is very similar to the evolution of the magnetic field strength in the central galaxy, but slightly delayed.The resolution requirements to obtain a converged saturated magnetic field in the halo are essentially the same as for the magnetic field strength in the central galaxy.The magnetic field in the halo always starts to be amplified and saturates after the magnetic field in the galaxy.This indicates that magnetised outflows from the central galaxy whose magnetic field has been amplified already, contribute significantly at all halo masses, consistent with earlier results for the halo of Milky Way-like galaxies (Pakmor et al. 2020).The apparent drop of the magnetic field strength in the halo in Figure 4 after saturation is caused by the growth of the halo, so that the magnetic field is averaged over a larger volume that extends to lower density gas.
We show radial profiles of different energy densities in the whole halo at  = 0 in Figure 6.We compute the energy densities in spherical shells in the rest frame of the halo and include only cells that are associated with the main subhalo, i.e. excluding cells bound to satellite galaxies.Haloes with  200c ≥ 10 11 M ⊙ have significantly amplified magnetic fields in the CGM out to at least the virial radius.The saturation level of the magnetic energy in the CGM (0.2 200c ≲  3D ≲  200c ) is roughly 10% of equipartition with the (fluctuating) kinetic energy.The most massive halo with  200c = 10 13 M ⊙ seems to saturate at a slightly smaller fraction of equipartition.Haloes with  200c ≤ 10 10.5 M ⊙ essentially do not amplify the magnetic field in the halo, and the magnetic energy density profile drops steeply at about 0.2  200c .Likely this is a result of the combination of very weak galactic outflows and weaker inflows that lead to less turbulent haloes at low redshift at this mass scale in the Auriga model.Many of the profiles display a feature around  3D ∼ 0.2 200c that is connected to the size of the gas disc.For smaller radii the kinetic energy density is dominated by rotation.For larger radii instead the kinetic energy density corresponds to the turbulent energy density in the absence of large-scale ordered rotation.Moreover, the average gas density drops significantly at the edge of the gas disc.2) for the estimate we use) and the correlation between Reynolds number and amplification rate of the magnetic energy density (top right panel).The circles and diamonds correspond to different simulations from the Cosmological (A) and Cosmological (B) sets, respectively.The colors denote the baryonic mass resolution of the simulations, and  200c is the mass of the halo at  = 0. We estimate the time when the magnetic energy in 10% of the virial radius first exceeds 1000 times the energy expected for purely adiabatic changes of the magnetic field strength.We measure the amplification rate at a similar time, for details see the text.The bottom panels show the age of the universe at this time when the dynamo kicks in  dynamo (bottom left panel) and the time when the amplification started, extrapolating back from the  dynamo under the assumption that the amplification rate is constant (bottom right panel).The amplification rate scales as expected for a turbulent dynamo.Moreover, we argue that the start of the exponential amplification of the magnetic field is set by the evolution of the halo, rather than reaching a critical Reynolds number.
in Section 4 that the magnetic field becomes orders of magnitudes stronger than expected from adiabatic compression alone.
The obvious candidate for a physical mechanism that quickly amplifies the magnetic field at early times is a small-scale dynamo, which is the main source of the amplification process in Milky Waylike galaxies (Pakmor et al. 2017).For a turbulent dynamo a turbulent velocity field is essential, leading to the exponential amplification of the magnetic field.This amplification continues until saturation occurs, initially on smaller scales, and subsequently on larger ones, when the magnetic energy density reaches ∼ 10% of the turbulent energy density on a given scale (Federrath 2016).
To get a qualitative idea about the structure of the velocity field at high redshift we turn to Figure 7 The relief shows the orientation of the magnetic field strength using the line integral convolution method (Cabral & Leedom 1993).The ordering of the magnetic field increases with halo mass, from being essentially unordered to showing predominantly azimuthal magnetic fields.
to 10 13 M ⊙ projected along the -axis of the simulation box.The picture that emerges holds for the other halos as well.All haloes show a very similar picture of large-scale coherent inflows feeding the galaxy with gas.The in-flowing gas moves in from different directions, interacts with other inflowing gas as well as outflowing gas from the central galaxy and produces a highly chaotic, turbulent velocity field at smaller radii.The transition to a turbulent flow happens roughly where the wind particles re-couple and deposit their mass, momentum, and thermal energy into a cell, which is set by a threshold density of 0.05 cm −3 .At  = 5 this density threshold translates to a radius of ∼ 0.75  200c , and at  = 3 to about 0.5  200c .At  = 0 they typically recouple within a few kpc of the disc.
There are quantitative differences between haloes of different masses.The turbulent region extends to larger radii in more massive haloes, and turbulence is already stronger.
Having established qualitatively that the velocity field at the centre of the haloes is turbulent at high redshift, we now quantify the structure of the velocity and magnetic field in Figure 8.This figure shows power spectra of the kinetic energy density (solid lines) and magnetic energy density (dashed lines) for the same haloes as in Figure 7 for four different redshifts from  = 5 to  = 1.To obtain the kinetic power spectra we first map each component of √︁ /2  to a 1024 3 uniform Cartesian mesh.We chose the size of the mesh as twice  200c at  = 1 and keep the same physical size for all power spectra of one halo.We use zero padding to compensate for the periodicity of the Fourier transformation.We then transform each component into Fourier space where we compute   as the one-dimensional kinetic energy density averaged in shells in  space.We use the same procedure to obtain the magnetic power spectra from mapping / √ 8.The kinetic power spectra are consistent with subsonic turbulence (Kolmogorov 1941) with an injection scale only slightly smaller than the size of the halo at the higher redshifts (e.g. = 3).The energy injected on large scales cascades down to the grid scale which assumes the smallest physical dimensions in the ISM for all haloes.The haloes differ quantitatively in how quickly the kinetic energy density increases with time, and how the peak of the kinetic power spectrum shifts with time.
At  = 1 the central galaxies in the more massive haloes have formed gas discs.The initial strong gas accretion in all haloes has calmed down and the haloes have become predominantly hydrostatic.Feedback driven outflows from the central galaxy have become stronger as the star formation rate has substantially increased, but those are not the exclusive drivers of turbulence in the halo.Turbulence in the central galaxy is probably dominantly sourced by star formation, and the interaction between the disc and the halo (Bieri et al. 2023;Pfrommer et al. 2022) for the galaxies with a gas disc.
The shape of the magnetic power spectra are consistent with expectations of a turbulent dynamo.The magnetic field strength increases exponentially with time.It grows fastest on the smallest scales and then saturates there when the magnetic energy density reaches ∼ 10% of the kinetic energy density on small scales.This process happens on larger scales as well, but takes a longer time.For the lowest mass haloes the largest scale on which the magnetic field eventually reaches equipartition is small compared to the size of the halo and at a smaller fraction of the injection scale.Therefore the total magnetic energy in the lower mass haloes saturates at a smaller fraction of the total kinetic energy than in massive haloes.
The slope of the magnetic power spectrum on large scales is consistent with ∝  3/2 which is as expected for the kinematic amplification phase of the turbulent dynamo (Kazantsev et al. 1985).Over time, the saturation scale grows to larger and larger scales until it reaches scales just below the injection scale.Note that, at  = 1, the kinetic power spectrum shown in Figure 8 includes kinetic energy in ordered differential rotation in the gas disc if present, i.e. in the more massive haloes.
Having established the presence of a turbulent dynamo, we can try to better understand the resolution effects seen in Figure 4. We see two main effects.At higher resolution the amplification of the magnetic field strength proceeds faster and it seems to start earlier.
From idealised simulations of subsonic turbulence we expect that a minimum numerical Reynolds number of Re ≳ 100 is needed to amplify the field (Schober et al. 2012).For smaller Reynolds numbers dissipation is faster than amplification and the turbulent dynamo is completely suppressed.Moreover, we expect the amplification rate of the magnetic field strength in the kinetic regime to roughly scale with Γ ∝

√
Re (Schober et al. 2012;Pfrommer et al. 2022).We now confront both expectations with the magnetic field evolution in our galaxies and at different numerical resolution.Note, however, that the situation in our simulations is much more complicated and the comparison should be interpreted with appropriate care.In particular, there is more than one process driving turbulence, at least gravitational infall and feedback driven outflows from the galaxy, potentially driving on different scales.Moreover, the gas density as well as the numerical resolution in the haloes change significantly with distance to the center of the haloes, and the turbulent flow is multiphase and potentially coupled via magnetic fields.
To quantify the magnetic field amplification in our simulations we first find the earliest snapshot in which the magnetic energy within 0.1 200c is larger than 1000 times the value it had from purely adiabatic compression.For this estimate we compute the adiabatically expected magnetic field strength of all cells in 0.1 200c as where  0 is the physical magnetic field strength in the initial conditions and  0 the physical gas density at this time.When this condition is met, consequently the magnetic field strength has been amplified by more than √ 1000, i.e. more than an order of magnitude already by a dynamo.The magnetic energy density is still orders of magnitude smaller than the turbulent energy density, so we are safely in the kinetic regime where the back reaction of the magnetic field on the gas dynamics is irrelevant.We call this time  dynamo .We estimate the numerical Reynolds number at this time as where L is the length scale of turbulent injection,  cell is the typical diameter of the smallest cells in the center of the galaxy, and we assume V ≈  th (Pfrommer et al. 2022).For L we take the radius at which the wind particles recouple (see also Figure 7) and for  cell we use the average diameter of the 100 smallest cells in the halo as an estimate of the smallest eddies we resolve.Using the average of the 10 or 1000 smallest cells gives essentially identical results.
To estimate the amplification rate of the magnetic field we combine the snapshot at  dynamo , the last snapshot before it, and all later snapshots until the magnetic energy density in the same physical volume that we used to find  dynamo has exceeded 10 4 times the adiabatically expected magnetic energy density.We fit an exponential growth rate to the average magnetic field strength in the same volume of all those snapshots as where   () is the magnetic energy density at time ,  ,0 is the magnetic energy density expected from purely adiabatic changes of the magnetic field, and Γ is the amplification rate of the magnetic energy density.We show the amplification properties for all our galaxies at all available resolution levels in Figure 9.They all indicate a turbulent dynamo with Reynolds numbers Re ≥ 100.The Reynolds number increases with increasing resolution for the same halo, and increases as well with halo mass at fixed resolution.The increase with resolution is easily explained as the size of the smallest cells decreases with resolution but the injection scale stays roughly the same.Note though that the Reynolds numbers are estimated at different times (as shown in the bottom left panel of Figure 9), so the objects are not directly comparable.The global properties usually only change slowly, however, on timescales of Gyrs.
We show the growth rate of the magnetic energy in the top right panel of Figure 9.We see that the growth rate correlates with the Reynolds number consistent with naive expectations, lending additional credibility to our interpretation of the exponential amplification of the magnetic field strength in terms of a turbulent dynamo.We note that it is not a priori clear if we should expect this result, because we are comparing many different haloes, on top of large uncertainties in the estimates of both the Reynolds number and the amplification rate.Moreover, the amplification rate even at our highest resolution simulations is much smaller than expected in reality, because the numerical resistivity in our simulations is much larger than realistic values for the physical resistivity (Schober et al. 2013).
Lastly we show  dynamo in the bottom left panel of Figure 9, as well as an estimate of the time when the dynamo actually started in the bottom right panel of Figure 9.We obtain this estimate by extrapolating from  dynamo backwards in time to () =  0 using the growth rate estimates shown in the top right panel of the same figure.The starting times for the dynamo amplification are of order 1 Gyr and do not change monotonically with resolution for individual haloes.We conclude that they are consistent with each other within the uncertainties of the estimate.
Therefore we argue that the onset of the turbulent dynamo is set by the evolution of the halo, i.e. its growth and early star formation history that generates outflows, rather than numerical limitations.This is not completely surprising because all our simulations reach Reynolds numbers Re ≥ 100, sufficient to support a turbulent dynamo according to idealised estimates (Brandenburg & Subramanian 2005;Schober et al. 2012) as well as practical experiences from numerical simulations of galaxies (Martin-Alvarez et al. 2018).In contrast, the amplification rate and therefore also the time when the magnetic field saturates, clearly depend on the numerical resolution of the simulations (see, e.g. Figure 4).

MAGNETIC FIELD STRUCTURE AT THE PRESENT EPOCH
We have, so far, focused on the strength of the magnetic field, which is a good measure of its dynamic impact.However, the structure of the magnetic field is equally important, in particular for transport processes along magnetic field lines, for example of cosmic rays   2018) at 3 Gyr.The magnetic field is dominated by its azimuthal component for galaxies in haloes with  200c ≳ 10 11 M ⊙ .However, the azimuthal component of the magnetic field is always relatively less important than the azimuthal component of the velocity field.(Pakmor et al. 2016b;Thomas et al. 2021), but also for various observational diagnostics of magnetic fields like Faraday rotation, or polarised radio emission (Beck 2015).
As we demonstrated in Figure 2, at  = 0 our simulated galaxies have gas discs in the more massive haloes with  200c ≥ 10 11 M ⊙ .We expect the rotation of the discs to order the magnetic field over time.In Figure 10 we show the structure and strength of the magnetic fields in the gas discs at  = 0.The galaxies in haloes with  200c ≥ 10 11 M ⊙ display large-scale, azimuthally ordered magnetic fields, whereas the two galaxies in less massive haloes do not, consistent with the absence of a dominant gas disc.
To get a better idea of the ordering process of the magnetic field we consider maps of the azimuthal component of the magnetic field of the cosmological galaxies at  = 0 in the upper panels of Figure 11.Except for the galaxy in the 10 12.5 M ⊙ halo, all cosmological galaxies have azimuthal magnetic fields with at least one field reversal.Although the detailed structure of the field reversals is highly stochastic, there is a general trend that galaxies in more massive haloes have a more ordered field with fewer reversals inside the disc, compared to galaxies in less massive haloes.Interestingly, the galaxies that feature a large scale ordered field with few reversals (in haloes  200c ≥ 10 11.5 M ⊙ ) are the same galaxies that reach equipartition between turbulent and magnetic energy (as shown in Figure 5).
For comparison we show the azimuthal component of the isolated galaxies at 3 Gyr in the lower panels of Figure 11.They exhibit very similar properties and trends.In particular the magnetic field in the disc is also more ordered with fewer reversals in more massive halos.The magnetic fields show clear signs of spiral structures.However, we postpone a detailed analysis of these spiral structures and correlations with other disc structures (such as magnetic and stellar spiral arms) and an in-depth study of the ordering process of the magnetic field in the discs to future work.
To quantify the importance of the azimuthal component of the magnetic field relative to its radial and vertical components at  = 0 we look at its energy relative to the total magnetic energy in the volume of the disc in the upper panel of Figure 12.For galaxies in haloes with  200c ≥ 10 12 M ⊙ , the magnetic field in the disc is strongly dominated by the azimuthal component (i.e. it contains at least 50% of the magnetic energy).This is in contrast to the smallest galaxies in haloes of  200c ≤ 10 10.5 M ⊙ , where the magnetic field has no preference for the azimuthal direction.This is again consistent with the absence of a rotationally supported gas disc at late times.Between these two extremes the importance of the azimuthal magnetic field steadily increases with increasing halo mass.
Figure 12 compares the relative importance of the azimuthal magnetic field in cosmological galaxies with isolated galaxies and highlights some interesting differences.Lower mass isolated galaxies in haloes of  200c ≤ 10 11 M ⊙ have a more important azimuthal magnetic field component in comparison to cosmological galaxies in haloes of the same mass.This is likely a direct consequence of rotation being more important for the isolated galaxies, as can be seen in the lower panel of Figure 12 which shows the fraction of kinetic energy in rotation over the total kinetic energy in the gas disc.Here we see quantitatively that in cosmological galaxies in haloes with  200c ≤ 10 11 M ⊙ rotation becomes less important for the dynamics of the gas disc, even though we already the galaxies to be the most discy of their halos mass range.In contrast, the isolated galaxies remain rotationally dominated even in the lowest mass haloes.This might motivate a smaller value for the initial spin parameter of these isolated haloes in order to make them more realistic in future simulations.

SUMMARY AND OUTLOOK
In this paper we have shown that in all our cosmological zoom simulations with sufficient numerical resolution a turbulent dynamo efficiently amplifies the magnetic field.It saturates already at high redshift and the saturation strength is converged in galaxies at all halo masses.The dynamo typically saturates when the magnetic energy density reaches ≳ 10% of the turbulent kinetic energy density.
The time when saturation is reached depends strongly on numerical resolution.The dynamo saturates early enough only with sufficient resolution.Importantly, only then the galaxy has a physically meaningful magnetic field for most of its evolution.
The galaxies in the lowest mass haloes saturate below that value, possibly because of the shortcomings of our ISM subgrid model for the smallest galaxies.To better understand magnetic fields in the smallest dwarf galaxies and to quantify the dependence on the subgrid model we plan to compare our results to simulations of dwarf galaxies with a more detailed, explicit ISM model (e.g. the Lyra model; Gutcke et al. 2022) in the future.
The numerical resolution that is required to reach converged saturated magnetic fields depends strongly on halo mass.We need better than 10 3 M ⊙ gas mass resolution for the smallest 10 10 M ⊙ halo, a gas resolution of 5 × 10 4 M ⊙ or better for haloes with 10 11 M ⊙ ≤  200c ≤ 10 11.5 M ⊙ , a gas resolution of 4 × 10 5 M ⊙ or better for Milky Way-like galaxies with a halo mass of  200c ∼ 10 12 M ⊙ , and gas resolution of 3 × 10 6 M ⊙ for more massive haloes with  200c ≥ 10 12.5 M ⊙ .This very roughly translates to a minimum of 10 6 gas cells (of equal mass) in the whole halo.
Note that these numbers certainly depend on the numerical scheme as well as on the feedback model used.They are therefore only directly applicable to the Auriga model, but should still provide a good guideline for the IllustrisTNG model as well due to its close similarity.
More fundamentally though, our understanding of MHD turbulence is still incomplete and MHD turbulence is currently an area of active research.Analytical studies and numerical simulations indicate that the saturation level of the magnetic field, i.e. the ratio of magnetic to kinetic energy at saturation, depends significantly on the Prandtl number, i.e. the ratio between the magnetic and the kinetic Reynolds numbers (Federrath et al. 2014;Schober et al. 2015;Kriel et al. 2023).For Prandtl numbers significantly larger than unity, as expected for the volume filling warm phase of the interstellar medium (Rincon 2019), the ratio between magnetic and kinetic energy can even reach unity.This regime, however, is currently still impossible to reach in galaxy simulations because of a lack of numerical resolution.Moreover, in addition to numerical resolution, different models for the interstellar medium and feedback processes (Springel & Hernquist 2003;Grand et al. 2016;Rieder & Teyssier 2017;Su et al. 2018;Hopkins et al. 2020;Martin-Alvarez et al. 2022) as well as the numerical scheme (Teyssier et al. 2006;Pakmor & Springel 2013;Mocz et al. 2016;Hopkins et al. 2020) are important ingredients that could influence the evolution of magnetic fields in simulations of galaxies.
We demonstrated that for haloes with masses  200c ≥ 10 11 M ⊙ the circumgalactic medium is also fully magnetised at  = 0 at a level of ∼ 10% of equipartition between magnetic and kinetic energy.The magnetisation of the halo is started by magnetised outflows from the galaxy, similar to previous results for Milky Way-like galaxies (Pakmor et al. 2020).In lower mass haloes, the CGM is essentially not magnetised as galactic outflows do not penetrate far enough into the halo in the Auriga model, and their CGM is not turbulent enough to support an in-situ dynamo.
Our cosmological galaxies in haloes with  200c ≥ 10 12 M ⊙ are dominated by azimuthal magnetic fields.This dominance weakens with decreasing halo mass and is absent for the smallest dwarf galaxies in haloes of mass  200c ≤ 10 10.5 M ⊙ .
We compare our galaxies to simulations of isolated galaxies by Jacob et al. (2018).These isolated galaxies from the collapsing halo setup are a surprisingly good representation of low-redshift cosmological galaxies in haloes of  200c ≥ 10 11.5 M ⊙ , despite lacking most of their accretion history and the gradual buildup of stellar mass.Lower mass isolated galaxies have weaker magnetic fields than cosmological galaxies in haloes of the same mass, because they are significantly less turbulent.Ordered rotation is also more important in low mass isolated galaxies compared to our cosmological simulations.
In the future, we plan to examine in more detail the magnetic fields in the CGM, their dynamical effects, and how those change with halo mass.Having shown convergence for the magnetic fields, we will simulate the galaxies studied in this paper augmented with cosmic rays (Buck et al. 2020) to investigate their effect on the gas flows in and around galaxies in a cosmological environment for a wide range of halo masses.Reliable magnetic fields will also allow us to include other physical transport processes that depend on the structure of the magnetic field, such as anisotropic thermal conduction (Kannan et al. 2016).
Magnetic fields are finally becoming a more commonly included component in cosmological galaxy simulations (see, e.g.Pakmor et al. 2014Pakmor et al. , 2017;;Hopkins et al. 2020;Martin-Alvarez et al. 2022;Liu et al. 2022).They already allow us to routinely generate various synthetic observables connected to magnetic fields and compare them to observations (Pakmor et al. 2018;Ponnada et al. 2022;Jung et al. 2023;Reissl et al. 2023;Martin-Alvarez et al. 2023;Ponnada et al. 2023).However, we are still only scratching the surface of many questions and it needs to be checked whether our results hold in other simulation codes and with different galaxy formation models.
Isolated galaxy simulations, which allow for much higher resolution, and therefore an easier inclusion of more physical processes, and also provide a more controlled way to understand specific questions and setups (see, e.g.Jacob et al. 2018;Bieri et al. 2023;Pfrommer et al. 2022;Thomas et al. 2023), will remain an important approach to improve our understanding of how galaxies evolve.Such simulations can likely be improved and made more realistic in the future by using cosmological simulations to motivate the choice of initial (and boundary) conditions.At the same time, results from simulations of high resolution isolated galaxies can lead to improvements of subgrid models in cosmological simulations.We conclude that combining high resolution cosmological zoom simulations with even higher resolution simulations of isolated galaxies holds a lot of promise to understand magnetic fields and other physical processes connected to and depending on them.
Figure1.Face-on and edge-on stellar light projections of our galaxies at  = 0 at the highest resolution level available for each galaxy.The -axis is oriented along the eigenvector of the moment of inertia tensor of all stars within 0.1 200c that is closest to the total angular momentum vector of those stars.We selected one galaxy per 0.5 dex in halo mass to illustrate the halo mass dependence and focus most of our analysis on this subsample.Dashed circles in the face-on projections show the size of the gas disc.

10 8 Figure 3 .
Figure3.Stellar mass (top left panel), radius of the gas disc (top right panel), magnetic field strength in the disc (bottom left panel) and ratio between total magnetic and total turbulent energy in the disc (bottom right panel) for all cosmological galaxies at  = 0 (blue symbols).The light blue diamonds (A) denote the subset of galaxies shown in the 7-panel figures, for example in Fig.1.The dark blue diamonds (B) show the other 7 halos.For comparison we also show the LYRA sample (gray squares) of cosmological dwarf galaxies(Gutcke et al. 2022) and different empirical relations between stellar mass and halo mass(Moster et al. 2010(Moster et al. , 2013;;Behroozi et al. 2013;Girelli et al. 2020) in the top left panel.Moreover, we also include the set of isolated galaxies with cosmic ray driven outflows byJacob et al. (2018) at 3 Gyr in all panels (red circles).The isolated galaxies agree well with the cosmological simulations over the full range of halo masses with a saturated magnetic field strength about 2-3 times lower than in the cosmological simulations.

R
Figure5.Radial profiles of kinetic, turbulent, magnetic, and thermal energy densities in cylindrical coordinates in the disc at  = 0. We estimate the turbulent energy density as 1.5 times the sum of kinetic energy densities in the radial and vertical components of the velocity field.Galaxies in haloes with  200c > 11.5 M ⊙ reach equipartition between turbulent and magnetic energy density.Galaxies in smaller haloes saturate their magnetic field significantly below equipartition.

Figure 7 .
Figure 7. Gas surface density projections of four haloes, increasing in mass from 10 10 M ⊙ to 10 13 M ⊙ at  = 3 with velocity streamlines.The dashed circles show  200 at this time.The dotted circles give the radius where wind particles typically recouple at this time.All haloes feature large scale coherent inflows onto the halo that transition to a turbulent flow close to the recoupling radius where inflows and outflows meet.

Figure 9 .
Figure 9. Quantification of the turbulent dynamo phase.The top panels give an estimate of the Reynolds number (top left panel, see Equation (2) for the estimate we use) and the correlation between Reynolds number and amplification rate of the magnetic energy density (top right panel).The circles and diamonds correspond to different simulations from the Cosmological (A) and Cosmological (B) sets, respectively.The colors denote the baryonic mass resolution of the simulations, and  200c is the mass of the halo at  = 0. We estimate the time when the magnetic energy in 10% of the virial radius first exceeds 1000 times the energy expected for purely adiabatic changes of the magnetic field strength.We measure the amplification rate at a similar time, for details see the text.The bottom panels show the age of the universe at this time when the dynamo kicks in  dynamo (bottom left panel) and the time when the amplification started, extrapolating back from the  dynamo under the assumption that the amplification rate is constant (bottom right panel).The amplification rate scales as expected for a turbulent dynamo.Moreover, we argue that the start of the exponential amplification of the magnetic field is set by the evolution of the halo, rather than reaching a critical Reynolds number.

Figure 10 .
Figure10.Magnetic field strength at  = 0 in thin face-on projections.The relief shows the orientation of the magnetic field strength using the line integral convolution method(Cabral & Leedom 1993).The ordering of the magnetic field increases with halo mass, from being essentially unordered to showing predominantly azimuthal magnetic fields.

5kpcFigure 11 .
Figure11.Azimuthal component of the magnetic field of the cosmological galaxies at  = 0 (top panels) and of the isolated galaxies at 3 Gyr (bottom panels) in thin face-on projections.The black dashed circle shows the size of the gas disc.The azimuthal magnetic field becomes more ordered in more massive halos in both sets of simulations.

Figure 12 .
Figure12.Fraction of magnetic energy (top panel) and kinetic energy (bottom panel) in the azimuthal component in comparison to the total magnitudes in the disc, respectively.The blue diamonds show all cosmological galaxies at  = 0. Red circles give isolated galaxies by Jacob et al. (2018) at 3 Gyr.The magnetic field is dominated by its azimuthal component for galaxies in haloes with  200c ≳ 10 11 M ⊙ .However, the azimuthal component of the magnetic field is always relatively less important than the azimuthal component of the velocity field.