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}}:$" 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)""" diff --git a/process/models/pfcoil.py b/process/models/pfcoil.py index c8bf6b0a4d..8de0d1b706 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 @@ -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 @@ -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 @@ -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: @@ -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, "----------------------------") 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, ), ), ],