From 39e2d7aecc8a6338da52a360308a756ee10ce7f7 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 14 Oct 2025 14:27:37 +0100 Subject: [PATCH 1/4] Add hydraulic diameter calculations for blanket channels in DCLL and CCFE_HCPB classes --- process/dcll.py | 7 +++++++ process/fw.py | 7 +++++++ process/hcpb.py | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/process/dcll.py b/process/dcll.py index 636bb90bc8..8f1198c5af 100644 --- a/process/dcll.py +++ b/process/dcll.py @@ -89,6 +89,13 @@ class DCLL(BlanketLibrary): def run(self, output: bool): self.component_volumes() + dia_blkt_channel = self.pipe_hydraulic_diameter(i_channel_shape=1) + fwbs_variables.radius_blkt_channel = dia_blkt_channel / 2 + ( + fwbs_variables.radius_blkt_channel_90_bend, + fwbs_variables.radius_blkt_channel_180_bend, + ) = self.calculate_pipe_bend_radius(i_ps=1) + self.primary_coolant_properties(output=output) self.liquid_breeder_properties(output=output) self.dcll_neutronics_and_power(output=output) diff --git a/process/fw.py b/process/fw.py index 2be2d6e36a..30c21b4c28 100644 --- a/process/fw.py +++ b/process/fw.py @@ -4,6 +4,7 @@ from process import constants from process import process_output as po +from process.blanket_library import BlanketLibrary from process.coolprop_interface import FluidProperties from process.data_structure import blanket_library, build_variables, fwbs_variables @@ -13,6 +14,7 @@ class Fw: def __init__(self) -> None: self.outfile = constants.NOUT + self.blanket_methods = BlanketLibrary(fw=self) def run(self): ( @@ -27,6 +29,11 @@ def run(self): self.set_fw_geometry() + ( + fwbs_variables.radius_fw_channel_90_bend, + fwbs_variables.radius_fw_channel_180_bend, + ) = self.blanket_methods.calculate_pipe_bend_radius(i_ps=1) + def set_fw_geometry(self): build_variables.dr_fw_inboard = ( 2 * fwbs_variables.radius_fw_channel + 2 * fwbs_variables.dr_fw_wall diff --git a/process/hcpb.py b/process/hcpb.py index cf7a648e4e..f86d046148 100644 --- a/process/hcpb.py +++ b/process/hcpb.py @@ -45,6 +45,13 @@ def run(self, output: bool): # Calculate blanket, shield, vacuum vessel and cryostat volumes self.component_volumes() + dia_blkt_channel = self.pipe_hydraulic_diameter(i_channel_shape=1) + fwbs_variables.radius_blkt_channel = dia_blkt_channel / 2 + ( + fwbs_variables.radius_blkt_channel_90_bend, + fwbs_variables.radius_blkt_channel_180_bend, + ) = self.calculate_pipe_bend_radius(i_ps=1) + # Centrepost neutronics if physics_variables.itart == 1: # CP radius at the point of maximum sield radius [m] From 1edb9fc5c684a1e08b1c56c97ea4b2ebd1137093 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 14 Oct 2025 14:34:42 +0100 Subject: [PATCH 2/4] :memo: Add naming conventions for Darcy Friction Factors and Elbow Bend Coefficients --- documentation/development/standards.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/documentation/development/standards.md b/documentation/development/standards.md index b2bb21219d..306e6c9e32 100644 --- a/documentation/development/standards.md +++ b/documentation/development/standards.md @@ -253,6 +253,12 @@ This should be used for units of $\text{kg} \cdot \text{m}^{-2}\text{s}^{-1}$ --------------------- +##### Darcy Friction Factors + +- Darcy Friction Factors for fluid flow numbers should start with the `darcy_frict_` prefix + +--------------------- + ##### Pressures - Pressures should start with the `pres_` prefix From 52a4cb708725a1a7e773d66ccb8b193e4bbe06cd Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 14 Oct 2025 15:40:46 +0100 Subject: [PATCH 3/4] Add blanket half height plotting and output in blanket and HCPB modules --- process/blanket_library.py | 8 +++++++- process/hcpb.py | 7 +++++++ process/io/plot_proc.py | 41 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/process/blanket_library.py b/process/blanket_library.py index 34c1c4a693..fc16881d13 100644 --- a/process/blanket_library.py +++ b/process/blanket_library.py @@ -535,6 +535,7 @@ def primary_coolant_properties(self, output: bool): fwbs_variables.temp_blkt_coolant_out, "OP ", ) + else: po.ovarre( self.outfile, @@ -2153,7 +2154,12 @@ def thermo_hydraulic_model(self, output: bool): # BB po.osubhd(self.outfile, "Breeding Blanket (primary): ") - + po.ovarre( + self.outfile, + "Blanket half height (m)", + "(dz_blkt_half)", + blanket_library.dz_blkt_half, + ) po.ovarin( self.outfile, "Blanket coolant type (1=He, 2=H20)", diff --git a/process/hcpb.py b/process/hcpb.py index f86d046148..0bbbb515c3 100644 --- a/process/hcpb.py +++ b/process/hcpb.py @@ -3,6 +3,7 @@ import numpy as np import process.blanket_library as blanket_library +import process.data_structure.blanket_library as blanket_vars from process import constants from process import ( process_output as po, @@ -1546,6 +1547,12 @@ def write_output(self): "(abktflnc)", cost_variables.abktflnc, ) + po.ovarre( + self.outfile, + "Blanket half height (m)", + "(dz_blkt_half)", + blanket_vars.dz_blkt_half, + ) po.ovarre( self.outfile, "No of inboard blanket modules poloidally", diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 26a7291906..ef28078b72 100644 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -11989,6 +11989,47 @@ def main_plot( plot_fw_90_deg_pipe_bend(fig21.add_subplot(337), m_file_data, scan) plot_blkt_pipe_bends(fig22, m_file_data, scan) + ax_blanket = fig22.add_subplot(122, aspect="equal") + plot_blanket(ax_blanket, m_file_data, scan, colour_scheme) + plot_firstwall(ax_blanket, m_file_data, scan, 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( + rmajor, + 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_data.data["dz_blkt_half"].get_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_main_power_flow( fig23.add_subplot(111, aspect="equal"), m_file_data, scan, fig23 From 321018718d2fee448a7434768c8cb38828dd490a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 29 Oct 2025 15:05:15 +0000 Subject: [PATCH 4/4] Fix variable name for blanket library reference in Fw class --- process/fw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/process/fw.py b/process/fw.py index 30c21b4c28..cda8910b08 100644 --- a/process/fw.py +++ b/process/fw.py @@ -14,7 +14,7 @@ class Fw: def __init__(self) -> None: self.outfile = constants.NOUT - self.blanket_methods = BlanketLibrary(fw=self) + self.blanket_library = BlanketLibrary(fw=self) def run(self): ( @@ -32,7 +32,7 @@ def run(self): ( fwbs_variables.radius_fw_channel_90_bend, fwbs_variables.radius_fw_channel_180_bend, - ) = self.blanket_methods.calculate_pipe_bend_radius(i_ps=1) + ) = self.blanket_library.calculate_pipe_bend_radius(i_ps=1) def set_fw_geometry(self): build_variables.dr_fw_inboard = (