The magnetised and thermally unstable tails of jellyfish galaxies

Jellyfish galaxies are promising laboratories for studying radiative cooling and magnetic fields in multiphase gas flows. Their long, dense tails are observed to be magnetised, and they extend up to 100 kpc into the intracluster medium (ICM), suggesting that their gas is thermally unstable so that the cold gas mass grows with time rather than being fully dissolved in the hot wind as a result of hydrodynamical interface instabilities. In this paper we use the AREPO code to perform magnetohydrodynamical windtunnel simulations of a jellyfish galaxy experiencing ram-pressure stripping by interacting with an ICM wind. The ICM density, temperature and velocity that the galaxy encounters are time-dependent and comparable to what a real jellyfish galaxy experiences while orbiting the ICM. In simulations with a turbulent magnetised wind we reproduce observations, which show that the magnetic field is aligned with the jellyfish tails. During the galaxy infall into the cluster with a near edge-on geometry, the gas flow in the tail is fountain-like, implying preferential stripping of gas where the rotational velocity vectors add up with the ram pressure while fall-back occurs in the opposite case. Hence, the tail velocity shows a memory of the rotation pattern of the disc. At the time of the nearest cluster passage, ram-pressure stripping is so strong that the fountain flow is destroyed and instead the tail is dominated by removal of gas. We show that gas in the tail is very fragmentative, which is a prediction of shattering due to radiative cooling.


INTRODUCTION
Galaxy halos are multiphase with cold, warm and diffuse gas phases (Tumlinson et al. 2017).This is, for example, seen in absorption spectroscopy of the circumgalactic medium (CGM) of galaxy samples, where H i and O vi ions, corresponding to cold and warm gas, are detected (Werk et al. 2014).A similar diverse set of ions tracing different temperatures are observed in spectroscopy probing gas in the Local Group (Richter et al. 2017).
Realistically treating multiphase gas is a major challenge to modern galaxy formation models relying on hydrodynamical cosmological simulations.To reliably simulate the thermal instability caused by radiative cooling, it is necessary to resolve the cooling length, as shown in two- (McCourt et al. 2018) and three-dimensional simulations (Sparre et al. 2019) of a cold-dense cloud interacting with a hot-diffuse wind.For cold CGM gas with a temperature of 10 4 -10 5 K it is, however, not possible to resolve this length-scale in stateof-the-art cosmological simulations.This causes gas in the CGM to fragment to the grid-scale of the simulations (Hummels et al. 2019;van de Voort et al. 2019).McCourt et al. 2018 introduced the term shattering to describe the fragmentative nature of gaseous cold clouds with sizes larger than their cooling length that interact with a wind.
Another effect caused by radiative cooling is that large clouds exposed to a hot wind grow, when gas from the surroundings of a ★ E-mail: sparre@uni-potsdam.decloud cools faster in comparison to the hydrodynamical destruction time-scale of the cloud (Yamagami & Fujita 2011;Armillotta et al. 2016;Gronke & Oh 2018;Li et al. 2020;Sparre et al. 2020;Kanjilal et al. 2021;Abruzzo et al. 2022Abruzzo et al. , 2023)).This provides a plausible explanation for how cold gas can survive far out in the CGM (Fielding & Bryan 2022).
A promising probe of the physics of multiphase gas is ram-pressure stripping of galaxies infalling into galaxy clusters.In the galaxies' rest frame, the ICM wind interacts with spiral galaxies and provides the ram-pressure to strip gas from the interstellar medium (ISM) to potentially transform the spirals into quenched ellipticals (Boselli et al. 2022;Marasco et al. 2023).As a result of the interaction a long gaseous tail, often detectable in neutral hydrogen (H i;Ramatsoku et al. 2019Ramatsoku et al. , 2020)), UV (George et al. 2018), H (Gullieuszik et al. 2020), X-ray (Campitiello et al. 2021) and even molecular gas (Moretti et al. 2018), is formed.A popular term for such galaxies is jellyfish galaxies.Furthermore, Franchetto et al. (2021) measured the metallicity of jellyfish tails, as revealed by optical emission lines, and showed that they consist of a mix of stripped ISM from the galaxy and gas from the ICM.Due to their enormous spatial extends of 50-100 kpc (Cramer et al. 2019;Campitiello et al. 2021) jellyfish tails probe gas shattering and growth of the cold gaseous phase.In addition to probing the effects of radiative cooling and hydrodynamical instabilities, jellyfish galaxies also probe the magnetic field and cosmic ray electrons as shown by Müller et al. (2021).The authors showed that the orientation of the magnetic field is aligned with the jellyfish tail, which can be understood as the result of draping magnetised plasma from a hot wind around the galaxy-wind interface, where the plasma undergoes thermal instability, accreting onto the outer layers of the tail in order to be adiabatically compressed and sheared (Sparre et al. 2020).
Idealised simulations of the ICM interacting with a galaxy have been used to study jellyfish galaxies from a theoretical point of view.Steinhauser et al. (2016) initialised a gas profile around a cluster and simulated a galaxy orbiting it.An alternative approach to this setup is a windtunnel simulation of a galaxy flying through a cluster with a fixed velocity, density and temperature representing a snapshot of ICM conditions.Tonnesen & Bryan (2009) used such a setup to study the gas loss of jellyfish galaxies in hydrodynamical simulations.The setup was extended to also include a galaxy magnetic field (Tonnesen & Stone 2014), which only slightly changes the gas stripping rate of the galaxy, but more importantly leaves a µG-strength magnetised jellyfish tail extending far into the ICM.
In reality, the ICM is, of course, much more complex than a wind with a fixed velocity, density and temperature.Using a time-variable wind velocity and a uniform magnetic ICM wind, Ruszkowski et al. (2014) showed that the configuration of the ICM magnetic field influences the tail, and a magnetic wind generally supports the formation a dense tail.Tonnesen (2019), furthermore, demonstrated that the time-dependent behaviour of the model ICM plays an important role for the evolution of the jellyfish galaxy.
A more realistic geometry of the interaction between a jellyfish galaxy and the ICM can be obtained using cosmological galaxy formation simulations (as in Jung et al. 2018;Yun et al. 2019;Zinger et al. 2023;Göller et al. 2023;Rohr et al. 2023).A limitation of cosmological simulations in comparison to idealised counterparts is the lower spatial resolution, and their high computational cost.Idealised simulations are also easier to interpret and it is more straightforward to interpret the role of physics model variations.
In this paper we study how the ICM magnetic field influences the jellyfish galaxy tails in idealised simulations.We perform windtunnel simulations with a time-dependent velocity, density, temperature and turbulent magnetic field, all mimicking what a jellyfish galaxy would experience while orbiting a galaxy cluster.The simulations presented in this paper improve on the simulation modelling in Sparre et al. (2020) and Müller et al. (2021) by including a realistic self-gravitating disc galaxy instead of a spherical non-gravitational cloud.As such, these new simulations enable us to more realistically compare our results to the magnetic field detections of Müller et al. (2021).We introduce our simulations in Sect.2, the results are presented in Sect.3, in Sect. 4 we discuss our results and Sect. 5 summarises our conclusions.

