From b42cea7321f6d5d1464a5445cb8f3fe3a9ee2995 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 31 Dec 2017 17:13:49 +0800 Subject: clusters/halo: Add back "mach_turbulence" attribute --- fg21sim/extragalactic/clusters/halo.py | 17 ++++++++++++++--- fg21sim/extragalactic/clusters/main.py | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'fg21sim/extragalactic') diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index 6605763..6b5a683 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -209,6 +209,15 @@ class RadioHalo: return helper.time_turbulence(self.M_main, self.M_sub, z=self.z_merger, configs=self.configs) + @property + def mach_turbulence(self): + """ + The turbulence Mach number determined from its velocity dispersion. + """ + cs = helper.speed_sound(self.kT_main) # [km/s] + v_turb = self._velocity_turb() # [km/s] + return v_turb / cs + @property def radius_virial_obs(self): """ @@ -342,7 +351,7 @@ class RadioHalo: R_vir = helper.radius_virial(mass=self.M_main, z=self.z_merger) L = self.f_lturb * R_vir # [kpc] cs = helper.speed_sound(self.kT_main) # [km/s] - v_turb = self._velocity_turb(t=self.age_merger) # [km/s] + v_turb = self._velocity_turb() # [km/s] tau = (self.x_cr * cs**3 * L / (16*np.pi * self.zeta_ins * v_turb**4)) # [s kpc/km] tau *= AUC.s2Gyr * AUC.kpc2km # [Gyr] @@ -805,7 +814,7 @@ class RadioHalo: mass = rate * (t - t_merger) + self.M_main return mass - def _velocity_turb(self, t): + def _velocity_turb(self, t=None): """ Calculate the turbulence velocity dispersion (i.e., turbulence Mach number). @@ -834,8 +843,10 @@ class RadioHalo: The turbulence velocity dispersion Unit: [km/s] """ - mass = self.M_main + self.M_sub + if t is None: + t = self.age_merger z = COSMO.redshift(t) + mass = self.M_main + self.M_sub R_vir = helper.radius_virial(mass=mass, z=z) * AUC.kpc2cm # [cm] v2 = np.sqrt(AC.G * self.M_sub*AUC.Msun2g / R_vir) # [cm/s] v2 *= AUC.cm2km # [km/s] diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index c441977..57811af 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -293,7 +293,7 @@ class GalaxyClusters: ("Rhalo", halo.radius), # [kpc] ("Rhalo_angular", halo.angular_radius), # [arcsec] ("volume", halo.volume), # [kpc^3] - ("Mach_turb", halo.Mach_turbulence), # turbulence Mach number + ("Mach_turb", halo.mach_turbulence), # turbulence Mach number ("tau_acc", halo.tau_acceleration), # [Gyr] ("Ke", halo.injection_rate), # [cm^-3 Gyr^-1] ("gamma", halo.gamma), # Lorentz factors -- cgit v1.2.2