Small set of corrections to the tag v2.5. Includes changes to python scripts to plot data. Includes new 'fast' setup conditions that allow to output cases in an hour or so with still a good CFL condition and grid resolution.
57 lines
2 KiB
Python
57 lines
2 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-08_09.36.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 = 0
|
|
end = 20#len(filesPhi)
|
|
every = 5
|
|
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:
|
|
filesMom_i = sorted(glob.glob(path+'time_*_Z{:.0f}000_mom_i.csv'.format(Z)))
|
|
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()
|