Skip to content

Commit 5526a2b

Browse files
committed
Add blanket arc radius calculations and update plotting to visualize arc points
1 parent 026f41d commit 5526a2b

2 files changed

Lines changed: 50 additions & 3 deletions

File tree

process/blanket_library.py

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ def component_volumes(self):
107107
build_variables.a_blkt_inboard_surface_full_coverage,
108108
build_variables.a_blkt_outboard_surface_full_coverage,
109109
build_variables.a_blkt_total_surface_full_coverage,
110+
fwbs_variables.r_blkt_arc_1,
111+
fwbs_variables.r_blkt_arc_2,
112+
fwbs_variables.r_blkt_arc_3,
110113
) = self.calculate_elliptical_blkt_areas(
111114
rmajor=physics_variables.rmajor,
112115
rminor=physics_variables.rminor,
@@ -394,7 +397,7 @@ def calculate_elliptical_blkt_areas(
394397
dr_shld_outboard: float,
395398
dr_blkt_outboard: float,
396399
dz_blkt_half: float,
397-
) -> tuple[float, float, float]:
400+
) -> tuple[float, float, float, float, float, float]:
398401
"""Calculate elliptical blanket surface areas.
399402
400403
:param rmajor: Major radius of the plasma (m)
@@ -418,7 +421,8 @@ def calculate_elliptical_blkt_areas(
418421
:param dz_blkt_half: Half-height of the blanket (m)
419422
:type dz_blkt_half: float
420423
421-
:return: Tuple containing inboard blanket surface area (m²), outboard blanket surface area (m²), and total blanket surface area (m²)
424+
:return: Tuple containing inboard blanket surface area (m²), outboard blanket surface area (m²), and total blanket surface area (m²),
425+
and three blanket arc radii (m)
422426
423427
"""
424428
# Major radius to centre of inboard and outboard ellipses (m)
@@ -445,7 +449,14 @@ def calculate_elliptical_blkt_areas(
445449
a_blkt_total_surface,
446450
) = eshellarea(r1, r2, r3, dz_blkt_half)
447451

448-
return a_blkt_inboard_surface, a_blkt_outboard_surface, a_blkt_total_surface
452+
return (
453+
a_blkt_inboard_surface,
454+
a_blkt_outboard_surface,
455+
a_blkt_total_surface,
456+
r1,
457+
r2,
458+
r3,
459+
)
449460

450461
@staticmethod
451462
def calculate_elliptical_blkt_volumes(
@@ -707,6 +718,27 @@ def output_blkt_volumes_and_areas(self):
707718
build_variables.a_blkt_total_surface_full_coverage,
708719
)
709720

721+
po.oblnkl(self.outfile)
722+
723+
po.ovarst(
724+
self.outfile,
725+
"First radial blanket arc point (m)",
726+
"(r_blkt_arc_1)",
727+
fwbs_variables.r_blkt_arc_1,
728+
)
729+
po.ovarst(
730+
self.outfile,
731+
"Second radial blanket arc point (m)",
732+
"(r_blkt_arc_2)",
733+
fwbs_variables.r_blkt_arc_2,
734+
)
735+
po.ovarst(
736+
self.outfile,
737+
"Third radial blanket arc point (m)",
738+
"(r_blkt_arc_3)",
739+
fwbs_variables.r_blkt_arc_3,
740+
)
741+
710742
def primary_coolant_properties(self, output: bool):
711743
"""Calculates the fluid properties of the Primary Coolant in the FW and BZ.
712744
Uses middle value of input and output temperatures of coolant.

process/io/plot_proc.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12817,6 +12817,21 @@ def plot_blkt_structure(
1281712817
label="Midplane",
1281812818
)
1281912819

12820+
# Plot the points as black dots, number them, and connect them with lines
12821+
xs = [m_file.get(f"r_blkt_arc_{i}", scan=scan) for i in range(1, 4)]
12822+
for i, (x,) in enumerate(zip(xs, strict=False), 1):
12823+
ax.plot(x, 0.0, "ko", markersize=8)
12824+
ax.text(
12825+
x,
12826+
0.0,
12827+
str(i),
12828+
color="red",
12829+
fontsize=5,
12830+
ha="center",
12831+
va="center",
12832+
fontweight="bold",
12833+
)
12834+
1282012835
textstr_blkt_areas = (
1282112836
f"$\\mathbf{{Blanket \\ Areas:}}$\n\n"
1282212837
f"Inboard blanket, with holes and gaps: {m_file.get('a_blkt_inboard_surface', scan=scan):,.3f} $\\text{{m}}^2$ \n"

0 commit comments

Comments
 (0)