OVERVIEW OF SIMULATIONS
In this subsection, we describe our simulations of a galaxy in a windtunnel with a time-dependent wind model, mimicking a jellyfish galaxy interacting with the ICM.

Simulation code and setup
For our simulations we use the magnetohydrodynamical code arepo (Springel 2010;Pakmor et al. 2016;Weinberger et al. 2020).It uses a Voronoi mesh, which is moving with the gas flow, as this is well suited for astrophysical applications (Torrey et al. 2012;Vogelsberger et al. 2012;Sĳacki et al. 2012).
Each simulation has a baryonic target mass,  bar .If a gas cell is more (less) massive than 2 bar ( bar /2) it is refined (de-refined).
Table 1.The table shows the initial conditions for the disc galaxy of mass  200 = 2 × 10 12 M ⊙ , which will evolve into a jellyfish galaxy in our simulations.Those initial conditions are created with the code makenewdisk.We use the same nomenclature as in Springel et al. (2005).

Symbol
Value Note  200 179.9 km s −1 Calculated as (10 0  200 ) On top of this we use a neighbour volume refinement scheme, which refines a gas cell if it has a volume larger than 8 times that of one of its neighbours.This improves the treatment of regions with large density gradients.We use a rectangular simulation domain with size (  ,   ,   ) = (600, 1200, 600) kpc.In the initial conditions (ICs), the galaxy itself is centred on ( galaxy,IC ,  galaxy,IC ,  galaxy,IC ) = (300, 450, 300) kpc.The galaxy is initialised with zero bulk velocity, and the wind moves in the ŷ-direction.
In the lower part of the simulation box we have the injection region ( < 46 kpc), where the ICM wind is created.Here the density, temperature, metallicity and magnetic field components are set to the injection values (as outlined in Sect.2.2).

Thermal wind properties
The time-dependent ICM wind, which we input in our simulations, is based on halo A of Steinhauser et al. (2016).They generated this profile by calculating the orbit of a test particle within a 1.1 × 10 15 M ⊙ halo.A gas and halo density profile was assumed for the cluster (see their figure 1), and the initial temperature profile was calculated by assuming hydrostatic equilibrium.A hydrodynamical simulation of a jellyfish galaxy and the ICM was then run, and the density, temperature, and velocity experienced by the jellyfish galaxy was then recorded in time.We note, that the ICM evolved slightly in time.
We base the wind profiles of our simulations on these resulting profiles.In the first 2 Gyr, we have extrapolated their profiles to allow a burn-in phase, where our galaxy settles into equilibrium before it is hit by the wind.We define our burn-in phase to be the first 1 Gyr of the simulation.Our resulting velocity, density and temperature profiles are shown in Fig. 1.We show both the wind-profile, which is read into the injection region (dashed line), as well as the wind experienced by the galaxy (solid line).The latter is calculated by adding a time-offset of  galaxy, IC /  ().Here  galaxy, IC = 450 kpc is the initial -coordinate of the galaxy centre.
In Fig. 1, we have marked the time, when the galaxy enters the virial radius of the galaxy cluster,  200 , which is the radius interior to which the mean density equals 200 times the critical density of the universe, as well as the time of the nearest core passage, i.e., where the density, temperature and velocity profiles peak.In the wind we set the metallicity to Z ⊙ /3 with a solar abundance pattern (Asplund et al. 2009).In our simulations the jellyfish galaxy experiences a time-dependent wind, which mimics the changing ICM properties along its orbit inside the galaxy cluster.The black-dotted line shows the wind in the lower part of the simulation box, where the wind is injected, and the black-solid line shows the wind at the location of the galaxy taking into account the time it takes for the wind to move from the lower part of the box to the galaxy centre.In the first Gyr, the wind has not yet reached the galaxy, so the galaxy can settle into an equilibrium before ram-pressure stripping becomes important.We refer to this as the burn-in phase.At a time of 2.2 Gyr, the galaxy enters  200 and we switch to the wind profile of our galaxy cluster model (from Steinhauser et al. 2016), with the nearest passage of the cluster core at 3.0 Gyr.The amplitude of the magnetic field is chosen such that we obtain  ≡  th /  = 50 for the wind.

