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
28 changes: 28 additions & 0 deletions process/models/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,34 @@ def run(self):
dx_beam_shield=self.data.current_drive.dx_beam_shield,
)

self.calculate_cs_area()

def calculate_cs_area(self):
"""Calculates the CS cross-sectional areas."""
# Central Solenoid mean radius
r_cs_middle = self.data.build.dr_cs_bore + (0.5e0 * self.data.build.dr_cs)

# Scale the CS height relative to TF bore height
z_cs_half = (
self.data.build.z_tf_inside_half * self.data.pf_coil.f_z_cs_tf_internal
)

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

# Radius of outer edge
r_cs_coil_outer = r_cs_middle + 0.5e0 * self.data.build.dr_cs

# Radius of inner edge
r_cs_coil_inner = r_cs_coil_outer - self.data.build.dr_cs

# Total poloidal cross-sectional area [m²]
self.data.pf_coil.a_cs_poloidal = dz_cs_full * self.data.build.dr_cs

# Total top-down toroidal cross-sectional area [m²]
self.data.pf_coil.a_cs_toroidal = np.pi * (
r_cs_coil_outer**2 - r_cs_coil_inner**2
)

@staticmethod
def calculate_beam_port_size(
f_radius_beam_tangency_rmajor: float,
Expand Down
16 changes: 0 additions & 16 deletions process/models/pfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ def pfcoil(self):
self.data.pf_coil.r_cs_inner = self.data.pf_coil.r_pf_coil_inner[
self.data.pf_coil.n_cs_pf_coils - 1
] = cs_geometry.r_cs_coil_inner
self.data.pf_coil.a_cs_poloidal = cs_geometry.a_cs_poloidal
self.data.pf_coil.a_cs_toroidal = cs_geometry.a_cs_toroidal
self.data.pf_coil.dz_cs_full = cs_geometry.dz_cs_full
self.data.pf_coil.dr_cs_full = cs_geometry.dr_cs_full

Expand Down Expand Up @@ -3073,10 +3071,6 @@ class CSGeometry:
"""Outer radius of CS coil (m)"""
r_cs_coil_inner: float
"""Inner radius of CS coil (m)"""
a_cs_poloidal: float
"""Total poloidal cross-sectional area of CS coil (m²)"""
a_cs_toroidal: float
"""Total top-down toroidal cross-sectional area of CS coil (m²)"""
dz_cs_full: float
"""Full height of CS coil (m)"""
dr_cs_full: float
Expand Down Expand Up @@ -3166,12 +3160,6 @@ def calculate_cs_geometry(
# Full radial thickness of CS coil
dr_cs_full = 2 * r_cs_coil_outer

# Total poloidal cross-sectional area [m²]
a_cs_poloidal = dz_cs_full * dr_cs

# Total top-down toroidal cross-sectional area [m²]
a_cs_toroidal = np.pi * (r_cs_coil_outer**2 - r_cs_coil_inner**2)

return CSGeometry(
z_cs_coil_upper=z_cs_coil_upper,
z_cs_coil_lower=z_cs_coil_lower,
Expand All @@ -3180,8 +3168,6 @@ def calculate_cs_geometry(
z_cs_coil_middle=z_cs_coil_middle,
r_cs_coil_outer=r_cs_coil_outer,
r_cs_coil_inner=r_cs_coil_inner,
a_cs_poloidal=a_cs_poloidal,
a_cs_toroidal=a_cs_toroidal,
dz_cs_full=dz_cs_full,
dr_cs_full=dr_cs_full,
)
Expand Down Expand Up @@ -3368,8 +3354,6 @@ def ohcalc(self):
self.data.pf_coil.r_cs_inner = self.data.pf_coil.r_pf_coil_inner[
self.data.pf_coil.n_cs_pf_coils - 1
] = cs_geometry.r_cs_coil_inner
self.data.pf_coil.a_cs_poloidal = cs_geometry.a_cs_poloidal
self.data.pf_coil.a_cs_toroidal = cs_geometry.a_cs_toroidal
self.data.pf_coil.dz_cs_full = cs_geometry.dz_cs_full
self.data.pf_coil.dr_cs_full = cs_geometry.dr_cs_full

Expand Down
12 changes: 7 additions & 5 deletions tests/unit/models/test_pfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2064,8 +2064,6 @@ def test_brookscoil(pfcoil):
0.0,
0.44999999999999996,
0.14999999999999997,
0.6,
0.5654866776461627,
2.0,
0.8999999999999999,
),
Expand All @@ -2076,7 +2074,7 @@ def test_brookscoil(pfcoil):
0.5,
0.0,
0.0,
CSGeometry(1.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.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
(
Expand All @@ -2093,8 +2091,6 @@ def test_brookscoil(pfcoil):
1.7999999999999998,
1.4999999999999998,
0.0,
3.1101767270538945,
0.0,
3.5999999999999996,
),
),
Expand Down Expand Up @@ -2727,6 +2723,8 @@ class OhCalcParam(NamedTuple):
rmajor: Any = None
plasma_current: Any = None
poisson_steel: Any = None
a_cs_poloidal: float = None
a_cs_toroidal: float = None
exp_b_pf_coil_peak: Any = None
exp_j_cs_critical_flat_top_end: Any = None

Expand Down Expand Up @@ -2778,6 +2776,8 @@ class OhCalcParam(NamedTuple):
rmajor=8.938,
plasma_current=1.8254e7,
poisson_steel=3.0e-1,
a_cs_poloidal=10.3868352,
a_cs_toroidal=12.2710609,
exp_b_pf_coil_peak=13.073958753751993,
exp_j_cs_critical_flat_top_end=54101481.7685945,
)
Expand Down Expand Up @@ -2834,6 +2834,8 @@ def test_ohcalc(monkeypatch, reinitialise_error_module, cs_coil, ohcalcparam):
"c_pf_cs_coil_pulse_start_ma",
"c_pf_cs_coil_flat_top_ma",
"c_pf_cs_coil_pulse_end_ma",
"a_cs_toroidal",
"a_cs_poloidal",
]:
monkeypatch.setattr(cs_coil.data.pf_coil, field, getattr(ohcalcparam, field))

Expand Down
Loading