Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
54 changes: 35 additions & 19 deletions process/core/io/plot/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
)
from process.models.superconductors import SuperconductorModel
from process.models.tfcoil.base import TFCoilShapeModel, TFPlasmaCaseType
from process.models.tfcoil.quench import plot_quench_time_evolution


@dataclass
Expand Down Expand Up @@ -7474,7 +7475,8 @@ def _pack_strands_rectangular_with_obstacles(

textstr_superconductor = (
f"$\\mathbf{{Superconductor:}}$\n \n"
f"Superconductor used: {SuperconductorModel(mfile.get('i_tf_sc_mat', scan=scan)).full_name}\n"
f"Superconductor used: \n"
f"{SuperconductorModel(mfile.get('i_tf_sc_mat', scan=scan)).full_name}\n"
f"Critical field at zero \ntemperature and strain: {mfile.get('b_tf_superconductor_critical_zero_temp_strain', scan=scan):.4f} T\n"
f"Critical temperature at \nzero field and strain: {mfile.get('temp_tf_superconductor_critical_zero_field_strain', scan=scan):.4f} K\n"
f"Temperature at conductor: {mfile.get('tftmp', scan=scan):.4f} K\n"
Expand All @@ -7483,8 +7485,8 @@ def _pack_strands_rectangular_with_obstacles(
f"Critcal current ratio: {mfile.get('f_c_tf_turn_operating_critical', scan=scan):,.4f}\n"
f"Superconductor temperature \nmargin: {mfile.get('temp_tf_superconductor_margin', scan=scan):,.4f} K\n"
f"\n$\\mathbf{{Quench:}}$\n \n"
f"Quench dump time: {mfile.get('t_tf_superconductor_quench', scan=scan):.4e} s\n"
f"Quench detection time: {mfile.get('t_tf_quench_detection', scan=scan):.4e} s\n"
f"Quench dump time: {mfile.get('t_tf_superconductor_quench', scan=scan):.4f} s\n"
f"Quench detection time: {mfile.get('t_tf_quench_detection', scan=scan):.4f} s\n"
f"User input max temperature \nduring quench: {mfile.get('temp_tf_conductor_quench_max', scan=scan):.2f} K\n"
f"Required maxium WP current \ndensity for heat protection:\n{mfile.get('j_tf_wp_quench_heat_max', scan=scan):.2e} A/m$^2$\n"
)
Expand Down Expand Up @@ -14432,46 +14434,60 @@ def main_plot(
plot_205 = figs[25].add_subplot(223, aspect="equal")
plot_205.set_position([0.075, 0.1, 0.3, 0.3])
plot_cable_in_conduit_cable(plot_205, figs[25], m_file, scan)
plot_quench_time_evolution(
tau_discharge=m_file.get("t_tf_superconductor_quench", scan=scan),
b_peak=m_file.get("b_tf_inboard_peak_with_ripple", scan=scan),
f_cu=m_file.get("f_a_tf_turn_cable_copper", scan=scan),
f_he=m_file.get("f_a_tf_turn_cable_space_cooling", scan=scan),
t_he_peak=m_file.get("tftmp", scan=scan),
temp_quench_max=m_file.get("temp_tf_conductor_quench_max", scan=scan),
cu_rrr=100.0,
t_quench_detection=m_file.get("t_tf_quench_detection", scan=scan),
fluence=m_file.get("nflutfmax", scan=scan),
j_operating=m_file.get("j_tf_wp", scan=scan),
axes_1=figs[26].add_subplot(211),
axes_2=figs[26].add_subplot(212),
)
else:
ax19 = figs[24].add_subplot(211, aspect="equal")
ax19.set_position([0.06, 0.55, 0.675, 0.4])
plot_resistive_tf_wp(ax19, m_file, scan, figs[24])
plot_resistive_tf_info(ax19, m_file, scan, figs[24])
plot_tf_coil_structure(
figs[26].add_subplot(111, aspect="equal"), m_file, scan, colour_scheme
figs[27].add_subplot(111, aspect="equal"), m_file, scan, colour_scheme
)

plot_plasma_outboard_toroidal_ripple_map(figs[27], m_file, scan)
plot_plasma_outboard_toroidal_ripple_map(figs[28], m_file, scan)

plot_tf_stress(figs[28].subplots(nrows=3, ncols=1, sharex=True).flatten(), m_file)
plot_tf_stress(figs[29].subplots(nrows=3, ncols=1, sharex=True).flatten(), m_file)

plot_current_profiles_over_time(figs[29].add_subplot(111), m_file, scan)
plot_current_profiles_over_time(figs[30].add_subplot(111), m_file, scan)

plot_cs_coil_structure(
figs[30].add_subplot(121, aspect="equal"), figs[30], m_file, scan
figs[31].add_subplot(121, aspect="equal"), figs[31], m_file, scan
)
plot_cs_turn_structure(
figs[30].add_subplot(224, aspect="equal"), figs[30], m_file, scan
figs[31].add_subplot(224, aspect="equal"), figs[31], m_file, scan
)

plot_first_wall_top_down_cross_section(
figs[31].add_subplot(221, aspect="equal"), m_file, scan
figs[32].add_subplot(221, aspect="equal"), m_file, scan
)
plot_first_wall_poloidal_cross_section(figs[31].add_subplot(122), m_file, scan)
plot_fw_90_deg_pipe_bend(figs[31].add_subplot(337), m_file, scan)
plot_first_wall_poloidal_cross_section(figs[32].add_subplot(122), m_file, scan)
plot_fw_90_deg_pipe_bend(figs[32].add_subplot(337), m_file, scan)

plot_blkt_pipe_bends(figs[32], m_file, scan)
ax_blanket = figs[32].add_subplot(122, aspect="equal")
plot_blkt_structure(ax_blanket, figs[32], m_file, scan, radial_build, colour_scheme)
plot_blkt_pipe_bends(figs[33], m_file, scan)
ax_blanket = figs[33].add_subplot(122, aspect="equal")
plot_blkt_structure(ax_blanket, figs[33], m_file, scan, radial_build, colour_scheme)

plot_main_power_flow(
figs[33].add_subplot(111, aspect="equal"), m_file, scan, figs[33]
figs[34].add_subplot(111, aspect="equal"), m_file, scan, figs[34]
)

ax24 = figs[34].add_subplot(111)
ax24 = figs[35].add_subplot(111)
# set_position([left, bottom, width, height]) -> height ~ 0.66 => ~2/3 of page height
ax24.set_position([0.08, 0.35, 0.84, 0.57])
plot_system_power_profiles_over_time(ax24, m_file, scan, figs[34])
plot_system_power_profiles_over_time(ax24, m_file, scan, figs[35])


def create_thickness_builds(m_file, scan: int):
Expand Down Expand Up @@ -14553,7 +14569,7 @@ def plot_summary(
):
# create main plot
# Increase range when adding new page
pages = [plt.figure(figsize=(12, 9), dpi=80) for i in range(35)]
pages = [plt.figure(figsize=(12, 9), dpi=80) for i in range(36)]

# run main_plot
main_plot(
Expand Down
Loading
Loading