From 76399a8c8afcff81c51d9af00d29b64bc818d97c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 12 Oct 2026 13:07:27 +0100 Subject: [PATCH 1/6] Add new parameters for central solenoid radius ratios in PFCoilData --- process/data_structure/pfcoil_variables.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/process/data_structure/pfcoil_variables.py b/process/data_structure/pfcoil_variables.py index efad8f5193..b3ea8648dd 100644 --- a/process/data_structure/pfcoil_variables.py +++ b/process/data_structure/pfcoil_variables.py @@ -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)""" From 375558b6a7841284cd00b30c3fbe47cc850074fb Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 12 Oct 2026 13:10:52 +0100 Subject: [PATCH 2/6] Add outer-to-inner radius and height-to-inner radius ratios to CS coil model --- process/models/pfcoil.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/process/models/pfcoil.py b/process/models/pfcoil.py index c8bf6b0a4d..4e8aaba2c2 100644 --- a/process/models/pfcoil.py +++ b/process/models/pfcoil.py @@ -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 @@ -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 = z_cs_coil_upper / r_cs_coil_inner + # Full radial thickness of CS coil dr_cs_full = 2 * r_cs_coil_outer @@ -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 @@ -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: From b3be26b58090c8b60cb68f8b573a36bacdb8dac2 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 12 Oct 2026 13:17:23 +0100 Subject: [PATCH 3/6] Add ratios of outer to inner radius and solenoid height to inner radius in CS coil model --- process/models/pfcoil.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/process/models/pfcoil.py b/process/models/pfcoil.py index 4e8aaba2c2..9c0d4f3d41 100644 --- a/process/models/pfcoil.py +++ b/process/models/pfcoil.py @@ -4033,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, "----------------------------") From 13406fbe2e13ace1e0758e3d30936d0e4d4d33ce Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 13 Oct 2026 10:05:49 +0100 Subject: [PATCH 4/6] Refactor CS coil height calculations for clarity and consistency --- process/models/pfcoil.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/process/models/pfcoil.py b/process/models/pfcoil.py index 9c0d4f3d41..8de0d1b706 100644 --- a/process/models/pfcoil.py +++ b/process/models/pfcoil.py @@ -3143,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 @@ -3165,7 +3165,7 @@ def calculate_cs_geometry( 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 = z_cs_coil_upper / r_cs_coil_inner + 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 From a6a1ca0dbef6172876145453cbd0b3c3e547a830 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 14 Oct 2026 16:32:35 +0100 Subject: [PATCH 5/6] Post rebase fixes --- process/core/io/plot/summary/magnets/cs.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/process/core/io/plot/summary/magnets/cs.py b/process/core/io/plot/summary/magnets/cs.py index e62e45d2fb..3036d64ec5 100644 --- a/process/core/io/plot/summary/magnets/cs.py +++ b/process/core/io/plot/summary/magnets/cs.py @@ -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}}:$" From c99875193484b8cb79ed4ddc6f4e4f8ce4048b95 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 15 Oct 2026 10:09:40 +0100 Subject: [PATCH 6/6] Update test_brookscoil to include additional parameters and remove zero thickness case --- tests/unit/models/test_pfcoil.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/unit/models/test_pfcoil.py b/tests/unit/models/test_pfcoil.py index 80144eea60..0cc70a4ef0 100644 --- a/tests/unit/models/test_pfcoil.py +++ b/tests/unit/models/test_pfcoil.py @@ -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, @@ -2092,6 +2086,8 @@ def test_brookscoil(pfcoil): 1.4999999999999998, 0.0, 3.5999999999999996, + 1.2, + 0.0, ), ), ],