Commit ac74dde185bdd46239fcb39eb4a60883deb2d4f0

Authored by Jalabert
1 parent 53761528
Exists in master

addition of the ionization potential associated with the anion

Showing 1 changed file with 13 additions and 11 deletions   Show diff stats
four_levels_model.py
@@ -9,8 +9,7 @@ import radiation_fields as rf @@ -9,8 +9,7 @@ import radiation_fields as rf
9 9
10 ''' 10 '''
11 11
12 -This programme seeks to calculate how a neutral gas subjected to a radiation field  
13 -is heated, involving pahs in the ionization of the gas 12 +This programme computes the photoelectric heating rate and efficiency by PAHs
14 13
15 This program works with the script "radiation_fields.py" 14 This program works with the script "radiation_fields.py"
16 which calculates the scale factor of the radiation field G0 15 which calculates the scale factor of the radiation field G0
@@ -61,7 +60,7 @@ class HeatingGas: @@ -61,7 +60,7 @@ class HeatingGas:
61 60
62 ---------- 61 ----------
63 62
64 - Returns total_gas_heating, heating efficiency, g_0 , gamma , t_gas, n_e , n_c 63 + Returns total_gas_heating, heating_efficiency, g_0 , gamma , t_gas, n_e , n_c
65 64
66 total_gas_heating : float, 65 total_gas_heating : float,
67 gas heating rate in erg s-1 H-1 66 gas heating rate in erg s-1 H-1
@@ -131,6 +130,7 @@ class HeatingGas: @@ -131,6 +130,7 @@ class HeatingGas:
131 self.pah_cross_n = None 130 self.pah_cross_n = None
132 self.pah_cross_c = None 131 self.pah_cross_c = None
133 self.pah_cross_dc = None 132 self.pah_cross_dc = None
  133 + self.ip_negative_charged = None
134 self.ip_neutral = None 134 self.ip_neutral = None
135 self.ip_charged = None 135 self.ip_charged = None
136 self.detachment_yield = None 136 self.detachment_yield = None
@@ -156,6 +156,8 @@ class HeatingGas: @@ -156,6 +156,8 @@ class HeatingGas:
156 #IP to ionize the molecule : neutral to charged, in ev 156 #IP to ionize the molecule : neutral to charged, in ev
157 self.ip_charged = 3.9 + one_in_4_pi_eps_0 * ( ( z_1 + (1/2) ) * (ev**2/a) + ( z_1 + 2 ) * (ev**2/a) *(0.03/a) ) * (1/ev) 157 self.ip_charged = 3.9 + one_in_4_pi_eps_0 * ( ( z_1 + (1/2) ) * (ev**2/a) + ( z_1 + 2 ) * (ev**2/a) *(0.03/a) ) * (1/ev)
158 #IP to ionize the charged molecule : charged 1 to charged 2, in ev 158 #IP to ionize the charged molecule : charged 1 to charged 2, in ev
  159 + self.ip_negative_charged = 6
  160 + #IP to detache the electron from a PAH anion, in ev
