Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2856654
Add VacuumVessel class and integrate into Caller model
chris-ashe Dec 5, 2025
c8f1ad4
Add calculate_dshaped_vessel_volumes method to VacuumVessel class
chris-ashe Dec 5, 2025
223eaa8
Add calculate_elliptical_vessel_volumes method to VacuumVessel class
chris-ashe Dec 5, 2025
134a43c
:fire: Remove now redundant vacuum calcs from blanket library
chris-ashe Jan 7, 2026
25635e0
Refactor BlanketLibrary: remove vacuum vessel calculations and update…
chris-ashe Jan 20, 2026
4dfb4a2
Add tests for DShaped vessel volume calculations in vacuum module
chris-ashe Jan 20, 2026
3252aeb
Add Shield class with calculate_shield_half_height method
chris-ashe Jan 23, 2026
c56de6c
Add calculate_dshaped_shield_volumes method to Shield class
chris-ashe Jan 23, 2026
06496a5
Add calculate_dshaped_shield_areas method to Shield class
chris-ashe Jan 23, 2026
64e913d
Add calculate_elliptical_shield_volumes method to Shield class
chris-ashe Jan 23, 2026
dcfe308
Add calculate_elliptical_shield_areas method to Shield class
chris-ashe Jan 23, 2026
9ec634c
Add Shield model integration to Caller and Models classes
chris-ashe Jan 23, 2026
fae93af
Implement shield area and volume calculations in run method of Shield…
chris-ashe Jan 23, 2026
d434e7b
Refactor BlanketLibrary to remove shield component calculations and s…
chris-ashe Jan 23, 2026
c03473b
Add unit test for elliptical shield volumes calculation
chris-ashe Jan 23, 2026
be1dc32
Add unit test for elliptical shield areas calculation
chris-ashe Jan 23, 2026
2976730
Add unit test for D-shaped shield volumes calculation
chris-ashe Jan 23, 2026
e31d32a
Add unit test for D-shaped shield areas calculation
chris-ashe Jan 23, 2026
9c4b508
Remove redundant D-shaped component parameters from test cases
chris-ashe Jan 23, 2026
35f690c
Remove redundant EllipticalComponentParam test cases
chris-ashe Jan 23, 2026
51f8c08
Post rebase changes
chris-ashe Jan 29, 2026
c6b1da3
Remove redundant shield surface parameters from ApplyCoverageFactorsP…
chris-ashe Jan 29, 2026
472208a
Requested style changes
chris-ashe Jan 30, 2026
dde3844
Add vacuum vessel mass calculation to VacuumVessel class
chris-ashe Jan 30, 2026
6280dc6
Add docstring to vacuum vessel volume calculation method
chris-ashe Jan 30, 2026
c76772d
🔄 Rename `component_half_height` method to `calculate_blkt_half_heigh…
chris-ashe Jan 30, 2026
602eede
Refactor `calculate_blkt_half_height` method to accept parameters dir…
chris-ashe Jan 30, 2026
06e4b94
Add methods to calculate D-shaped blanket areas and volumes
chris-ashe Jan 30, 2026
c354072
Add methods to calculate elliptical blanket areas and volumes
chris-ashe Jan 30, 2026
17b91cf
Add `plot_blkt_structure` function to visualize blanket and first wal…
chris-ashe Jan 30, 2026
0343e87
Refactor blanket area and volume calculations to include full coverag…
chris-ashe Jan 30, 2026
8fefcee
Add output function for blanket volumes and areas in blanket_library;…
chris-ashe Jan 30, 2026
e74a3b5
Add surface area and volume calculations for blanket with full covera…
chris-ashe Jan 30, 2026
026f41d
Add blanket arc radius variables to fwbs_variables module
chris-ashe Jan 30, 2026
5526a2b
Add blanket arc radius calculations and update plotting to visualize …
chris-ashe Jan 30, 2026
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
787 changes: 569 additions & 218 deletions process/blanket_library.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions process/caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ def _call_models_once(self, xc: np.ndarray) -> None:
# First wall model
self.models.fw.run()

self.models.shield.run()

self.models.vacuum_vessel.run()

# Blanket model
"""Blanket switch values
No. | model
Expand Down
3 changes: 0 additions & 3 deletions process/cryostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ def external_cryo_geometry() -> None:
* (build_variables.dr_cryostat + fwbs_variables.z_cryostat_half_inside)
) - (fwbs_variables.vol_cryostat_internal)

# Vacuum vessel mass (kg)
fwbs_variables.m_vv = fwbs_variables.vol_vv * fwbs_variables.den_steel

# Sum of internal vacuum vessel and cryostat masses (kg)
fwbs_variables.dewmkg = (
fwbs_variables.vol_vv + fwbs_variables.vol_cryostat
Expand Down
14 changes: 14 additions & 0 deletions process/data_structure/fwbs_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,14 @@
dr_fw_wall: float = None
"""wall thickness of first wall coolant channels [m]"""

r_blkt_arc_1: float = None
"""First blanket arc radius [m]"""

r_blkt_arc_2: float = None
"""Second blanket arc radius [m]"""

r_blkt_arc_3: float = None
"""Third blanket arc radius [m]"""

radius_fw_channel: float = None
"""radius of first wall cooling channels [m]"""
Expand Down Expand Up @@ -989,6 +997,9 @@ def init_fwbs_variables():
i_blkt_coolant_type, \
i_fw_coolant_type, \
dr_fw_wall, \
r_blkt_arc_1, \
r_blkt_arc_2, \
r_blkt_arc_3, \
radius_fw_channel, \
dx_fw_module, \
temp_fw_coolant_in, \
Expand Down Expand Up @@ -1184,6 +1195,9 @@ def init_fwbs_variables():
i_blkt_coolant_type = 1
i_fw_coolant_type = "helium"
dr_fw_wall = 0.003
r_blkt_arc_1 = 0.0
r_blkt_arc_2 = 0.0
r_blkt_arc_3 = 0.0
radius_fw_channel = 0.006
dx_fw_module = 0.02
temp_fw_coolant_in = 573.0
Expand Down
2 changes: 2 additions & 0 deletions process/dcll.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,8 @@ def write_output(self):
# Component Volumes
po.osubhd(self.outfile, "Component Volumes :")

self.output_blkt_volumes_and_areas()

po.ovarrf(
self.outfile,
"First Wall Armour Volume (m3)",
Expand Down
3 changes: 3 additions & 0 deletions process/hcpb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,9 @@ def st_centrepost_nuclear_heating(self, pneut, sh_width):

def write_output(self):
po.oheadr(self.outfile, "First wall and blanket : CCFE HCPB model")

self.output_blkt_volumes_and_areas()

po.osubhd(self.outfile, "Blanket Composition by volume :")

po.ovarrf(
Expand Down
187 changes: 145 additions & 42 deletions process/io/plot_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10596,8 +10596,8 @@ def plot_tf_stress(axis: plt.Axes, mfile: mf.MFile):
def plot_blkt_pipe_bends(fig, m_file, scan: int):
"""Plot the blanket pipe bends on the given axis, with axes in mm."""

ax_90 = fig.add_subplot(331)
ax_180 = fig.add_subplot(334)
ax_90 = fig.add_subplot(341)
ax_180 = fig.add_subplot(342)

# Get pipe radius from m_file, fallback to 0.1 m
r = m_file.get("radius_blkt_channel", scan=scan)
Expand Down Expand Up @@ -12743,6 +12743,148 @@ def plot_inequality_constraint_equations(axis: plt.Axes, m_file: mf.MFile, scan:
axis.set_xticklabels([])


def plot_blkt_structure(
ax: plt.Axes,
fig: plt.Figure,
m_file: mf.MFile,
scan: int,
radial_build: dict[str, float],
colour_scheme: Literal[1, 2],
):
"""Plot the BLKT structure on the given axis."""

rmajor = m_file.get("rmajor", scan=scan)

plot_blanket(ax, m_file, scan, radial_build, colour_scheme)
plot_firstwall(ax, m_file, scan, radial_build, colour_scheme)
ax.set_xlabel("Radial position [m]")
ax.set_ylabel("Vertical position [m]")
ax.set_title("Blanket and First Wall Poloidal Cross-Section")
ax.minorticks_on()
ax.grid(which="minor", linestyle=":", linewidth=0.5, alpha=0.5)
# Plot major radius line (vertical dashed line at rmajor)
ax.axvline(
m_file.get("rminor", scan=scan),
color="black",
linestyle="--",
linewidth=1.5,
label="Major Radius $R_0$",
)
# Plot a horizontal line at dz_blkt_half (blanket half height)
dz_blkt_half = m_file.get("dz_blkt_half", scan=scan)
ax.axhline(
dz_blkt_half,
color="purple",
linestyle="--",
linewidth=1.5,
label="Blanket Half Height",
)
ax.axhline(
-dz_blkt_half,
color="purple",
linestyle="--",
linewidth=1.5,
label="Blanket Half Height",
)

ax.annotate(
"",
xy=(rmajor, dz_blkt_half),
xytext=(rmajor, -dz_blkt_half),
arrowprops={"arrowstyle": "<->", "color": "black"},
)

# Add a label for the internal coil width
ax.text(
rmajor,
0.0,
f"{2 * dz_blkt_half:.3f} m",
fontsize=7,
color="black",
rotation=270,
verticalalignment="center",
horizontalalignment="center",
bbox={"boxstyle": "round", "facecolor": "pink", "alpha": 1.0},
zorder=101, # Ensure label is on top of all plots
)

# Plot midplane line (horizontal dashed line at Z=0)
ax.axhline(
0.0,
color="black",
linestyle="--",
linewidth=1.5,
label="Midplane",
)

# Plot the points as black dots, number them, and connect them with lines
xs = [m_file.get(f"r_blkt_arc_{i}", scan=scan) for i in range(1, 4)]
for i, (x,) in enumerate(zip(xs, strict=False), 1):
ax.plot(x, 0.0, "ko", markersize=8)
ax.text(
x,
0.0,
str(i),
color="red",
fontsize=5,
ha="center",
va="center",
fontweight="bold",
)

textstr_blkt_areas = (
f"$\\mathbf{{Blanket \\ Areas:}}$\n\n"
f"Inboard blanket, with holes and gaps: {m_file.get('a_blkt_inboard_surface', scan=scan):,.3f} $\\text{{m}}^2$ \n"
f"Outboard blanket, with holes and gaps: {m_file.get('a_blkt_outboard_surface', scan=scan):,.3f} $\\text{{m}}^2$ \n"
f"Total blanket, with holes and gaps: {m_file.get('a_blkt_total_surface', scan=scan):,.3f} $\\text{{m}}^2$ \n\n"
f"Inboard blanket, full coverage: {m_file.get('a_blkt_inboard_surface_full_coverage', scan=scan):,.3f} $\\text{{m}}^2$ \n"
f"Outboard blanket, full coverage: {m_file.get('a_blkt_outboard_surface_full_coverage', scan=scan):,.3f} $\\text{{m}}^2$ \n"
f"Total blanket, full coverage: {m_file.get('a_blkt_total_surface_full_coverage', scan=scan):,.3f} $\\text{{m}}^2$ "
)

ax.text(
0.05,
0.3,
textstr_blkt_areas,
fontsize=9,
verticalalignment="bottom",
horizontalalignment="left",
transform=fig.transFigure,
bbox={
"boxstyle": "round",
"facecolor": "wheat",
"alpha": 1.0,
"linewidth": 2,
},
)

textstr_blkt_volumes = (
f"$\\mathbf{{Blanket \\ Volumes:}}$\n\n"
f"Inboard blanket, with holes and gaps: {m_file.get('vol_blkt_inboard', scan=scan):,.3f} $\\text{{m}}^3$ \n"
f"Outboard blanket, with holes and gaps: {m_file.get('vol_blkt_outboard', scan=scan):,.3f} $\\text{{m}}^3$ \n"
f"Total blanket, with holes and gaps: {m_file.get('vol_blkt_total', scan=scan):,.3f} $\\text{{m}}^3$ \n\n"
f"Inboard blanket, full coverage: {m_file.get('vol_blkt_inboard_full_coverage', scan=scan):,.3f} $\\text{{m}}^3$ \n"
f"Outboard blanket, full coverage: {m_file.get('vol_blkt_outboard_full_coverage', scan=scan):,.3f} $\\text{{m}}^3$ \n"
f"Total blanket, full coverage: {m_file.get('vol_blkt_total_full_coverage', scan=scan):,.3f} $\\text{{m}}^3$ "
)

ax.text(
0.05,
0.05,
textstr_blkt_volumes,
fontsize=9,
verticalalignment="bottom",
horizontalalignment="left",
transform=fig.transFigure,
bbox={
"boxstyle": "round",
"facecolor": "wheat",
"alpha": 1.0,
"linewidth": 2,
},
)


def main_plot(
figs: list[Axes],
m_file: mf.MFile,
Expand Down Expand Up @@ -13012,46 +13154,7 @@ def main_plot(

plot_blkt_pipe_bends(figs[27], m_file, scan)
ax_blanket = figs[27].add_subplot(122, aspect="equal")
plot_blanket(ax_blanket, m_file, scan, radial_build, colour_scheme)
plot_firstwall(ax_blanket, m_file, scan, radial_build, colour_scheme)
ax_blanket.set_xlabel("Radial position [m]")
ax_blanket.set_ylabel("Vertical position [m]")
ax_blanket.set_title("Blanket and First Wall Poloidal Cross-Section")
ax_blanket.minorticks_on()
ax_blanket.grid(which="minor", linestyle=":", linewidth=0.5, alpha=0.5)
# Plot major radius line (vertical dashed line at rmajor)
ax_blanket.axvline(
m_file.get("rminor", scan=scan),
color="black",
linestyle="--",
linewidth=1.5,
label="Major Radius $R_0$",
)
# Plot a horizontal line at dz_blkt_half (blanket half height)
dz_blkt_half = m_file.get("dz_blkt_half", scan=scan)
ax_blanket.axhline(
dz_blkt_half,
color="purple",
linestyle="--",
linewidth=1.5,
label="Blanket Half Height",
)
ax_blanket.axhline(
-dz_blkt_half,
color="purple",
linestyle="--",
linewidth=1.5,
label="Blanket Half Height",
)

# Plot midplane line (horizontal dashed line at Z=0)
ax_blanket.axhline(
0.0,
color="black",
linestyle="--",
linewidth=1.5,
label="Midplane",
)
plot_blkt_structure(ax_blanket, figs[27], m_file, scan, radial_build, colour_scheme)

plot_main_power_flow(
figs[28].add_subplot(111, aspect="equal"), m_file, scan, figs[28]
Expand Down
5 changes: 4 additions & 1 deletion process/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@
from process.pulse import Pulse
from process.resistive_tf_coil import AluminiumTFCoil, CopperTFCoil, ResistiveTFCoil
from process.scan import Scan
from process.shield import Shield
from process.stellarator import Neoclassics, Stellarator
from process.structure import Structure
from process.superconducting_tf_coil import SuperconductingTFCoil
from process.tf_coil import TFCoil
from process.vacuum import Vacuum
from process.vacuum import Vacuum, VacuumVessel
from process.water_use import WaterUse

os.environ["PYTHON_PROCESS_ROOT"] = os.path.join(os.path.dirname(__file__))
Expand Down Expand Up @@ -664,8 +665,10 @@ def __init__(self):
self.availability = Availability()
self.buildings = Buildings()
self.vacuum = Vacuum()
self.vacuum_vessel = VacuumVessel()
self.water_use = WaterUse()
self.pulse = Pulse()
self.shield = Shield()
self.ife = IFE(availability=self.availability, costs=self.costs)
self.plasma_profile = PlasmaProfile()
self.fw = Fw()
Expand Down
Loading
Loading