Now n_e is given as the density at the boundary and n_i at the boundary is calculated once Z is known. This aims to eliminate the iterative process.
58 lines
2.1 KiB
Python
58 lines
2.1 KiB
Python
import readPhi
|
|
import readMom
|
|
import readF
|
|
import readZlist
|
|
import matplotlib.pyplot as plt
|
|
import glob
|
|
import numpy as np
|
|
from scipy.constants import e, k
|
|
|
|
# paths = ['../quasiNeutral_fullAblation/','../2024-09-26_11.48.04/']
|
|
# paths = ['../2024-09-26_12.47.11/']
|
|
# paths = ['../quasiNeutral_partialAblation/','../Poisson_partialAblation/']
|
|
# paths = ['../2024-10-02_14.30.44/']
|
|
# paths = ['../quasiNeutral_fullAblation/','../Poisson_fullAblation/']
|
|
paths = ['../2025-04-09_16.45.52/']
|
|
labels = [path[3:-1] for path in paths]
|
|
|
|
for path, label in zip(paths, labels):
|
|
Zlist = readZlist.read(path+'ZList.csv')
|
|
filesPhi = sorted(glob.glob(path+'time_*_phi.csv'))
|
|
start = 80
|
|
end = 85#len(filesPhi)
|
|
every = 1
|
|
fig, ax = plt.subplots(4, sharex='all')
|
|
ax[1].set_yscale('log')
|
|
ax[1].set_ylim(bottom=1e10, top=1e24)
|
|
_, r, _, _, _ = readPhi.read(filesPhi[0])
|
|
for t in range(start,end+1,every):
|
|
sum_Zni = np.zeros(len(r))
|
|
ave_ui = np.zeros(len(r))
|
|
ave_Ti = np.zeros(len(r))
|
|
for Z in Zlist:
|
|
filename='time_*_Z_{:.1f}_mom_i.csv'.format(Z)
|
|
filesMom_i = sorted(glob.glob(path+filename))
|
|
fileMom_i = filesMom_i[t]
|
|
time, r, n_i, u_i, T_i, Zave = readMom.read(fileMom_i)
|
|
sum_Zni += Zave*n_i
|
|
ave_ui += Zave*n_i*u_i
|
|
ave_Ti += Zave*n_i*T_i
|
|
|
|
ave_ui = np.divide(ave_ui, sum_Zni, out=np.zeros_like(ave_ui), where=sum_Zni!=0.0)
|
|
ave_Ti = np.divide(ave_Ti, sum_Zni, out=np.zeros_like(ave_Ti), where=sum_Zni!=0.0)
|
|
|
|
filePhi = filesPhi[t]
|
|
time, r, phi, E, n_e = readPhi.read(filePhi)
|
|
|
|
ax[0].plot(r, phi, label='t = {:.1f} ns'.format(time*1e9))
|
|
# ax[0].plot(r, E, label='t = {:.1f} ns'.format(time*1e9))
|
|
# ax[0].plot(r, (Zave*n_i - n_e), label='t = {:.1f} ns'.format(time*1e9))
|
|
ax[1].plot(r, sum_Zni)
|
|
ax[1].plot(r, n_e, color='k', linestyle='dashed')
|
|
ax[2].plot(r, ave_ui)
|
|
ax[3].plot(r, ave_Ti)
|
|
|
|
ax[0].set_title(label)
|
|
ax[0].legend()
|
|
|
|
plt.show()
|