From 0a3555701177f7cb6e802317ba67516d5d865fd5 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 21 Jul 2017 23:52:24 +0800 Subject: clusters/main.py: Add "_magnetic_field()" method Also update the configurations Signed-off-by: Aaron LI --- fg21sim/configs/20-extragalactic.conf.spec | 15 +++++++------- fg21sim/extragalactic/clusters/main.py | 33 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/fg21sim/configs/20-extragalactic.conf.spec b/fg21sim/configs/20-extragalactic.conf.spec index 0f797a8..b8af33b 100644 --- a/fg21sim/configs/20-extragalactic.conf.spec +++ b/fg21sim/configs/20-extragalactic.conf.spec @@ -43,6 +43,13 @@ # The fraction that a cluster hosts a radio halo halo_fraction = float(default=None, min=0.0, max=1.0) + # Magnetic field scaling relation for clusters + # Reference: Cassano et al. 2012, A&A, 548, A100, Eq.(1) + # + # The mean magnetic field assumed + 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) # Resolution for simulating each cluster templates, which are finally # mapped to the all-sky HEALPix map if used. @@ -73,14 +80,6 @@ # XXX: currently only support a constant radius of halos radius = float(default=500.0, min=100.0) - # Magnetic field scaling relation for clusters - # Reference: Cassano et al. 2012, A&A, 548, A100, Eq.(1) - # - # The mean magnetic field assumed - 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) - # Fraction of the turbulence energy in the form of magneto-sonic waves. eta_t = float(default=0.3, min=0.0, max=1.0) diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index b7c2d03..b6c1022 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -9,6 +9,12 @@ NOTE ---- There are other types of extended radio emissions not considered yet, e.g., mini-halos, roundish radio relics, etc. + +References +---------- +.. [cassano2012] + Cassano et al. 2012, A&A, 548, A100 + http://adsabs.harvard.edu/abs/2012A%26A...548A.100C """ import logging @@ -57,6 +63,8 @@ class GalaxyClusters: self.merger_mass_min = self.configs.getn(comp+"/merger_mass_min") self.ratio_major = self.configs.getn(comp+"/ratio_major") self.tau_merger = self.configs.getn(comp+"/tau_merger") + self.b_mean = self.configs.getn(comp+"/b_mean") + self.b_index = self.configs.getn(comp+"/b_index") self.filename_pattern = self.configs.getn("output/filename_pattern") self.use_float = self.configs.getn("output/use_float") @@ -204,6 +212,31 @@ class GalaxyClusters: logger.info("%d (%.1f%%) clusters have recent major mergers." % (num_major, 100*num_major/num)) + def _magnetic_field(self, 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) + """ + M_mean = 1.6e15 # [Msun] + B = self.b_mean * (mass/M_mean) ** self.b_index + return B + def preprocess(self): """ Perform the preparation procedures for the later simulations. -- cgit v1.2.2