aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-10-20 10:22:24 +0800
committerAaron LI <aly@aaronly.me>2017-10-20 10:22:24 +0800
commitfd20ab688759f3dfc3f7796ac0b1118e21ee5b22 (patch)
treea75ffd2b7ae280afe65b71e998b0da22c7e7fde1 /fg21sim
parent283ca6c00e5ff6c74b529d0a460115516c16eec7 (diff)
downloadfg21sim-fd20ab688759f3dfc3f7796ac0b1118e21ee5b22.tar.bz2
clusters/halo: Determine magnetic field by fraction of its energy density
* Rewrite "magnetic_field()" function to calculate the mean magnetic field strength within ICM according its energy density fraction w.r.t. the ICM thermal energy density. * Remove config options "b_mean" and "b_index", which are replaced with the option "eta_b", the assumed magnetic energy density fraction w.r.t. the ICM thermal energy density.
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/configs/20-extragalactic.conf.spec12
-rw-r--r--fg21sim/extragalactic/clusters/halo.py4
-rw-r--r--fg21sim/extragalactic/clusters/helper.py54
3 files changed, 30 insertions, 40 deletions
diff --git a/fg21sim/configs/20-extragalactic.conf.spec b/fg21sim/configs/20-extragalactic.conf.spec
index 2c879ac..75ea0ec 100644
--- a/fg21sim/configs/20-extragalactic.conf.spec
+++ b/fg21sim/configs/20-extragalactic.conf.spec
@@ -119,14 +119,10 @@
# Unit: [Gyr]
tau_merger = float(default=2.0, min=1.0, max=5.0)
- # Magnetic field scaling relation for clusters
- # Reference: Cassano et al. 2012, A&A, 548, A100, Eq.(1)
- #
- # The mean magnetic field assumed
- # Unit: [uG]
- b_mean = float(default=1.9, min=0.1, max=10)
- # The index of the scaling relation
- b_index = float(default=1.5, min=0.0, max=3.0)
+ # The fraction of the magnetic field energy density w.r.t. the ICM
+ # thermal energy density, which is used to determine the mean magnetic
+ # field strength within the ICM and is also assumed to be uniform.
+ eta_b = float(default=0.001, min=1e-5, max=0.1)
# Filename prefix for this component
prefix = string(default="cluster")
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py
index e34d91c..e6fe152 100644
--- a/fg21sim/extragalactic/clusters/halo.py
+++ b/fg21sim/extragalactic/clusters/halo.py
@@ -229,7 +229,7 @@ class RadioHalo:
Unit: [uG]
"""
- return helper.magnetic_field(self.M_obs)
+ return helper.magnetic_field(mass=self.M_obs, z=self.z_obs)
@property
def kT_merger(self):
@@ -716,6 +716,6 @@ class RadioHalo:
"""
z = COSMO.redshift(t)
mass = self._mass(t) # [Msun]
- B = helper.magnetic_field(mass) # [uG]
+ B = helper.magnetic_field(mass=mass, z=z) # [uG]
loss = -4.32e-4 * gamma**2 * ((B/3.25)**2 + (1+z)**4)
return loss
diff --git a/fg21sim/extragalactic/clusters/helper.py b/fg21sim/extragalactic/clusters/helper.py
index 6fd99fb..1c6e48e 100644
--- a/fg21sim/extragalactic/clusters/helper.py
+++ b/fg21sim/extragalactic/clusters/helper.py
@@ -210,6 +210,30 @@ def density_energy_thermal(mass, z=0.0):
return e_th
+def magnetic_field(mass, z=0.0):
+ """
+ Calculate the mean magnetic field strength within the ICM, which is
+ also assumed to be uniform, according to the assumed fraction of the
+ the magnetic field energy density w.r.t. the ICM thermal energy density.
+
+ NOTE
+ ----
+ Magnetic field energy density: u_B = B^2 / (8π),
+ where "B" in units of [G], then "u_B" has unit of [erg/cm^3].
+
+ Returns
+ -------
+ B : float
+ The mean magnetic field strength within the ICM.
+ Unit: [uG]
+ """
+ key = "extragalactic/clusters/eta_b"
+ eta_b = CONFIGS.getn(key)
+ e_th = density_energy_thermal(mass=mass, z=z)
+ B = np.sqrt(8*np.pi * eta_b * e_th) * 1e6 # [G] -> [uG]
+ return B
+
+
def density_energy_electron(spectrum, gamma):
"""
Calculate the energy density of relativistic electrons.
@@ -295,36 +319,6 @@ def time_crossing(M_main, M_sub, z=0.0):
return time
-def magnetic_field(mass):
- """
- Calculate the mean magnetic field strength according to the
- scaling relation between magnetic field and cluster mass.
-
- Parameters
- ----------
- mass : float
- Cluster mass
- Unit: [Msun]
-
- Returns
- -------
- B : float
- The mean magnetic field strength
- Unit: [uG]
-
- References
- ----------
- Ref.[cassano2012],Eq.(1)
- """
- comp = "extragalactic/clusters"
- b_mean = CONFIGS.getn(comp+"/b_mean")
- b_index = CONFIGS.getn(comp+"/b_index")
-
- M_mean = 1.6e15 # [Msun]
- B = b_mean * (mass/M_mean) ** b_index
- return B
-
-
def halo_rprofile(re, num_re=5, I0=1.0):
"""
Generate the radial profile of a halo.