n_e as boundary condition

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.
This commit is contained in:
Jorge Gonzalez 2025-04-10 08:49:01 +02:00
commit 0c27b98e2e
6 changed files with 38 additions and 38 deletions

View file

@ -4,15 +4,17 @@ import numpy as np
import readBC
paths = ['../polytropic_80ns_T30/']
time, n, u, T, Zinj = readBC.read(paths[0] + 'bc.csv')
paths = ['../2025-04-10_08.40.09/']
time, n_i, u_i, T_i, Zinj, Z_Tne = readBC.read(paths[0] + 'bc.csv')
fig, ax = plt.subplots()
n_e = n_i * Zinj
plt.plot(time, n / n[0], label = f"$n_i$ ($\\times {n[0] * 1e-6:.0e} \\; cm^{{-3}})$")
plt.plot(time, T / T[0], label = f"$T \\; (\\times{T[0]:.1f} \\; eV)$")
plt.plot(time, Zinj, label = "Injection species")
plt.plot(time, n_e / n_e[0], label = f"$n_e$ ($\\times {n_e[0] * 1e-6:.0e} \\; cm^{{-3}})$")
plt.plot(time, T_i / T_i[0], label = f"$T \\; (\\times{T_i[0]:.1f} \\; eV)$")
plt.plot(time, Zinj, label = "Zinj")
plt.plot(time, Z_Tne, label = "Z_Tne")
plt.semilogy()
plt.legend()
plt.show()

View file

@ -16,7 +16,7 @@ m_i = 1.9712e-25
# paths = ['../2024-12-10_18.45.17/', '../Poisson_50ns_T30Z11/']
# paths = ['../2024-12-11_12.38.27/', '../Poisson_polytropic_fa_T30Z11/', '../Poisson_fa_T30Z11/']
# paths = ['../Poisson_partialAblation/','../Poisson_partialAblation_lowerT/','../Poisson_partialAblation_lowT/','../Poisson_partialAblation_highT/']
paths = ['../polytropic_80ns_T60/']
paths = ['../polytropic_80ns_T30/']
labels = [path[3:-1] for path in paths]
for path, label in zip(paths, labels):
@ -26,10 +26,12 @@ for path, label in zip(paths, labels):
sumF = np.zeros(len(v))
for Z in Zlist:
filesCum_i = sorted(glob.glob(path+'time_*_Z{:.0f}000_fCum_i.csv'.format(Z)))
filename='time_*_Z_{:.1f}_fCum_i.csv'.format(Z)
filesCum_i = sorted(glob.glob(path+filename))
time, x, v, f_i = readF.read(filesCum_i[-1])
sumF += f_i[0]
plt.plot(v**2*m_i*0.5/e, f_i[0]*e/m_i/v, label=Z)
print(time)
plt.plot(v**2*m_i*0.5/e, sumF*e/m_i/v, label='sum', color='k', linestyle='dashed')
plt.yscale('log')

View file

@ -12,15 +12,15 @@ from scipy.constants import e, k
# paths = ['../quasiNeutral_partialAblation/','../Poisson_partialAblation/']
# paths = ['../2024-10-02_14.30.44/']
# paths = ['../quasiNeutral_fullAblation/','../Poisson_fullAblation/']
paths = ['../2025-04-08_09.36.52/']
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 = 0
end = 20#len(filesPhi)
every = 5
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)
@ -30,7 +30,8 @@ for path, label in zip(paths, labels):
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)))
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

View file

@ -4,11 +4,12 @@ def read(filename):
# Get time
df = pandas.read_csv(filename)
time = df['t (s)'].to_numpy()
n = df['n (m^-3)'].to_numpy()
u = df['u (m s^-1)'].to_numpy()
T = df['T (eV)'].to_numpy()
n = df['n_i (m^-3)'].to_numpy()
u = df['u_i (m s^-1)'].to_numpy()
T = df['T_i (eV)'].to_numpy()
Zinj = df['Zinj'].to_numpy()
Z_Tne = df['Z_Tne'].to_numpy()
return time, n, u, T, Zinj
return time, n, u, T, Zinj, Z_Tne