Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion process/data_structure/physics_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,15 +1314,33 @@
vel_plasma_electron_profile: list[float] = None
"""Profile of electron thermal velocity in plasma (m/s)"""

vel_plasma_deuteron_profile: list[float] = None
"""Profile of deuteron thermal velocity in plasma (m/s)"""

vel_plasma_triton_profile: list[float] = None
"""Profile of triton thermal velocity in plasma (m/s)"""

plasma_coulomb_log_electron_electron_profile: list[float] = None
"""Profile of electron-electron Coulomb logarithm in plasma"""

plasma_coulomb_log_electron_deuteron_profile: list[float] = None
"""Profile of electron-deuteron Coulomb logarithm in plasma"""

plasma_coulomb_log_electron_triton_profile: list[float] = None
"""Profile of electron-triton Coulomb logarithm in plasma"""

freq_plasma_electron_profile: list[float] = None
"""Electron plasma frequency profile (Hz)"""

freq_plasma_larmor_toroidal_electron_profile: list[float] = None
"""Profile of electron Larmor frequency in plasma due to toroidal magnetic field (Hz)"""

freq_plasma_larmor_toroidal_deuteron_profile: list[float] = None
"""Profile of deuteron Larmor frequency in plasma due to toroidal magnetic field (Hz)"""

freq_plasma_larmor_toroidal_triton_profile: list[float] = None
"""Profile of triton Larmor frequency in plasma due to toroidal magnetic field (Hz)"""


def init_physics_module():
"""Initialise the physics module"""
Expand Down Expand Up @@ -1643,9 +1661,15 @@ def init_physics_variables():
len_plasma_debye_electron_profile, \
len_plasma_debye_electron_vol_avg, \
vel_plasma_electron_profile, \
vel_plasma_deuteron_profile, \
vel_plasma_triton_profile, \
plasma_coulomb_log_electron_electron_profile, \
plasma_coulomb_log_electron_deuteron_profile, \
plasma_coulomb_log_electron_triton_profile, \
freq_plasma_electron_profile, \
freq_plasma_larmor_toroidal_electron_profile
freq_plasma_larmor_toroidal_electron_profile, \
freq_plasma_larmor_toroidal_deuteron_profile, \
freq_plasma_larmor_toroidal_triton_profile

m_beam_amu = 0.0
m_fuel_amu = 0.0
Expand Down Expand Up @@ -1906,6 +1930,12 @@ def init_physics_variables():
len_plasma_debye_electron_profile = []
len_plasma_debye_electron_vol_avg = 0.0
vel_plasma_electron_profile = []
vel_plasma_deuteron_profile = []
vel_plasma_triton_profile = []
plasma_coulomb_log_electron_electron_profile = []
plasma_coulomb_log_electron_deuteron_profile = []
plasma_coulomb_log_electron_triton_profile = []
freq_plasma_electron_profile = []
freq_plasma_larmor_toroidal_electron_profile = []
freq_plasma_larmor_toroidal_deuteron_profile = []
freq_plasma_larmor_toroidal_triton_profile = []
102 changes: 99 additions & 3 deletions process/io/plot_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12389,7 +12389,7 @@ def plot_ebw_ecrh_coupling_graph(axis: plt.Axes, mfile: mf.MFile, scan: int):
axis.minorticks_on()


def plot_debye_length_profile(axis, mfile_data, scan):
def plot_debye_length_profile(axis: plt.Axes, mfile_data: mf.MFile, scan: int):
"""Plot the Debye length profile on the given axis."""
len_plasma_debye_electron_profile = [
mfile_data.data[f"len_plasma_debye_electron_profile{i}"].get_scan(scan)
Expand Down Expand Up @@ -12424,6 +12424,14 @@ def plot_velocity_profile(axis, mfile_data, scan):
mfile_data.data[f"vel_plasma_electron_profile{i}"].get_scan(scan)
for i in range(int(mfile_data.data["n_plasma_profile_elements"].get_scan(scan)))
]
vel_plasma_deuteron_profile = [
mfile_data.data[f"vel_plasma_deuteron_profile{i}"].get_scan(scan)
for i in range(int(mfile_data.data["n_plasma_profile_elements"].get_scan(scan)))
]
vel_plasma_triton_profile = [
mfile_data.data[f"vel_plasma_triton_profile{i}"].get_scan(scan)
for i in range(int(mfile_data.data["n_plasma_profile_elements"].get_scan(scan)))
]

axis.plot(
np.linspace(0, 1, len(vel_plasma_electron_profile)),
Expand All @@ -12432,7 +12440,22 @@ def plot_velocity_profile(axis, mfile_data, scan):
linestyle="-",
label=r"$v_{e}$",
)
axis.plot(
np.linspace(0, 1, len(vel_plasma_deuteron_profile)),
vel_plasma_deuteron_profile,
color="red",
linestyle="-",
label=r"$v_{D}$",
)
axis.plot(
np.linspace(0, 1, len(vel_plasma_triton_profile)),
vel_plasma_triton_profile,
color="green",
linestyle="-",
label=r"$v_{T}$",
)

