180 lines
5.9 KiB
Python
180 lines
5.9 KiB
Python
#!/bin/python3
|
|
import numpy as np
|
|
import os
|
|
import sys
|
|
from astropy import units as u
|
|
from astropy import constants as const
|
|
import matplotlib
|
|
import matplotlib.pyplot as plt
|
|
|
|
# Specific includes
|
|
# =======================
|
|
|
|
homebase = os.getenv('HOMEBASE')
|
|
if homebase == None:
|
|
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
|
|
|
|
includes = homebase + "/src/grpic/boundaries_3d"
|
|
|
|
sys.path.append(includes)
|
|
|
|
import precalculation.functions.plasmaFunctions as plasmaFuncs
|
|
import analysis.plotDataFromAcronym.plot_standards as pltStd
|
|
|
|
# Input
|
|
# =======================
|
|
|
|
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
|
|
output_folder = thesis_path+"/fig/Chapter3_Classification/LengthScales/"
|
|
|
|
density_min = 1E0
|
|
density_max = 1E8
|
|
|
|
density_min_log = 0
|
|
density_max_log = 8
|
|
|
|
B_total = 2.5*u.T
|
|
|
|
temp1 = 30*u.K
|
|
temp2 = 80*u.K
|
|
|
|
density_neutrals_center = 6.337599E14/u.cm**3
|
|
density_neutrals_rw = 1E12/u.cm**3
|
|
|
|
length_wgts = 1000
|
|
diameter_wgts = 9
|
|
|
|
cross_section_total_H3_ion = 5.9E-14*u.cm**2
|
|
cross_section_total_electron = 6.4E-16*u.cm**2
|
|
|
|
cross_section_recombination = 1E-13*u.cm**2
|
|
|
|
cross_section_ternary_H3 = 3.8E-19*u.cm**2
|
|
cross_section_ternary_H = 2.4E-19*u.cm**2
|
|
|
|
mass_Hion = 3*const.m_p
|
|
mass_H2ion = 2*mass_Hion
|
|
mass_H3ion = 3*mass_Hion
|
|
|
|
|
|
# Calculation
|
|
# =======================
|
|
num_points = 1000
|
|
|
|
densities = np.logspace(density_min_log,density_max_log,num_points)
|
|
debyle_length1 = np.zeros_like(densities)
|
|
debyle_length2 = np.zeros_like(densities)
|
|
|
|
gyro_radius_electrons = plasmaFuncs.gyroRadiusElectron(B_total, temp2).value
|
|
gyro_radius_ions = plasmaFuncs.gyroRadiusIon(B_total, temp2, mass=mass_H3ion ).value
|
|
|
|
inertial_length_electron = plasmaFuncs.electronInertialLength(densities/u.cm**3)
|
|
mean_distance_electrons = plasmaFuncs.meanDistance(densities/u.cm**3)
|
|
|
|
|
|
mfp_electronic_interaction = plasmaFuncs.meanFreePathElectronicInteraction(densities/u.cm**3, temp2)
|
|
mfp_electrons_neutrals_center = plasmaFuncs.meanFreePath(density_neutrals_center, cross_section_total_electron).value
|
|
mfp_electrons_neutrals_rw = plasmaFuncs.meanFreePath(density_neutrals_rw, cross_section_total_electron).value
|
|
|
|
mfp_H3ions_neutrals_center = plasmaFuncs.meanFreePath(density_neutrals_center, cross_section_total_H3_ion).value
|
|
mfp_H3ions_neutrals_rw = plasmaFuncs.meanFreePath(density_neutrals_rw, cross_section_total_H3_ion).value
|
|
|
|
|
|
landau_length = plasmaFuncs.landauLength(temp2*u.K).value
|
|
|
|
debyle_length1 = plasmaFuncs.debyeLength(densities/u.cm**3, temp1).value
|
|
debyle_length2 = plasmaFuncs.debyeLength(densities/u.cm**3, temp2).value
|
|
|
|
# Plot
|
|
# =======================
|
|
|
|
pltStd.setRcParams()
|
|
prop_cycle = plt.rcParams['axes.prop_cycle']
|
|
colors = prop_cycle.by_key()['color']
|
|
|
|
(width, height) = pltStd.set_size('thesis')
|
|
fig, ax = plt.subplots(1, 1, figsize=(width, height*2.3))
|
|
|
|
ax.plot(densities, debyle_length2, '-', label=r'$\lambda_D$',color=colors[0])
|
|
ax.plot(densities, inertial_length_electron, '-.', color=colors[1],label=r'$l_{skin}$')
|
|
ax.plot(densities, mfp_electronic_interaction, '--', label=r'$\lambda_{ee}$', color=colors[2])
|
|
ax.plot(densities, mean_distance_electrons, ':', label=r'$a$', color=colors[3])
|
|
|
|
ax.hlines(gyro_radius_electrons, density_min, density_max, linestyles=':',color='k')
|
|
ax.hlines(gyro_radius_ions, density_min, density_max, linestyles=':',color='k')
|
|
ax.hlines(landau_length, density_min, density_max, linestyles=':',color='k')
|
|
ax.hlines(mfp_electrons_neutrals_center, density_min, density_max, linestyles=':',color='k')
|
|
ax.hlines(mfp_electrons_neutrals_rw, density_min, density_max, linestyles=':',color='k')
|
|
|
|
ax.hlines(mfp_H3ions_neutrals_center, density_min, density_max, linestyles=':',color='k')
|
|
ax.hlines(mfp_H3ions_neutrals_rw, density_min, density_max, linestyles=':',color='k')
|
|
|
|
|
|
ax.hlines(diameter_wgts, density_min, density_max, linestyles=':',color='grey')
|
|
ax.hlines(length_wgts, density_min, density_max, linestyles=':',color='grey')
|
|
|
|
#ax.text(1.5E4, 4.5, "radius wgts",horizontalalignment='left')
|
|
|
|
|
|
ax.set_yscale("log")
|
|
ax.set_xscale("log")
|
|
|
|
ax.set_xlim((1E3,1E7))
|
|
ax.set_ylim((1E-9,1E4))
|
|
|
|
ax.set_yticks(np.logspace(-9, 3, num=13))
|
|
|
|
|
|
#ax.set_ylim((1E-2,1E4))
|
|
ax.set_ylabel(r'Characteristic length (cm)')
|
|
ax.set_xlabel(r'Electron density $n_e$ (cm$^{-3}$)')
|
|
ax.legend(loc='lower left')
|
|
|
|
ax.set_facecolor('#e7e7e7ff')
|
|
|
|
ax.grid(True, which='major', color='white')
|
|
|
|
|
|
ax2 = ax.twinx()
|
|
|
|
yticks = {
|
|
landau_length: '$l_L$',
|
|
gyro_radius_electrons: '$R_e$',
|
|
gyro_radius_ions: '$R_i$',
|
|
mfp_electrons_neutrals_center: '$\lambda_{e,c}$',
|
|
mfp_electrons_neutrals_rw: '$\lambda_{e,rw}$',
|
|
mfp_H3ions_neutrals_center: '$\lambda_{i,c}$',
|
|
mfp_H3ions_neutrals_rw: '$\lambda_{i,rw}$',
|
|
length_wgts: '$L$',
|
|
diameter_wgts: '$D$'
|
|
}
|
|
|
|
ax2.set_ylim((-9,4))
|
|
ax2.set_yticks(np.log10(list(yticks.keys())))
|
|
ax2.set_yticklabels(yticks.values())
|
|
|
|
|
|
|
|
#plt.savefig(output_folder+"comparison_l.pdf",bbox_inches='tight')
|
|
|
|
plt.show()
|
|
|
|
|
|
print("Debye length(ne=1E3): {}".format(debyle_length2[densities>1E3][0]))
|
|
print("Debye length(ne=1E6): {}".format(debyle_length2[densities>1E6][0]))
|
|
print("Landaul length: {}".format(landau_length))
|
|
|
|
print("Gyro radius e: {}".format(gyro_radius_electrons))
|
|
print("Gyro radius T3: {}".format(gyro_radius_ions))
|
|
|
|
print("mfp e-e, center: {}".format(plasmaFuncs.meanFreePathElectronicInteraction(1E6/u.cm**3, temp2)))
|
|
print("mfp e-e, rearwall: {}".format(plasmaFuncs.meanFreePathElectronicInteraction(1E3/u.cm**3, temp2)))
|
|
|
|
print("mfp e-T2, center: {}".format(plasmaFuncs.meanFreePath(1E15/u.cm**3, cross_section_total_electron).value))
|
|
print("mfp e-T2, rearwall: {}".format(plasmaFuncs.meanFreePath(1E12/u.cm**3, cross_section_total_electron).value))
|
|
|
|
print("mfp T3+-T2, center: {}".format(plasmaFuncs.meanFreePath(1E15/u.cm**3, cross_section_total_H3_ion).value))
|
|
print("mfp T3-T2, rearwall: {}".format(plasmaFuncs.meanFreePath(1E12/u.cm**3, cross_section_total_H3_ion).value))
|
|
|
|
print("Inertial length(ne=1E3): {}".format(inertial_length_electron[densities>1E3][0]))
|
|
print("Inertial length(ne=1E6): {}".format(inertial_length_electron[densities>1E6][0])) |