The turbulent magnetic field
The time-dependent magnitude of the magnetic field is chosen to ensure an initial magnetic-to-thermal pressure ratio of  = 50 (see Fig. 1).We generate magnetic field fluctuations on a periodic cube with a side length of 600 kpc, and a turbulent power spectrum (generated with the code from Ehlert et al. 2018) of the form, with  inj = 1/50 kpc −1 and  crit = 1/6 kpc −1 .The adopted turbulent injection scale 1 of ℓ inj = 50 kpc is a compromise of various inferences from astrophysical observations: deprojecting Faraday rotation measure fluctuations in the centre of the Hydra A cool core cluster yields a lower limit on the injection scale of magnetic turbulence of ℓ inj > 8 kpc (Kuchar & Enßlin 2011).There are no measurements of ℓ inj on larger scales so that we have to infer the magnetic injection scale from that of kinetic turbulence.Assuming a fluctuating magnetic dynamo necessarily implies an outer scale of magnetic turbulence that is smaller than that of kinetic motions by a factor that depends on the magnetic Prandtl number (Brandenburg & Subramanian 2005); this behaviour is also observed for fluctuating magnetic dynamos during galaxy formation with radiative gas physics (Pakmor et al. 2017;Pfrommer et al. 2022).Mapping out the line-of-sight velocity and (turbulent) velocity dispersion of the X-ray emitting ICM in galaxy clusters demonstrates the presence of velocity gradients (and possibly eddies) across scales of ∼ 80 kpc (Hitomi Collaboration et al. 2016).Using a number of assumptions, the kinetic power spectrum can be inferred from thermal pressure fluctuations as observed in the X-rays to yield ℓ inj,kin ≳ 90 kpc in the Coma cluster (Schuecker et al. 2004).Deprojecting X-ray surface brightness fluctuations yield characteristic fluctuation length scales ranging from 10 kpc (in the centre) to 30 kpc (at cluster centric radii of ∼ 200 kpc) (Zhuravleva et al. 2015) that can be pushed to ℓ inj,kin ≳ 300 kpc at intermediate radii in the Perseus Cluster (de Vries et al. 2023).
The exponential cutoff scale is chosen so that we well resolve all turbulent fluctuations throughout our simulations.We note that the density of our ICM wind is time-dependent following Fig. 1, so the spatial resolution of our wind also varies in time (because we use the same target gas mass throughout the simulation).