axis.set_yscale("log")
axis.set_ylabel("Velocity [m/s]")
axis.set_xlabel("$\\rho \\ [r/a]$")
axis.grid(True, which="both", linestyle="--", alpha=0.5)
Expand All @@ -12441,7 +12464,7 @@ def plot_velocity_profile(axis, mfile_data, scan):
axis.legend()


def plot_frequency_profile(axis, mfile_data, scan):
def plot_electron_frequency_profile(axis, mfile_data, scan):
"""Plot the electron thermal frequency profile on the given axis."""
freq_plasma_electron_profile = [
mfile_data.data[f"freq_plasma_electron_profile{i}"].get_scan(scan)
Expand Down Expand Up @@ -12472,6 +12495,44 @@ def plot_frequency_profile(axis, mfile_data, scan):
axis.set_xlim(-1.025, 1.025)

axis.set_ylabel("Frequency [GHz]")
axis.grid(True, which="both", linestyle="--", alpha=0.5)

axis.legend()


def plot_ion_frequency_profile(axis, mfile_data, scan):
freq_plasma_larmor_toroidal_deuteron_profile = [
mfile_data.data[f"freq_plasma_larmor_toroidal_deuteron_profile{i}"].get_scan(
scan
)
for i in range(
2 * int(mfile_data.data["n_plasma_profile_elements"].get_scan(scan))
)
]

freq_plasma_larmor_toroidal_triton_profile = [
mfile_data.data[f"freq_plasma_larmor_toroidal_triton_profile{i}"].get_scan(scan)
for i in range(
2 * int(mfile_data.data["n_plasma_profile_elements"].get_scan(scan))
)
]

axis.plot(
np.linspace(-1, 1, len(freq_plasma_larmor_toroidal_deuteron_profile)),
np.array(freq_plasma_larmor_toroidal_deuteron_profile) / 1e6,
color="red",
linestyle="-",
label=r"$f_{Larmor,toroidal,D}$",
)
axis.plot(
np.linspace(-1, 1, len(freq_plasma_larmor_toroidal_triton_profile)),
np.array(freq_plasma_larmor_toroidal_triton_profile) / 1e6,
color="green",
linestyle="-",
label=r"$f_{Larmor,toroidal,T}$",
)

axis.set_ylabel("Frequency [MHz]")
axis.set_xlabel("$\\rho \\ [r/a]$")
axis.grid(True, which="both", linestyle="--", alpha=0.5)
axis.minorticks_on()
Expand All @@ -12487,6 +12548,18 @@ def plot_plasma_coloumb_logarithms(axis, mfile_data, scan):
for i in range(int(mfile_data.data["n_plasma_profile_elements"].get_scan(scan)))
]

plasma_coulomb_log_electron_deuteron_profile = [
mfile_data.data[f"plasma_coulomb_log_electron_deuteron_profile{i}"].get_scan(
scan
)
for i in range(int(mfile_data.data["n_plasma_profile_elements"].get_scan(scan)))
]

plasma_coulomb_log_electron_triton_profile = [
mfile_data.data[f"plasma_coulomb_log_electron_triton_profile{i}"].get_scan(scan)
for i in range(int(mfile_data.data["n_plasma_profile_elements"].get_scan(scan)))
]

axis.plot(
np.linspace(0, 1, len(plasma_coulomb_log_electron_electron_profile)),
plasma_coulomb_log_electron_electron_profile,
Expand All @@ -12495,6 +12568,22 @@ def plot_plasma_coloumb_logarithms(axis, mfile_data, scan):
label=r"$ln \Lambda_{e-e}$",
)

axis.plot(
np.linspace(0, 1, len(plasma_coulomb_log_electron_deuteron_profile)),
plasma_coulomb_log_electron_deuteron_profile,
color="red",
linestyle="-",
label=r"$ln \Lambda_{e-D}$",
)

axis.plot(
np.linspace(0, 1, len(plasma_coulomb_log_electron_triton_profile)),
plasma_coulomb_log_electron_triton_profile,
color="green",
linestyle="-",
label=r"$ln \Lambda_{e-T}$",
)

axis.set_ylabel("Coulomb Logarithm")
axis.set_xlabel("$\\rho \\ [r/a]$")
axis.grid(True, which="both", linestyle="--", alpha=0.5)
Expand Down Expand Up @@ -12924,7 +13013,14 @@ def main_plot(

plot_debye_length_profile(figs[15].add_subplot(232), m_file, scan)
plot_velocity_profile(figs[15].add_subplot(233), m_file, scan)
plot_frequency_profile(figs[15].add_subplot(212), m_file, scan)

ax_ion = figs[15].add_subplot(414)
ax_electron = figs[15].add_subplot(413, sharex=ax_ion)

plot_electron_frequency_profile(ax_electron, m_file, scan)

plot_ion_frequency_profile(ax_ion, m_file, scan)

plot_plasma_coloumb_logarithms(figs[15].add_subplot(231), m_file, scan)

# Plot poloidal cross-section
Expand Down
Loading
Loading