Skip to content

cables

Magnets functions for PROCESS summary plots.

plot_cable_in_conduit_cable(axis, fig, mfile, scan)

Plots TF coil CICC cable cross-section.

Parameters:

Name Type Description Default
axis Axes
required
fig
required
mfile MFile
required
scan int
required
Source code in process/core/io/plot/summary/magnets/cables.py
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
def plot_cable_in_conduit_cable(axis: plt.Axes, fig, mfile: MFile, scan: int):
    """Plots TF coil CICC cable cross-section.

    Parameters
    ----------
    axis: plt.Axes :

    fig :

    mfile: MFile :

    scan: int :

    """
    dia_tf_turn_superconducting_cable = mfile.get(
        "dia_tf_turn_superconducting_cable", scan=scan
    )
    f_a_tf_turn_cable_copper = mfile.get("f_a_tf_turn_cable_copper", scan=scan)

    # Convert to mm
    dia_mm = dia_tf_turn_superconducting_cable * 1000
    radius_superconductor_mm = np.sqrt(1 - f_a_tf_turn_cable_copper) * (dia_mm / 2)

    # Draw the outer copper circle
    circle_copper_surrounding = patches.Circle(
        (0, 0),
        dia_mm / 2,
        facecolor="#b87333",  # copper color
        edgecolor="#8B4000",  # darker copper edge
        linewidth=0.1,
        alpha=0.8,
        label="Copper",
        zorder=1,
    )
    axis.add_patch(circle_copper_surrounding)

    # Draw the inner superconductor circle
    circle_central_conductor = patches.Circle(
        (0, 0),
        radius_superconductor_mm,
        facecolor="black",
        linewidth=0.3,
        alpha=0.7,
        label="Superconductor",
        zorder=2,
    )
    axis.add_patch(circle_central_conductor)

    # Convert cable diameter to mm
    cable_diameter_mm = mfile.get("dia_tf_turn_superconducting_cable", scan=scan) * 1000
    # Convert lengths from meters to kilometers for display
    len_tf_coil_superconductor_km = (
        mfile.get("len_tf_coil_superconductor", scan=scan) / 1000.0
    )
    len_tf_superconductor_total_km = (
        mfile.get("len_tf_superconductor_total", scan=scan) / 1000.0
    )

    textstr_cable = (
        f"$\\mathbf{{Cable:}}$\n\nCable diameter: {cable_diameter_mm:,.4f}"
        " mm\nCopper area fraction:"
        f" {mfile.get('f_a_tf_turn_cable_copper', scan=scan):.4f}\nNumber of"
        " strands per turn:"
        f" {int(mfile.get('n_tf_turn_superconducting_cables', scan=scan)):,}\nLength"
        f" of superconductor per coil: {len_tf_coil_superconductor_km:,.2f}"
        " km\nTotal length of superconductor in all coils:"
        f" {len_tf_superconductor_total_km:,.2f} km\n"
    )
    axis.text(
        0.4,
        0.3,
        textstr_cable,
        **text_layout(fig, v_align="top"),
        bbox=box_style("#cccccc"),
    )

    axis.set_aspect("equal")
    axis.set_xlim(-dia_mm / 1.5, dia_mm / 1.5)
    axis.set_ylim(-dia_mm / 1.5, dia_mm / 1.5)
    axis.set_title("TF CICC Cable Cross-Section")
    axis.minorticks_on()
    axis.legend(loc="upper right")
    axis.grid(True, which="both", linestyle="--", linewidth=0.5, alpha=0.2)
    axis.set_xlabel("X [mm]")
    axis.set_ylabel("Y [mm]")

plot_hts_tape_geometry(axis, r_left, z_bottom, dr_hts_tape, dx_hts_tape_rebco, dx_hts_tape_copper, dx_hts_tape_hastelloy, show_legend=True)

Plot HTS tape geometry

Source code in process/core/io/plot/summary/magnets/cables.py
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
def plot_hts_tape_geometry(
    axis,
    r_left: float,
    z_bottom: float,
    dr_hts_tape: float,
    dx_hts_tape_rebco: float,
    dx_hts_tape_copper: float,
    dx_hts_tape_hastelloy: float,
    show_legend: bool = True,
):
    """Plot HTS tape geometry"""
    legend_label = None if show_legend else "_nolegend_"
    # Plot a rectangular tape stack in the middle
    rect = Rectangle(
        (r_left, z_bottom),
        width=dr_hts_tape,
        height=dx_hts_tape_copper / 2,
        edgecolor=None,
        facecolor="#B87333",
        linewidth=2,
        label="Copper" if show_legend else legend_label,
    )
    axis.add_patch(rect)
    rect = Rectangle(
        (r_left, z_bottom + dx_hts_tape_copper / 2),
        width=dr_hts_tape,
        height=dx_hts_tape_hastelloy / 2,
        edgecolor=None,
        facecolor="grey",
        linewidth=2,
        label="Hastelloy" if show_legend else legend_label,
    )
    axis.add_patch(rect)
    rect = Rectangle(
        (
            r_left,
            z_bottom + dx_hts_tape_copper / 2 + dx_hts_tape_hastelloy / 2,
        ),
        width=dr_hts_tape,
        height=dx_hts_tape_rebco,
        edgecolor=None,
        facecolor="blue",
        linewidth=2,
        label="REBCO" if show_legend else legend_label,
    )
    axis.add_patch(rect)
    rect = Rectangle(
        (
            r_left,
            z_bottom
            + dx_hts_tape_copper / 2
            + dx_hts_tape_hastelloy / 2
            + dx_hts_tape_rebco,
        ),
        width=dr_hts_tape,
        height=dx_hts_tape_hastelloy / 2,
        edgecolor=None,
        facecolor="grey",
        linewidth=2,
        label="Hastelloy" if show_legend else legend_label,
    )
    axis.add_patch(rect)
    rect = Rectangle(
        (
            r_left,
            z_bottom
            + dx_hts_tape_copper / 2
            + dx_hts_tape_hastelloy / 2
            + dx_hts_tape_rebco
            + dx_hts_tape_hastelloy / 2,
        ),
        width=dr_hts_tape,
        height=dx_hts_tape_copper / 2,
        edgecolor=None,
        facecolor="#B87333",
        linewidth=2,
        label="Copper" if show_legend else legend_label,
    )
    axis.add_patch(rect)

    axis.set_title("HTS Tape Geometry")
    axis.grid(True)
    axis.set_xlabel("X-axis (m)")
    axis.set_ylabel("Y-axis (m)")
    axis.set_xlim(r_left * 0.9, dr_hts_tape * 1.1)
    axis.set_ylim(
        z_bottom * 0.9,
        (dx_hts_tape_copper + dx_hts_tape_hastelloy + dx_hts_tape_rebco) * 1.1,
    )
    axis.minorticks_on()
    axis.ticklabel_format(style="sci", axis="both", scilimits=(0, 0))
    if show_legend:
        axis.legend(loc="upper right")