Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 6 additions & 1 deletion process/core/io/plot/summary/magnets/cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,12 @@ def plot_cs_coil_structure(
f" {mfile.get('dr_cs_full', scan=scan):.4f} m\nCS poloidal area:"
f" {mfile.get('a_cs_poloidal', scan=scan):.4f} m$^2$\nCS top-down"
f" toroidal area: {mfile.get('a_cs_toroidal', scan=scan):.4f}"
" m$^2$\n$N_{\\text{turns}}:$"
" m$^2$\n"
f"CS ratio of outer to inner radius ($\\alpha$): "
f"{mfile.get('f_r_cs_outer_inner', scan=scan):.4f}\n"
f"CS ratio of solenoid half height to inner radius ($\\beta$): "
f"{mfile.get('f_len_cs_upper_inner', scan=scan):.4f}\n"
"$N_{\\text{turns}}:$"
f" {mfile.get('n_pf_coil_turns[n_cs_pf_coils-1]', scan=scan):,.2f}\n$I_{{\\text{{peak}}}}:$" # noqa: E501
f" {mfile.get('c_pf_cs_coils_peak_ma[n_cs_pf_coils-1]', scan=scan):.3f}"
" MA\n$B_{\\text{peak}}:$"
Expand Down
6 changes: 6 additions & 0 deletions process/data_structure/pfcoil_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,12 @@ class PFCoilData:
r_cs_outer: float = 0.0
"""Outer radius of the central solenoid (m)"""

f_r_cs_outer_inner: float = 0.0
"""Ratio of outer to inner radius of the central solenoid (α)""" # noqa: RUF001

f_len_cs_upper_inner: float = 0.0
"""Ratio of the solenoid half height to its inner radius (β)"""

z_cs_upper: float = 0.0
"""z location of upper end of central solenoid (m)"""

Expand Down
35 changes: 32 additions & 3 deletions process/models/pfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -3075,6 +3075,10 @@ class CSGeometry:
"""Full height of CS coil (m)"""
dr_cs_full: float
"""Full radial thickness of CS coil (m)"""
f_r_cs_outer_inner: float
"""Ratio of outer to inner radius of the CS coil (α)""" # noqa: RUF001
f_len_cs_upper_inner: float
"""Ratio of the solenoid half height to its inner radius (β)"""


@dataclass
Expand Down Expand Up @@ -3139,12 +3143,12 @@ def calculate_cs_geometry(
r_cs_middle = dr_cs_bore + (0.5e0 * dr_cs)

# Scale the CS height relative to TF bore height
z_cs_half = z_tf_inside_half * f_z_cs_tf_internal
dz_cs_half = z_tf_inside_half * f_z_cs_tf_internal

dz_cs_full = 2.0e0 * z_cs_half # Full height of CS coil
dz_cs_full = 2.0e0 * dz_cs_half # Full height of CS coil

# Z coordinates of CS coil edges
z_cs_coil_upper = z_cs_half
z_cs_coil_upper = dz_cs_half
z_cs_coil_lower = -z_cs_coil_upper

# (R,Z) coordinates of coil centre
Expand All @@ -3157,6 +3161,12 @@ def calculate_cs_geometry(
# Radius of inner edge
r_cs_coil_inner = r_cs_coil_outer - dr_cs

# Ratio of outer to inner radius of the CS coil, also known as (alpha)
f_r_cs_outer_inner = r_cs_coil_outer / r_cs_coil_inner

# Ratio of the solenoid half height to its inner radius, also known as β (beta)
f_len_cs_upper_inner = dz_cs_half / r_cs_coil_inner

# Full radial thickness of CS coil
dr_cs_full = 2 * r_cs_coil_outer

Expand All @@ -3170,6 +3180,8 @@ def calculate_cs_geometry(
r_cs_coil_inner=r_cs_coil_inner,
dz_cs_full=dz_cs_full,
dr_cs_full=dr_cs_full,
f_r_cs_outer_inner=f_r_cs_outer_inner,
f_len_cs_upper_inner=f_len_cs_upper_inner,
)

@staticmethod
Expand Down Expand Up @@ -3356,6 +3368,8 @@ def ohcalc(self):
] = cs_geometry.r_cs_coil_inner
self.data.pf_coil.dz_cs_full = cs_geometry.dz_cs_full
self.data.pf_coil.dr_cs_full = cs_geometry.dr_cs_full
self.data.pf_coil.f_r_cs_outer_inner = cs_geometry.f_r_cs_outer_inner
self.data.pf_coil.f_len_cs_upper_inner = cs_geometry.f_len_cs_upper_inner

# Maximum current (MA-turns) in central Solenoid, at either BOP or EOF
if self.data.pf_coil.j_cs_pulse_start > self.data.pf_coil.j_cs_flat_top_end:
Expand Down Expand Up @@ -4019,6 +4033,21 @@ def output_cs_structure(self) -> None:
self.data.pf_coil.a_cs_toroidal,
"OP ",
)
op.oblnkl(self.outfile)
op.ovarre(
self.outfile,
"Ratio of outer to inner radius of the CS coil (α)", # noqa: RUF001
"(f_r_cs_outer_inner)",
self.data.pf_coil.f_r_cs_outer_inner,
"OP ",
)
op.ovarre(
self.outfile,
"Ratio of the solenoid half height to its inner radius (β)",
"(f_len_cs_upper_inner)",
self.data.pf_coil.f_len_cs_upper_inner,
"OP ",
)

op.oblnkl(self.outfile)
op.ocmmnt(self.outfile, "----------------------------")
Expand Down
12 changes: 4 additions & 8 deletions tests/unit/models/test_pfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2066,16 +2066,10 @@ def test_brookscoil(pfcoil):
0.14999999999999997,
2.0,
0.8999999999999999,
3.0000000000000004,
6.666666666666668,
),
),
# Zero thickness
(
2.0,
0.5,
0.0,
0.0,
CSGeometry(1.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0),
),
# Zero fractional height
(
2.0,
Expand All @@ -2092,6 +2086,8 @@ def test_brookscoil(pfcoil):
1.4999999999999998,
0.0,
3.5999999999999996,
1.2,
0.0,
),
),
],
Expand Down
Loading