159 161
160 '''==========================|building of the cross section|=======================''' 162 '''==========================|building of the cross section|======================='''
161 ''' derives a mean photoabsorption cross section of the molecule considered, in 3 size ranges''' 163 ''' derives a mean photoabsorption cross section of the molecule considered, in 3 size ranges'''
@@ -239,7 +241,7 @@ class HeatingGas: @@ -239,7 +241,7 @@ class HeatingGas:
239 self.pah_cross_dc = self.pah_cross_dc[self.energy_range] 241 self.pah_cross_dc = self.pah_cross_dc[self.energy_range]
240 242
241 ''' yield from anion to neutral ''' 243 ''' yield from anion to neutral '''
242 - part = np.where(self.energy_negative_charged <=13.6)[0] 244 + part = np.where(self.energy_negative_charged<=13.6)[0]
243 245
244 self.detachment_yield = np.full(len(part), 1) 246 self.detachment_yield = np.full(len(part), 1)
245 #the anion being unstable, any energy is enough to detach the electron 247 #the anion being unstable, any energy is enough to detach the electron
@@ -288,10 +290,10 @@ class HeatingGas: @@ -288,10 +290,10 @@ class HeatingGas:
288 290
289 '''===================== dust and gas heating calculation ===================''' 291 '''===================== dust and gas heating calculation ==================='''
290 energy_range_power_absorbed = np.where(self.energy<=13.6)[0] 292 energy_range_power_absorbed = np.where(self.energy<=13.6)[0]
291 - energy_range_anion = np.where(self.energy<=13.6)[0] 293 + energy_range_anion = np.where(np.logical_and(self.energy >= self.ip_negative_charged, self.energy <= 13.6))[0]
292 energy_range_neutral = np.where(np.logical_and(self.energy >= self.ip_neutral, self.energy <= 13.6))[0] 294 energy_range_neutral = np.where(np.logical_and(self.energy >= self.ip_neutral, self.energy <= 13.6))[0]
293 energy_range_charged = np.where(np.logical_and(self.energy >= self.ip_charged, self.energy <= 13.6))[0] 295 energy_range_charged = np.where(np.logical_and(self.energy >= self.ip_charged, self.energy <= 13.6))[0]
294 - 296 +
295 ''' photoabsorption of the neutrals, cations and dications molecules ''' 297 ''' photoabsorption of the neutrals, cations and dications molecules '''
296 photo_absorption_a = self.energy_intensity*pah_crossa*2*np.pi #erg s-1 eV-1 /!\ the 2*np.pi is the solid angle considered => the RF comes from the star only 298 photo_absorption_a = self.energy_intensity*pah_crossa*2*np.pi #erg s-1 eV-1 /!\ the 2*np.pi is the solid angle considered => the RF comes from the star only
297 photo_absorption_n = self.energy_intensity*pah_crossn*2*np.pi #erg s-1 eV-1 299 photo_absorption_n = self.energy_intensity*pah_crossn*2*np.pi #erg s-1 eV-1
@@ -310,7 +312,7 @@ class HeatingGas: @@ -310,7 +312,7 @@ class HeatingGas:
310 #number of ionizations per s per eV for a charge state 312 #number of ionizations per s per eV for a charge state
311 313
312 ''' detachment rate ''' 314 ''' detachment rate '''
313 - kdet = np.trapz(number_ionization_absorption_a[energy_range_anion], self.energy[energy_range_anion]) 315 + kdet = np.trapz(number_ionization_absorption_a[energy_range_anion], (self.energy-self.ip_negative_charged)[energy_range_anion])
314 #in s-1 316 #in s-1
315 317
316 ''' photoemission rate ''' 318 ''' photoemission rate '''
@@ -323,7 +325,7 @@ class HeatingGas: @@ -323,7 +325,7 @@ class HeatingGas:
323 #in s-1 325 #in s-1
324 326
325 ''' recombination rate ''' 327 ''' recombination rate '''
326 - phi = ( 1.85*1e5 )/( self.t_gas*np.sqrt(self.n_c) ) #dimensionless 328 + phi = ( 1.85 * 1e5 )/( self.t_gas*np.sqrt(self.n_c) ) #dimensionless
327 krec_neutral = self.n_e * 1.28e-10 * self.n_c * np.sqrt(self.t_gas) * ( 1 + phi ) 329 krec_neutral = self.n_e * 1.28e-10 * self.n_c * np.sqrt(self.t_gas) * ( 1 + phi )
328 krec_charged = self.n_e * 1.28e-10 * self.n_c * np.sqrt(self.t_gas) * ( 1 + phi * (1 + z_1) ) 330 krec_charged = self.n_e * 1.28e-10 * self.n_c * np.sqrt(self.t_gas) * ( 1 + phi * (1 + z_1) )
329 #in s-1 331 #in s-1
@@ -343,7 +345,7 @@ class HeatingGas: @@ -343,7 +345,7 @@ class HeatingGas:
343 345
344 ''' spectrum of the gas heating per charge state ''' 346 ''' spectrum of the gas heating per charge state '''
345 347
346 - anion_heating_rate_spectrum = 1 * (self.energy-0) *\ 348 + anion_heating_rate_spectrum = 1 * (self.energy-self.ip_negative_charged) *\
347 number_ionization_absorption_a * ev_to_erg #erg s-1 eV-1 349 number_ionization_absorption_a * ev_to_erg #erg s-1 eV-1
348 neutral_heating_rate_spectrum = partition_coeff * (self.energy-self.ip_neutral) *\ 350 neutral_heating_rate_spectrum = partition_coeff * (self.energy-self.ip_neutral) *\
349 number_ionization_absorption_n * ev_to_erg #erg s-1 eV-1 351 number_ionization_absorption_n * ev_to_erg #erg s-1 eV-1
@@ -353,7 +355,7 @@ class HeatingGas: @@ -353,7 +355,7 @@ class HeatingGas:
353 355
354 ''' gas heating rate per charge state ''' 356 ''' gas heating rate per charge state '''
355 anion_gas_heating_rate = np.trapz(anion_heating_rate_spectrum[energy_range_anion],\ 357 anion_gas_heating_rate = np.trapz(anion_heating_rate_spectrum[energy_range_anion],\
356 - self.energy[energy_range_anion] ) #erg s-1 molecule-1 358 + (self.energy-self.ip_negative_charged)[energy_range_anion] ) #erg s-1 molecule-1
357 neutral_gas_heating_rate = np.trapz(neutral_heating_rate_spectrum[energy_range_neutral],\ 359 neutral_gas_heating_rate = np.trapz(neutral_heating_rate_spectrum[energy_range_neutral],\
358 (self.energy-self.ip_neutral)[energy_range_neutral] ) #erg s-1 molecule-1 360 (self.energy-self.ip_neutral)[energy_range_neutral] ) #erg s-1 molecule-1
359 charged_gas_heating_rate = np.trapz(charged_heating_rate_spectrum[energy_range_charged],\ 361 charged_gas_heating_rate = np.trapz(charged_heating_rate_spectrum[energy_range_charged],\
@@ -394,5 +396,5 @@ class HeatingGas: @@ -394,5 +396,5 @@ class HeatingGas:
394 self.total_gas_heating = total_injected_power * (self.fc_pah/self.n_c) * 2.7e-4 396 self.total_gas_heating = total_injected_power * (self.fc_pah/self.n_c) * 2.7e-4
395 #2.7e-4 : elemental abundance of C relative to H (Tielens 2021) 397 #2.7e-4 : elemental abundance of C relative to H (Tielens 2021)
396 #total gas heating in erg s-1 H-1 398 #total gas heating in erg s-1 H-1
397 - 399 +
398 return self.total_gas_heating, self.heating_efficiency, self.g_0 , self.gamma, self.t_gas, self.n_e, self.n_c 400 return self.total_gas_heating, self.heating_efficiency, self.g_0 , self.gamma, self.t_gas, self.n_e, self.n_c
399 \ No newline at end of file 401 \ No newline at end of file