Skip to content

Commit

Permalink
Rename tfthko variable to dr_tf_coil_outboard and update all referenc…
Browse files Browse the repository at this point in the history
…es accordingly
  • Loading branch information
chris-ashe committed Nov 12, 2024
1 parent a53716a commit f7e9c51
Show file tree
Hide file tree
Showing 24 changed files with 181 additions and 131 deletions.
2 changes: 1 addition & 1 deletion documentation/proc-pages/eng-models/machine-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ depending on the switches used.
Gap 1.900 16.652 (gapsto)
Thermal shield, outboard 0.050 16.702 (thshield_ob) IP
Gap 0.050 16.752 (tftsgap) IP
TF coil outboard leg 1.400 18.152 (tfthko)
TF coil outboard leg 1.400 18.152 (dr_tf_coil_outboard)
```

Expand Down
2 changes: 1 addition & 1 deletion documentation/proc-pages/eng-models/pf-coil.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ into account snull and other recent changes e.g. rclsnorm)
*Z* = $\pm$(`hmax` * `tfcth` + 0.86)

`ipfloc(j)` = 3: PF coils are placed radially outside the TF coils (any number of groups);<br>
*R* = `rtot` + `tfthko`/2 + `routr`<br>
*R* = `rtot` + `dr_tf_coil_outboard`/2 + `routr`<br>
*Z* = $\pm$(`rminor` * `zref(j)`

The void fraction (for coolant) in each coil `i`'s winding pack is given by `vf(i)`.
Expand Down
27 changes: 18 additions & 9 deletions process/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def portsz(self):
a = 1e10

# Radial thickness of outboard TF coil leg (m)
b = build_variables.tfthko
b = build_variables.dr_tf_coil_outboard
try:
assert b < np.inf
except AssertionError:
Expand Down Expand Up @@ -1823,9 +1823,11 @@ def calculate_radial_build(self, output: bool) -> None:

# Thickness of outboard TF coil legs
if tfcoil_variables.i_tf_sup != 1:
build_variables.tfthko = build_variables.tfootfi * build_variables.tfcth
build_variables.dr_tf_coil_outboard = (
build_variables.tfootfi * build_variables.tfcth
)
else:
build_variables.tfthko = build_variables.tfcth
build_variables.dr_tf_coil_outboard = build_variables.tfcth

# Radius to centre of outboard TF coil legs
build_variables.r_tf_outboard_mid = (
Expand All @@ -1835,12 +1837,13 @@ def calculate_radial_build(self, output: bool) -> None:
+ build_variables.gapomin
+ build_variables.thshield_ob
+ build_variables.tftsgap
+ 0.5e0 * build_variables.tfthko
+ 0.5e0 * build_variables.dr_tf_coil_outboard
)

# TF coil horizontal build_variables.bore [m]
build_variables.dr_tf_inner_bore = (
build_variables.r_tf_outboard_mid - 0.5e0 * build_variables.tfthko
build_variables.r_tf_outboard_mid
- 0.5e0 * build_variables.dr_tf_coil_outboard
) - (build_variables.r_tf_inboard_mid - 0.5e0 * build_variables.tfcth)

(
Expand All @@ -1857,15 +1860,16 @@ def calculate_radial_build(self, output: bool) -> None:
build_variables.r_tf_outboard_mid = r_tf_outboard_midl
build_variables.gapsto = (
build_variables.r_tf_outboard_mid
- 0.5e0 * build_variables.tfthko
- 0.5e0 * build_variables.dr_tf_coil_outboard
- build_variables.d_vv_out
- build_variables.rsldo
- build_variables.thshield_ob
- build_variables.tftsgap
- build_variables.vvblgap
)
build_variables.dr_tf_inner_bore = (
build_variables.r_tf_outboard_mid - 0.5e0 * build_variables.tfthko
build_variables.r_tf_outboard_mid
- 0.5e0 * build_variables.dr_tf_coil_outboard
) - (build_variables.r_tf_inboard_mid - 0.5e0 * build_variables.tfcth)
else:
build_variables.gapsto = build_variables.gapomin
Expand Down Expand Up @@ -2284,9 +2288,14 @@ def calculate_radial_build(self, output: bool) -> None:
["Gap", "tftsgap", build_variables.tftsgap, radius]
)

radius = radius + build_variables.tfthko
radius = radius + build_variables.dr_tf_coil_outboard
radial_build_data.append(
["TF coil outboard leg", "tfthko", build_variables.tfthko, radius]
[
"TF coil outboard leg",
"dr_tf_coil_outboard",
build_variables.dr_tf_coil_outboard,
radius,
]
)

for description, variable, thickness, radius in radial_build_data:
Expand Down
8 changes: 6 additions & 2 deletions process/buildings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def __init__(self) -> None:
def run(self, output: bool = False):
# Find TF coil radial positions
# outboard edge: outboard mid-leg radial position + half-thickness of outboard leg
tfro = build_variables.r_tf_outboard_mid + (build_variables.tfthko * 0.5e0)
tfro = build_variables.r_tf_outboard_mid + (
build_variables.dr_tf_coil_outboard * 0.5e0
)
# inboard edge: inboard mid-leg radial position - half-thickness of inboard leg
tfri = build_variables.r_tf_inboard_mid - (build_variables.tfcth * 0.5e0)

Expand All @@ -43,7 +45,9 @@ def run(self, output: bool = False):

# Find full height of TF coil (m)
# = 2 * (mid-plane to TF coil inside edge + thickness of coil)
tf_vertical_dim = 2.0e0 * (build_variables.hmax + build_variables.tfthko)
tf_vertical_dim = 2.0e0 * (
build_variables.hmax + build_variables.dr_tf_coil_outboard
)

# Find mass of each TF coil, in tonnes
tfmtn = 1.0e-3 * tfcoil_variables.whttf / tfcoil_variables.n_tf
Expand Down
4 changes: 2 additions & 2 deletions process/io/mfile_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"shldoth",
"gapsto",
"tftsgap",
"tfthko",
"dr_tf_coil_outboard",
"etath",
"pgrossmw",
"pnetelmw",
Expand Down Expand Up @@ -258,7 +258,7 @@
"d_vv_out",
"gapsto",
"tftsgap",
"tfthko",
"dr_tf_coil_outboard",
"vgap_xpoint_divertor",
"divfix",
"d_vv_bot",
Expand Down
3 changes: 2 additions & 1 deletion process/io/obsolete_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"itfsup": "i_tf_sup",
"r_tf_inleg_mid": "r_tf_inboard_mid",
"rtot": "r_tf_outboard_mid",
"a_tf_inboard": "tfareain",
"a_tf_inboard": "a_tf_inboard",
"r_tf_inleg_in": "r_tf_inleg_in",
"r_tf_inleg_out": "r_tf_inleg_out",
"a_tf_wp": "awpc",
Expand Down Expand Up @@ -127,6 +127,7 @@
"ftrit": "f_tritium",
"fhe3": "f_helium3",
"falpha": "f_alpha_plasma",
"tfthko": "dr_tf_coil_outboard",
}

OBS_VARS_HELP = {
Expand Down
10 changes: 5 additions & 5 deletions process/io/plot_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def parse_args(args):
"gapsto",
"thshield_ob",
"tftsgap",
"tfthko",
"dr_tf_coil_outboard",
]

vertical_lower = [
Expand Down Expand Up @@ -544,7 +544,7 @@ def toroidal_cross_section(axis, mfile_data, scan, demo_ranges, colour_scheme):
angu = ang + spacing / 2
r1, null = cumulative_radial_build2("gapoh", mfile_data, scan)
r2, null = cumulative_radial_build2("tfcth", mfile_data, scan)
r4, r3 = cumulative_radial_build2("tfthko", mfile_data, scan)
r4, r3 = cumulative_radial_build2("dr_tf_coil_outboard", mfile_data, scan)

# Coil width
w = r2 * np.tan(spacing / 2)
Expand Down Expand Up @@ -585,7 +585,7 @@ def toroidal_cross_section(axis, mfile_data, scan, demo_ranges, colour_scheme):
if (iefrf == 5) or (iefrf == 8):
# Neutral beam geometry
a = w
b = tfthko
b = dr_tf_coil_outboard
c = beamwd + 2 * nbshield
d = r3
e = np.sqrt(a**2 + (d + b) ** 2)
Expand Down Expand Up @@ -3050,7 +3050,7 @@ def main(args=None):
global shldoth
global ddwi
global gapsto
global tfthko
global dr_tf_coil_outboard
global rdewex
global zdewex
global ddwex
Expand All @@ -3071,7 +3071,7 @@ def main(args=None):
blnkoth = m_file.data["blnkoth"].get_scan(scan)
shldoth = m_file.data["shldoth"].get_scan(scan)
gapsto = m_file.data["gapsto"].get_scan(scan)
tfthko = m_file.data["tfthko"].get_scan(scan)
dr_tf_coil_outboard = m_file.data["dr_tf_coil_outboard"].get_scan(scan)
rdewex = m_file.data["rdewex"].get_scan(scan)
zdewex = m_file.data["zdewex"].get_scan(scan)
ddwex = m_file.data["ddwex"].get_scan(scan)
Expand Down
2 changes: 1 addition & 1 deletion process/io/plot_radial_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_radial_build(m_file):
"gapsto",
"thshield_ob",
"tftsgap",
"tfthko",
"dr_tf_coil_outboard",
]
if int(m_file.data["tf_in_cs"].get_scan(-1)) == 1:
radial_labels[1] = "tfcth"
Expand Down
8 changes: 5 additions & 3 deletions process/pfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def pfcoil(self):
# Scale PF coil locations
signn[0] = 1.0e0
signn[1] = -1.0e0
pf.rclsnorm = bv.r_tf_outboard_mid + 0.5e0 * bv.tfthko + pfv.routr
pf.rclsnorm = bv.r_tf_outboard_mid + 0.5e0 * bv.dr_tf_coil_outboard + pfv.routr

# Place the PF coils:

Expand Down Expand Up @@ -914,7 +914,9 @@ def tf_pf_collision_detector(self):
if pf.rcls[ii, ij] <= ( # Outboard TF coil collision
pf.rclsnorm - pfv.routr + pfv.rpf[i]
) and pf.rcls[ii, ij] >= (
bv.r_tf_outboard_mid - (0.5 * bv.tfthko) - pfv.rpf[i]
bv.r_tf_outboard_mid
- (0.5 * bv.dr_tf_coil_outboard)
- pfv.rpf[i]
):
pf_tf_collision += 1
if pf.rcls[ii, ij] <= ( # Inboard TF coil collision
Expand All @@ -931,7 +933,7 @@ def tf_pf_collision_detector(self):
if ( # Vertical TF coil collision
abs(pf.zcls[ii, ij]) <= bv.hpfu + pfv.rpf[i]
and abs(pf.zcls[ii, ij])
>= bv.hpfu - (0.5 * bv.tfthko) - pfv.rpf[i]
>= bv.hpfu - (0.5 * bv.dr_tf_coil_outboard) - pfv.rpf[i]
):
pf_tf_collision += 1

Expand Down
Loading

0 comments on commit f7e9c51

Please sign in to comment.