Initial conditions for the galaxy
We use the software makenewdisk (Springel et al. 2005) to create the ICs for a disc galaxy with a halo mass of  200 = 2 × 10 12 M ⊙ .This is the galaxy experiencing ram-pressure stripping by the ICM wind.The input parameters are summarised in Table 1.We calculate the virial velocity  200 , which is an input parameter of makenewdisk, based on the above choice of  200 .We use the approximation  200 ≃ (10 0  200 ) 1/3 and use  0 = 0.6774 km s −1 Mpc −1 from the Planck15 cosmology (Planck Collaboration et al. 2016).
A coordinate system with  ′ ≡  −  galaxy,IC (and similarly for  ′ and  ′ ) is used to describe the initial properties of the galaxy.
The dark matter profile is described as a Hernquist profile (Hernquist 1990), mimicking an NFW profile (Navarro et al. 1996) with a halo concentration of  =  200 / −2 , where  −2 is the radius where d log /d log = −2, i.e. the scale radius of the NFW profile.2.An overview of simulation parameters.In all simulations the wind velocity is in the -direction.We show the simulation name (1), the baryonic mass resolution (2), the galaxy disc's inclination  ≡ | ∡ ( disc ,  wind ) | (3), the ICM wind's magnetic field configuration (4) and an explanatory note (5).
makenewdisk creates a stellar and gaseous disc with surface density profiles following where R ≡ √︁  ′2 +  ′2 is the cylindrical radius and ℎ is the exponential scale length.For the stellar component, this surface density profile is achieved by sampling from the density profile, where  0 is the scale height of the disc.We choose  0 = 0.2ℎ, and ℎ itself is determined based on the halo spin parameter () and assuming the disc to be centrifugally supported (solving equation ( 9) in Springel et al. 2005).For our galaxy, our parameters displayed in Table 1 yield a value of ℎ = 4.16 kpc, which is comparable to high-resolution simulations of Milky-Way-mass halos (Grand et al. 2017;Libeskind et al. 2020).
The effective equation of state, self-gravity and the choice of a surface density profile give no freedom for a -dependence of the disc (see Springel et al. 2005 for details).For the gaseous disc, the density profile is determined by (i) assuming a central density in the  ′ = 0 mid-plane, and (ii) integrating the density in the -direction to obtain Σ gas .The central density in the first step is adjusted and the process is repeated until the surface density profile in Eq. ( 3) is obtained.This process also determines the pressure (and temperature) of the gas disc, because the gas in the disc is star-forming and is described by an effective equation of state (see Sect. 2.5) where the effective thermal pressure is a function of density  therm =  therm ().
The disc has a mass of  ★,disc +  gas,disc =  d  200 , and it has a gas fraction of  gas ≡  gas,disc /( ★,disc +  gas,disc ).We also assume that the fraction of the total angular momentum in the disc is  d .We include a gaseous halo with a mass of  HG  200 .It follows a density profile of the same shape as the dark matter density profile, and the temperature of the halo gas is calculated assuming hydrostatic equilibrium.We initialise the gaseous halo with a spin parameter identical to the dark matter spin parameter (𝜆 in  For the galaxy itself, we initialise a magnetic field following the profile, Here  0 = 50 µG is the central magnetic field, and  min = 2.40×10 −8 µG is a small floor value of the magnetic field at large distances.The term 10 −12  200 is added to avoid division by zero in the galaxy centre.This field is divergence free by construction.We initialise the gas in the disc as having solar metallicity and solar abundances.The gas in the halo has a metallicity of 1/3 solar.

The simulations: varying the resolution and the wind's inclination
Our simulations are summarised in Table 2.For our standard resolution level, we use a baryonic mass resolution of  bar = 3.16×10 5 M ⊙ .At this resolution we perform simulations, where the galaxy experiences the wind at an inclination of  = 90 • (edge on), 60 • , 30 • and 0 • (face on).We name these simulations 90deg-Bturb, 60deg-Bturb, 30deg-Bturb and 0deg-Bturb, respectively, where the postfix Bturb indicates that we use a turbulent magnetic field in the ICM wind as described in Sect.2.2.2.When creating the initial conditions for the galaxy (Sect.2.3) we obtain a disc with the angular momentum pointing in the ẑdirection.To change the inclination by 30, 60 or 90 degrees relative to the wind (pointing in the ŷ-direction), we rotate the galaxy around the  ′ -axis, and hence obtain a disc rotation axis pointing along R  ′ (30 Here R  ′ is the rotation matrix describing a rotation around the  ′ -axis, We also appropriately rotate the galaxy magnetic field (described in Eqs.5-7).
To test the role of the magnetic field orientation of the ICM wind, we perform a single simulation (60deg-Bx) with a uniform wind magnetic field aligned with the -axis.We also perform a simulation with MHD completely disabled (60deg-NoB); i.e. a pure hydrodynamical simulation.Furthermore, we perform a single simulation at a 8 times higher mass resolution with a target mass of 3.95 × 10 4 M ⊙ , which we regard as our flagship simulation.We show the effect of varying the inclination of the galaxy relative to the wind.Gas is more efficiently removed during the simulated cluster core passage as well as for (nearly) face-on disc geometries.This is reflected both by the SFR and  gas after 3-4 Gyr.Right panels: We vary the magnetic field configuration (i.e., we adopt a turbulent vs. a homogeneous field vs. no magnetic field) and show results from our higher resolution simulation.The magnetic field better protects the gas from stripping and delays the process while the higher-resolution simulation can hold on to its gas for much longer.

Galaxy simulation physics
The physical processes in our simulations rely on the galaxy formation model from the Auriga simulations (Grand et al. 2017) with the main differences being that our simulations are not cosmological, and do not include black holes or AGN feedback.
We use ideal MHD and use the implementation described in Pakmor et al. ( 2011) and Pakmor & Springel (2013).We model the ISM using the model of Springel & Hernquist (2003), where gas with a density above the star formation threshold density,  sf = 0.157 cm −3 , is described by an effective equation of state that is derived from a multiphase ISM, which has a contribution from a 10 3 K cold phase and a hot phase.The physical processes governing these phases are formation of stars (stellar population particles) from the cold phase, evaporation of the cold gas by type II supernovae and radiative cooling of the hot phase.
Our modelling of stellar winds is slightly different than in the Auriga simulations, where the wind velocity is calculated based on the local dark matter velocity dispersion.Instead, we set the mass loading factor to a value of  = 2 and assume energy-driven winds following equation ( 6) in Puchwein & Springel (2013).We obtain a wind velocity of 1003 km s −1 .We note, that a constant value of  (and hence also the wind velocity) would cause too strong outflows in low-mass galaxies in a simulation of a representative cosmic volume with a complete population of galaxies with different masses.By contrast, in our paper we focus on a single galaxy and are therefore not affected by such scaling problems.
We follow radiative cooling using the UV background from the model in Faucher-Giguère et al. ( 2009) at  = 0.For UV self-shielding we use prescriptions from Rahmati et al. (2013).We use a Chabrier IMF (Chabrier 2003) for all calculations.An overview of how metals are produced in the galaxy and distributed to the gas can be found in Vogelsberger et al. (2013).

Star formation and gas mass
We start out showing how the ram-pressure stripping by the ICM wind affects integral properties of the gas in the galaxy.In Fig. 2, we show the star formation rate (SFR) and the gas mass ( gas ).Both quantities are limited to gas within two times the stellar half mass radius.

Simulations with varying inclination
We start by describing the simulations at our standard resolution with a turbulent magnetic ICM wind i.e., the simulations 90deg-Bturb (edge on), 60deg-Bturb (nearly edge-on), 30deg-Bturb (nearly face-on) and 0deg-Bturb (face on), where we vary the inclination (left panel in the figure).In the initial burn-in phase there is a burst of star formation.Here, the SFR behaves nearly identical in all simulations, implying that ram-pressure stripping is not yet playing any role.Otherwise, we would see an inclination-dependent effect of the stripping.The ICM injection density and velocity is also constructed to be low in the burn-in phase.Instead the burst is caused by the ICs evolving into an equilibrium.We note there are stellar winds associated with this burst, which enriches the gaseous halo.
After ≳ 1.5 Gyr the face-on and the  = 30 • simulations have a slightly lower SFR and gas mass in comparison to the other simulations.This is a signature of ram-pressure stripping, because the cross section area is largest at low inclinations (the cross section area is proportional to cos).Such an inclination-dependence of SFR and gas mass is also seen in the simulations of Lee et al. (2020) and Akerman et al. (2023).
Near (or slightly before) the closest passage of the cluster core, there is an increase in SFR in all simulations.This is consistent with the similar simulations from Zhu et al. (2023).The peak SFR value is largest in the edge-on simulation, because gas is pushed into the centre of the galaxy by the ram pressure.As the inclination decreases (and the galaxies are oriented more face-on) the strength of this burst declines, and the gas mass is also stripped faster.
After the central passage the galaxy gas mass has been lowered by a factor of ≳ 10 (in comparison to the gas mass when the galaxy was at  200 ) for the face-on and 30 • simulations, and their SFRs are similarly suppressed.These galaxies are therefore undergoing quenching, whereas the galaxies with larger inclinations maintain larger SFRs throughout the simulations.Whether a galaxy is quenched of course depends on the quenching definition, which is a somewhat arbitrary choice, but our simulations are certainly consistent with ram-pressure stripping being able to cause quenching.

The orientation of the magnetic ICM wind
We now describe the simulations with different magnetic field configurations, shown in the right panel of Fig. 2. All these simulations have an inclination of 60 • .
The simulation with an initial uniform magnetic field that is perpendicular to the wind velocity shows a SFR and gas mass very similar to that in the corresponding simulation with a turbulent magnetic wind (simulation 60deg-Bx and 60deg-Bturb, respectively).The magnetic field configuration does therefore not strongly influence these integral measures of the galaxy, but as we will see in Sect.3.3, it will change the magnetic structure of the tail of the galaxy.
The simulation without a magnetic field also has a similar evolution as the fiducial simulation (60deg-NoB and 60deg-Bturb, respectively).The most visible differences are that the strength of the starburst is slightly weaker for the simulation without MHD at the time of the closest passage, and the final gas mass is also lower without magnetic fields.

Spatial resolution
The high resolution simulation shows a higher SFR in comparison to the same simulation with our standard resolution (60deg-Bturb-HR and 60deg-Bturb, respectively).This is a well-known result of our subgrid ISM model, which tends to under-estimate the SFR if the gradients within the disc are not well-resolved.This is also seen in the Auriga simulations (Grand et al. 2017, see their fig.23) and in the merger simulations of Sparre & Springel (2016).We note, that the evolution of the SFR are qualitatively similar for these two simulations, and only the actual normalisation is different.

Gas maps
In Fig. 3, we show gas maps visualising our high-resolution simulation, 60deg-Bturb-HR.We show the projected H i column density, the H i weighted mean of the   and   velocity, and the magnetic field components.We calculate the H i content of each gas cell following the tables used in Hani et al. (2018), which are based on CLOUDY (Ferland et al. 1998(Ferland et al. , 2017) ) and take into account selfshielding, collisional excitation and a radiation field from the UV background (Faucher-Giguère et al. 2009).We define star-forming gas cells to have a temperature of 10 4 K, so they contribute to the neutral phase.For a full description see Hani et al. (2018).
We project the magnetic field along the -axis by calculating, where  = ,  or  and for the weighting function, , we use a Gaussian with a mean of log(/K) = 4.5 and a standard deviation of 0.5 dex.With this definition, we obtain a projected map of the magnetic field that is anchored in gas with a temperature of 10 4.5±0.5 K.This choice is made to select a similar gas reservoir as traced by H i (we shy away from directly calculating the H i averaged magnetic field, which cannot be measured observationally, and instead we use the before-mentioned log-normal selection).The line-of-sight-integral is calculated numerically by discretising it into points separated by 0.25 kpc.

HI column density
All the snapshots shown have remarkable H i tails, which identifies this galaxy as a jellyfish galaxy.The tail's H i column density peaks at a value of ∼ 10 20 cm −2 , which is also seen in observed jellyfish galaxies (Ramatsoku et al. 2019(Ramatsoku et al. , 2020)).Visually, the H i tail appears clumpy and fragmented, which could be an indication of shattering as a result of thermal instability -we study this further in Sect.3.4.The existence of a dense tail reaching far downstream shows that the clouds constituting the tail are not destroyed by hydrodynamical instabilities.

Kinematics
At the times prior to the nearest passage (at  ≤ 2.85 Gyr), the   and   velocity components reveal a dipole distribution, where the rotation pattern of the disc is reflected in the tail.The dipole pattern in   implies that a part of the stripped gas undergoes a fountain flow, where it is re-accreted back to the disc.Such a fallback indicating a fountain flow has been observed for the molecular gas in a rampressure-stripped galaxy (Cramer et al. 2021).The finding that the tail's gas also has memory of   is a result of angular momentum conservation.
At the time of the nearest passage in the galaxy cluster, the   velocity pattern changes, and the fountain flow is no longer visible.Instead, stripping is very efficient.At the same time, gas within the disc is compressed (gas slightly upstream is pushed towards the centre) and at the same time producing a ram-pressure induced starburst (as seen in Fig. 2).
A fountain flow with a   -value corresponding to the rotation pattern of the galaxy is seen in all simulations at some point, except for the situation where the wind hits the galaxy face on.For this simulation we show the H i column density and kinematical features in Fig. 4. The rotation of the galaxy gives zero contribution to the  component, so there is no rotation signal to be extended downstream.On the other hand, the   -component in the tail clearly connects to the rotation pattern of the galaxy.
A necessity for the fountain flow, which we identified in Fig. 3, to exist is a misalignment of the (unsigned) angular momentum vector of the disc with the wind direction.

Magnetic field
We expect the magnetic field in the tail to be influenced by the behaviour of ICM wind as well as the gas stripped from the galaxy itself as the downstream tail consists of a mix of these two gas reservoirs (Franchetto et al. 2021;Lee et al. 2022).Our intuition is here guided by idealised simulations of a wind interacting with a cloud showing that magnetic draping of the ICM over a projectile or over a galaxy (Dursi & Pfrommer 2008;Pfrommer & Dursi 2010) and stripped gas from the cloud both contribute to the magnetic field in the tail (Sparre et al. 2020).
Based on the maps in Fig. 3, we see that while ram-pressure stripping and cooling processes downstream the galaxy cause the magnetic field to be aligned with the tail, we see a   -component dominating over   and   in the immediate tail especially for the panels at  ≥ 2.70 Gyr.Below we further quantify this result.

The alignment of the tail's magnetic field
We now examine whether the magnetic field is aligned with the tail, by studying the ratio,  2  / 2 , which is 1/3 for an isotropic magnetic field distribution.If  2  >  2 /3, we regard the magnetic field as being aligned with the tail (which is oriented along the -direction).
We compute the volume averaged values, ⟨ 2  ⟩ and ⟨ 2 ⟩, in linearly distributed bins in the -direction.We use a weighting function,  (log/K), selecting gas with 10 5.5±0.25 K.This temperature range is selected to be close to the geometric mean of the wind and ISM temperature (inspired by the mixing temperature from Gronke & Oh 2018).We note that in Sect.3.2, we aimed at selecting gas at temperatures characteristic of H i gas.Hence, with this different temperature selection we are studying slightly different magnetic field morphologies that are anchored in a different gas reservoir.We show in Appendix A that this temperature selection only affects details of the magnetic morphology indicating that the magnetic field is somewhat smoother for higher temperatures and shows a smaller standard deviation.Hence, this renders our main findings robust and independent on the specific temperature selection.
We plot ⟨ 2  ⟩/⟨ 2 ⟩ in Fig. 5 for all our simulations.We show an early time, 2.0 Gyr, when the galaxy is outside  200 , and the time of the closest passage, 3.0 Gyr.We see a complicated behaviour of ⟨ 2  ⟩/⟨ 2 ⟩ in all panels.When the galaxy is outside  200 at  = 2.0 Gyr the lowest inclination simulations (0deg-Bturb) has a lower ⟨ 2  ⟩/⟨ 2 ⟩-value in the immediate tail of the galaxy ( −  galaxy ≲ 30 kpc) in comparison to the highest inclination simulation (90deg-Bturb).This is because the initial magnetic of the disc in For gas with a temperature of 10 5.5±0.25 K we measure whether the magnetic field is aligned with the jellyfish galaxy's tail (which is oriented along the -direction).We call the field aligned if ⟨  2  ⟩/⟨ 2 ⟩ > 1/3.At 2.0 Gyr, which is prior to entering  200 , we see that ⟨ 2  ⟩/⟨ 2 ⟩ is close to the isotropic value (1/3).At the time of the closest passage to the cluster centre we frequently see an enhanced value of ⟨ 2  ⟩/⟨ 2 ⟩, which implies that the magnetic field aligns with the tail.
the former case has   = 0 and in the latter case there is a non-zero component following Eq.( 6).Further downstream the interaction between the wind and the galaxy is increasingly complicated, and it is not possible to do a simple interpretation of the ⟨ 2  ⟩/⟨ 2 ⟩ ratios.We therefore simply address our main objective, which is to find out whether the interaction between ICM wind and the galaxy typically causes an aligned magnetic tail.
In simulation 90deg-Bturb, where the wind hits the galaxy in an edge-on projection, 2  ⟩/⟨ 2 ⟩ fluctuates around 1/3 before the galaxy enters  200 .At the closest passage ⟨ 2  ⟩/⟨ 2 ⟩ is significantly boosted in the tail, implying that the magnetic field is aligned with the tail.
For all our simulations, we see the same trend; at the closest passage a large fraction of the tail has a ⟨ 2  ⟩/⟨ 2 ⟩ value being (i) larger than the isotropic value, and (ii) larger in comparison to when the galaxy was outside the cluster.This agrees well with the observations of the aligned magnetic tail observed in Müller et al. (2021) and is also seen in our simulations of a cold cloud being crushed by a hot wind (Sparre et al. 2020).
The simulation where these trends are is the one with an initially uniform magnetic field oriented perpendicular to the wind velocity (60deg-Bx).The uniform magnetic field in the wind makes the tail particularly ordered and aligned.
In Appendix A we carry out additional detailed analysis, and show that this result is qualitatively unchanged for different temperature weighting functions.We specifically show plots with choices of  selecting 10 4.5±0.25 , 10 5.5±0.25 and 10 6.5±0.25 K gas.We also show more snapshot times to demonstrate how the ratio behaves during the infall into the cluster.In most cases the magnetic field is well aligned with the tail, and the only notable exception is for the edge-on galaxy, where we only see an aligned magnetic field at or after the central passage.

Shattering in the tail
We now proceed to study cooling-induced shattering, which is expected to make the dense gas in the tail fragment either to a physical scale given by the cooling length (McCourt et al. 2018;Sparre et al. 2020) or to the spatial resolution limit of the simulation (if the cooling length is not well-resolved).
In Fig. 6 we study the shattering in the tail at a time of 2.50 Gyr.This time is chosen because the tail is very well visible, which can also be seen in Fig. 3.We compare our normal resolution simulation (60deg-Bturb) to the corresponding high resolution version (60deg-Bturb-HR).The H i column density projection reveals a rich structure of clumps in the tail of both simulations, but there seems to be more and smaller clumps in the high-resolution simulation.
To quantify the fragmentation we identify friends-of-friend (FoF) groups in the tail.We use a simple python implementation of a FoF finder algorithm, but for more information about FoF algorithms we refer to Davis et al. (1985) and Springel et al. (2001).We identify FoF groups with a density of (H i) ≥  FoF = 0.01 cm −3 .We hence set the FoF linking length to  FoF ≡ (2 bar  H /[ p  FoF ]) 1/3 , where  H = 0.76 is the universal Hydrogen mass fraction, 2 bar is the largest mass allowed by our refinement criterion, and  p is the proton rest mass.Since our main aim is to characterise the tail, we only allow cells with being at least 40 kpc downstream from the galaxy ( >  galaxy + 40 kpc) to be included in a FoF group.We furthermore require a FoF group to contain at least 10 cells.
In both simulations we see H i clumps hundreds of kpc downstream from the galaxy.At high resolution we notice the existence of clumps  with lower masses in comparison to the normal resolution simulation.In the lower panels we overplot a dashed line showing the smallest possible H i mass (10 H  bar ) of a FoF group consisting of 10 gas cell according to our refinement criterion.We see that the lowest mass FoF group is just above this threshold for each simulation, so the gas clumps are fragmenting to the grid-scale in both simulations.
In case of perfect numerical convergence, we would identify the same number of FoF groups in the two simulations (barring Poisson noise) and the same amount of gas mass locked up in cold clumps.We do, however, see many more groups in our high-resolution simulation in comparison to the normal resolution simulation (533 ver-sus 126).This confirms the visual impression that there are more small-scale clumps in the high resolution simulation.This could be a consequence of stripped ISM gas having more resolved structure already before the gas moves into the tail.Alternatively, it could be a consequence of shattering and thermal instability in the tail.
In a follow-up paper (Sparre, Pfrommer, Puchwein in prep.)we trace gas flows in our simulations, and find that the majority (> 60 per cent in 60deg-Bturb-HR) of FoF groups downstream from the galaxy at this snapshot has never been cold within the ISM during the simulation, implying that ISM stripping is not the dominant channel for FoF group formation.Instead shattering and thermal instability is expected to play a larger role.
We quantify the H i mass in the tail by summing up the total amount of H i in our FoF groups.The result is listed in Fig. 6.At the time of our selected snapshot the tail of the high-resolution simulation has a 0.18 dex lower mass in comparison to our normal-resolution simulation.This is consistent with more gas remaining in the disc in the highresolution simulation during the galaxy-ICM interaction, which we saw in Fig. 2.This characteristic is also seen at  = 2.0, 2.25 and 2.5 Gyr, which are during the infall into the cluster, where our highresolution simulation has a H i tail with a mass being lower by 0.14, 0.10 and 0.18, in comparison to the normal-resolution simulation, respectively.This difference in tail mass is thus not a temporary feature, but instead a characteristic of the resolution dependence of the simulations.At  = 3.0 -the time of the nearest cluster passage -this trend reverses and we see a 0.10 dex higher H i mass in the high-resolution simulation.

DISCUSSION -JELLYFISH TAILS AS PHYSICS LABORATORIES
4.1 A feedback loop in the tail?Müller et al. (2021) found observational evidence for an aligned magnetic tail in a jellyfish galaxy, and speculated that a feedback loop could exist between (i) an aligned magnetic field driving gas into star-forming clouds, and (ii) star-forming clouds increasing magnetic turbulence around them and hence slowing down gas accretion.This feedback-cycle was named the draping scenario.
Our finding that the magnetic field orientation aligns with the jellyfish tail for a range of different simulations with different inclinations supports the overall initial assumptions of this scenario.It furthermore suggests that many more jellyfish galaxies should have a magnetic field aligned with the tail.
What we cannot address in our simulations is to what extent starformation in the tail is supported by the aligned magnetic field or, alternatively, suppressed by magnetic turbulence injected by recently formed stars.This is because our ISM and star-formation model (Springel & Hernquist 2003) uses a subgrid prescription for the interaction between cold star-forming clouds and their hot volume-filling surroundings, instead of explicitly resolving them.A consequence is that the impact of large-scale magnetic fields on star-forming regions is not well captured by the model.A next step in addressing the draping scenario would be to run our simulation's initial conditions with a resolved ISM model (e.g., Marinacci et al. 2019;Smith et al. 2021;Hopkins et al. 2023).

Multi-wavelength mock observations
In addition to completing new simulations with an explicit ISM model, there are several other science questions, which could be addressed in future work.For example, producing realistic multifrequency observables such as Hα emission, X-ray emission (using tools from e.g., Biffi et al. 2012Biffi et al. , 2013) ) and radio synchrotron emission (as detected for jellyfish galaxies by e.g.Roberts et al. 2023;Ignesti et al. 2023) produced by realistic cosmic ray electron spectra (Winner et al. 2019(Winner et al. , 2020;;Werhahn et al. 2021a,b;Ogrodnik et al. 2021;Böss et al. 2023).Realistic mock observations would, for example, demonstrate whether and how the shattering processes in the tail can be observed.
Simulations with a physical treatment of molecular gas would also be useful for unveiling the nature of multiphase gas below 10 4 K. Molecular processes have been explored in cloud-crushing simulations (Girichidis et al. 2021;Farber & Gronke 2022), but less in jellyfish galaxy simulations.

CONCLUSION
We have presented windtunnel simulations of a jellyfish galaxy interacting with the ICM of a galaxy cluster.We have used a timedependent, turbulent magnetic ICM wind, which enables us to quantify how the magnetic field in the tail behaves.Our main conclusions are the following: • The interaction between the ICM wind and the galaxy causes a starburst at the time of the nearest cluster passage.A galaxy that is hit edge-on by the wind has a stronger starburst in comparison to a galaxy in a face-on orientation.The reason is that gas is funnelled towards the centre and compressed for the edge-on galaxy.We varied the disc orientation and found the SFR peak is gradually increasing for a 0 • (face on), 30 • ,60 • and 90 • (edge on) inclination of the galaxy.
• The gas stripping rate, especially at the time of the nearest passage, is gradually decreasing for the simulations with 0 • (face on), 30 • , 60 • and 90 • (edge on), because of the higher cross section for a face-on galaxy in comparison to an edge-on galaxy.
• The H i gas in the tail of the galaxy exhibits a fountain flow, where the projected   velocity component ( is the tail direction) traces the rotation pattern of the galaxy itself.A fraction of gas in the tail is re-accreted back to the galaxy.In all our simulations, except for the case where the wind hits the galaxy face-on, such fountain flows are existing in the initial stages of the galaxy-ICM interaction after the galaxy has entered  200 , and before the nearest cluster passage.In the face-on case a fountain flow does not arise, because the rotation pattern of the galaxy has zero contribution in the direction of the tail.
• At the time of the nearest cluster passage ram pressure stripping is so strong, so that   is dominated by stripping and the fountain flow ceases to exist.
• Independent of whether fountain flows or gas stripping signatures are present in the tail our statistical analysis reveals a magnetic field aligned with the tail.This is consistent with radio observations of the jellyfish galaxy JO 206 (Müller et al. 2021) and in line with earlier simulation results of a cold cloud interacting with a wind (Sparre et al. 2020).
• By comparing simulations with mass resolutions different by a factor of eight, we find that the gas clumps in the jellyfish tail are not resolved at our normal resolution level.Using an FoF analysis, we confirm the visual impression of the high-resolution simulation exhibiting a richer structure in comparison to the normal-resolution simulation.This can be the result of shattering and/or ram-pressure stripping of a structured ISM.This realistic simulation setup of a jellyfish galaxy has an enormous potential for serving as a laboratory to understand the star formation process in these extremely hostile environments of jellyfish tails that are exposed to a fast and hot wind.In the future, we plan on extending this setup by moving towards a multiphase ISM and by modelling the non-thermal cosmic ray electron and proton populations. .The orientation of the magnetic field, which we also studied in Fig. 5.Here we show four different times and probe a wider range of temperatures; 10 4.5±0.25 , 10 5.5±0.25 and 10 6.5±0.25 K.
Figure 1.In our simulations the jellyfish galaxy experiences a time-dependent wind, which mimics the changing ICM properties along its orbit inside the galaxy cluster.The black-dotted line shows the wind in the lower part of the simulation box, where the wind is injected, and the black-solid line shows the wind at the location of the galaxy taking into account the time it takes for the wind to move from the lower part of the box to the galaxy centre.In the first Gyr, the wind has not yet reached the galaxy, so the galaxy can settle into an equilibrium before ram-pressure stripping becomes important.We refer to this as the burn-in phase.At a time of 2.2 Gyr, the galaxy enters  200 and we switch to the wind profile of our galaxy cluster model (fromSteinhauser et al. 2016), with the nearest passage of the cluster core at 3.0 Gyr.The amplitude of the magnetic field is chosen such that we obtain  ≡  th /  = 50 for the wind.

Figure 2 .
Figure2.Star formation rate (SFR, upper panels) and gas mass (lower panels) measured within twice the stellar half mass radius.Left panels: We show the effect of varying the inclination of the galaxy relative to the wind.Gas is more efficiently removed during the simulated cluster core passage as well as for (nearly) face-on disc geometries.This is reflected both by the SFR and  gas after 3-4 Gyr.Right panels: We vary the magnetic field configuration (i.e., we adopt a turbulent vs. a homogeneous field vs. no magnetic field) and show results from our higher resolution simulation.The magnetic field better protects the gas from stripping and delays the process while the higher-resolution simulation can hold on to its gas for much longer.

Figure 3 .
Figure 3. Projection maps of the high-resolution simulation, 60deg-Bturb-HR.Before the nearest cluster core passage (at  ≤ 2.85 Gyr) there is a dipole structure in the tail of   and   .At the nearest passage (at  = 3.0 Gyr), where the strongest ram-pressure is experienced, stripping is very violent and the central parts of the galaxy are affected.Here   in the tail no longer has a dipole structure and instead shows clear signatures of ISM stripping.The magnetic field component along the tail (  ) is larger in comparison to the perpendicular directions (  and   ).

Figure 4 .
Figure 4. H i column density and velocity components similar to Fig.3, but for the simulation where the hits the galaxy in a face-on projection (0deg-Bturb).For the   -component there is no sign of a fountain flow connected to the rotation flow of the galaxy, as we saw for 60deg-Bturb-HR in Fig.3.

Figure 6 .
Figure6.Upper panels: At  = 2.50 Gyr, which is before the central passage, we show H i projection maps of the normal and high-resolution simulation with an inclination of 60 degrees (left and right, respectively).Lower panels: we identify H i clumps using a FoF algorithm.We plot the FoF mass as a function of the -coordinate (the downstream distance from the galaxy centre).The dashed lines show the smallest possible H i FoF mass, 10  H  bar , i.e., each FOF group contains at least 10 gas cells.The high-resolution simulation contains more and less massive clumps showing that the clump size is limited by the resolution.It suggests that an unresolved thermal instability, shattering, occurs in the tail.
Figure A1.The orientation of the magnetic field, which we also studied in Fig.5.Here we show four different times and probe a wider range of temperatures; 10 4.5±0.25 , 10 5.5±0.25 and 10 6.5±0.25 K.

Table 1 )
. For the ICs we have chosen a total baryon fraction ( HG +  d ) = 0.158, which agrees with constraints from the Planck 2015 results (Planck Collaboration et al. 2016; we use the implementation of the Planck15 cosmology in the Astropy Collaboration et al. 2022 python package).We neither initialise a bulge nor a black hole.