From 5a0fece70ba8f70c7636d2b6400d92e72ae50255 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 13:45:04 +0000 Subject: [PATCH 01/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20`bldgs=5Fsizes`?= =?UTF-8?q?=20to=20`calculate=5Fbuilding=5Fsizes=5Fchapman`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/models/buildings.py | 4 ++-- tests/unit/test_buildings.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/process/models/buildings.py b/process/models/buildings.py index 66aeb6ead5..f6d74f1d66 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -66,7 +66,7 @@ def run(self, output: bool = False): if buildings_variables.i_bldgs_size == 1: # Updated building estimates - self.bldgs_sizes(output, tf_radial_dim, tf_vertical_dim) + self.calculate_building_sizes_chapman(output, tf_radial_dim, tf_vertical_dim) else: # Previous estimation work @@ -406,7 +406,7 @@ def bldgs( return cryv, vrci, rbv, rmbv, wsv, elev - def bldgs_sizes(self, output, tf_radial_dim, tf_vertical_dim): + def calculate_building_sizes_chapman(self, output, tf_radial_dim, tf_vertical_dim): """Subroutine that estimates the sizes (footprints and volumes) of buildings within a fusion power plant. Some estimates are scaled with parameters of the fusion plant, diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index d567052ea7..268eda2c54 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -741,7 +741,7 @@ def test_bldgs_sizes(buildings, bldgssizesparam, monkeypatch): monkeypatch.setattr(physics_variables, "rmajor", bldgssizesparam.rmajor) monkeypatch.setattr(physics_variables, "rminor", bldgssizesparam.rminor) - buildings.bldgs_sizes( + buildings.calculate_building_sizes_chapman( tf_radial_dim=bldgssizesparam.tf_radial_dim, tf_vertical_dim=bldgssizesparam.tf_vertical_dim, output=False, From cec4366325a191a6a03c31537ad06ffbd15ddb0f Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 13:45:46 +0000 Subject: [PATCH 02/28] =?UTF-8?q?=F0=9F=94=84=20Refactor=20building=20size?= =?UTF-8?q?=20calculation=20method=20to=20`calculate=5Fbuilding=5Fsizes=5F?= =?UTF-8?q?1992`=20in=20Buildings=20class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/models/buildings.py | 4 ++-- tests/unit/test_buildings.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/process/models/buildings.py b/process/models/buildings.py index f6d74f1d66..63112309ed 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -77,7 +77,7 @@ def run(self, output: bool = False): buildings_variables.rmbvol, buildings_variables.wsvol, buildings_variables.elevol, - ) = self.bldgs( + ) = self.calculate_building_sizes_1992( output, pfcoil_variables.r_pf_coil_outer_max, pfcoil_variables.m_pf_coil_max, @@ -97,7 +97,7 @@ def run(self, output: bool = False): heat_transport_variables.helpow, ) - def bldgs( + def calculate_building_sizes_1992( self, output: bool, pfr, diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index 268eda2c54..cf9cec8cfb 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -981,7 +981,7 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): monkeypatch.setattr(buildings_variables, "convol", bldgsparam.convol) monkeypatch.setattr(buildings_variables, "volnucb", bldgsparam.volnucb) - cryv, vrci, rbv, rmbv, wsv, elev = buildings.bldgs( + cryv, vrci, rbv, rmbv, wsv, elev = buildings.calculate_building_sizes_1992( output=False, pfr=bldgsparam.pfr, pfm=bldgsparam.pfm, From c4c2b6cca328305f6e240f58ee208cecb48254c1 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 13:50:09 +0000 Subject: [PATCH 03/28] Add BuildingsModel enum and update building size calculation logic for Chapman 2024 --- process/models/buildings.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/process/models/buildings.py b/process/models/buildings.py index 63112309ed..5fc9ea94c0 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -1,4 +1,5 @@ import logging +from enum import IntEnum import numpy as np @@ -25,6 +26,12 @@ logger = logging.getLogger(__name__) +class BuildingsModel(IntEnum): + """Enum for building size estimation models""" + ITER_1992 = 1 + CHAPMAN_2024 = 2 + + class Buildings(Model): """ @@ -64,7 +71,10 @@ def run(self, output: bool = False): # Calculate building areas and volumes - if buildings_variables.i_bldgs_size == 1: + if ( + BuildingsModel(buildings_variables.i_bldgs_size) + == BuildingsModel.CHAPMAN_2024 + ): # Updated building estimates self.calculate_building_sizes_chapman(output, tf_radial_dim, tf_vertical_dim) From cd2f957314d15a242f5152d28bf413d4eb9b4b2b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 13:54:17 +0000 Subject: [PATCH 04/28] Fix BuildingsModel enum values and update building size calculation references in Buildings class --- process/models/buildings.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/process/models/buildings.py b/process/models/buildings.py index 5fc9ea94c0..9156841e45 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -28,8 +28,9 @@ class BuildingsModel(IntEnum): """Enum for building size estimation models""" - ITER_1992 = 1 - CHAPMAN_2024 = 2 + + ITER_1992 = 0 + CHAPMAN_2024 = 1 class Buildings(Model): @@ -44,6 +45,8 @@ def __init__(self): This routine calls the buildings calculations. """ self.outfile = constants.NOUT # output file unit + self.iter_1992 = BuildingsITER1992() + self.chapman_2024 = BuildingsChapman2024() def output(self): self.run(output=True) @@ -76,7 +79,9 @@ def run(self, output: bool = False): == BuildingsModel.CHAPMAN_2024 ): # Updated building estimates - self.calculate_building_sizes_chapman(output, tf_radial_dim, tf_vertical_dim) + self.chapman_2024.calculate_building_sizes_chapman( + output, tf_radial_dim, tf_vertical_dim + ) else: # Previous estimation work @@ -87,7 +92,7 @@ def run(self, output: bool = False): buildings_variables.rmbvol, buildings_variables.wsvol, buildings_variables.elevol, - ) = self.calculate_building_sizes_1992( + ) = self.iter_1992.calculate_building_sizes_1992( output, pfcoil_variables.r_pf_coil_outer_max, pfcoil_variables.m_pf_coil_max, @@ -107,6 +112,8 @@ def run(self, output: bool = False): heat_transport_variables.helpow, ) + +class BuildingsITER1992: def calculate_building_sizes_1992( self, output: bool, @@ -416,6 +423,8 @@ def calculate_building_sizes_1992( return cryv, vrci, rbv, rmbv, wsv, elev + +class BuildingsChapman2024: def calculate_building_sizes_chapman(self, output, tf_radial_dim, tf_vertical_dim): """Subroutine that estimates the sizes (footprints and volumes) of buildings within a fusion power plant. From 638bba73ce0474c0c7570522450ab49b62a870bd Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 13:57:37 +0000 Subject: [PATCH 05/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20`wsvol`=20to=20`v?= =?UTF-8?q?ol=5Fplant=5Fwarm=5Fshop=5Fbuilding`=20and=20update=20reference?= =?UTF-8?q?s=20across=20models=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/data_structure/buildings_variables.py | 6 ++-- process/models/buildings.py | 2 +- process/models/costs/costs.py | 6 ++-- process/models/ife.py | 2 +- tests/unit/test_costs_1990.py | 32 +++++++++---------- tests/unit/test_ife.py | 8 ++--- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index b27b5f6f33..d9ff2ebadc 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -550,7 +550,7 @@ """distance from centre of machine to building wall (m)""" -wsvol: float = None +vol_plant_warm_shop_building: float = None """volume of warm shop building (m3)""" @@ -750,7 +750,7 @@ def init_buildings_variables(): workshop_w, \ workshop_h, \ wrbi, \ - wsvol, \ + vol_plant_warm_shop_building, \ wsvfac, \ a_reactor_bldg, \ a_ee_ps_bldg, \ @@ -905,7 +905,7 @@ def init_buildings_variables(): wgt2 = 1.0e5 wrbi = 0.0 wsvfac = 1.9 - wsvol = 0.0 + vol_plant_warm_shop_building = 0.0 a_reactor_bldg = 8.32e3 a_ee_ps_bldg = 2.133e4 a_aux_services_bldg = 1.0e3 diff --git a/process/models/buildings.py b/process/models/buildings.py index 9156841e45..881f124d16 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -90,7 +90,7 @@ def run(self, output: bool = False): buildings_variables.volrci, buildings_variables.rbvol, buildings_variables.rmbvol, - buildings_variables.wsvol, + buildings_variables.vol_plant_warm_shop_building, buildings_variables.elevol, ) = self.iter_1992.calculate_building_sizes_1992( output, diff --git a/process/models/costs/costs.py b/process/models/costs/costs.py index be7f2198e3..538f6456e0 100644 --- a/process/models/costs/costs.py +++ b/process/models/costs/costs.py @@ -1109,7 +1109,7 @@ def acc21(self): cost_variables.c2142 = ( 1.0e-6 * cost_variables.UCWS - * buildings_variables.wsvol**exprb + * buildings_variables.vol_plant_warm_shop_building**exprb * cmlsa[cost_variables.lsa - 1] ) cost_variables.c214 = cost_variables.c2141 + cost_variables.c2142 @@ -2401,7 +2401,7 @@ def acc2273(self): * cost_variables.UCDTC * ( (cfrht / 1.0e4) ** 0.6e0 - * (buildings_variables.volrci + buildings_variables.wsvol) + * (buildings_variables.volrci + buildings_variables.vol_plant_warm_shop_building) ) ) else: @@ -2416,7 +2416,7 @@ def acc2274(self): cost_variables.c2274 = ( 1.0e-6 * cost_variables.UCNBV - * (buildings_variables.volrci + buildings_variables.wsvol) ** 0.8e0 + * (buildings_variables.volrci + buildings_variables.vol_plant_warm_shop_building) ** 0.8e0 ) # Apply Nth kind factor diff --git a/process/models/ife.py b/process/models/ife.py index 825a921dfd..bdf74b0814 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2386,7 +2386,7 @@ def ifebdg(self, output: bool = False): buildings_variables.rmbvol = rmbv buildings_variables.shovol = buildings_variables.shov buildings_variables.volrci = vrci - buildings_variables.wsvol = wsv + buildings_variables.vol_plant_warm_shop_building = wsv # Total volume of nuclear buildings diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index 1843269b92..ab6a0640c7 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -183,7 +183,7 @@ def acc2273_param(**kwargs): defaults = { "f_plasma_fuel_tritium": 0.0001, "volrci": data_structure.buildings_variables.volrci, - "wsvol": data_structure.buildings_variables.wsvol, + "vol_plant_warm_shop_building": data_structure.buildings_variables.vol_plant_warm_shop_building, "expected": approx(0.0, abs=0.00001), } @@ -205,7 +205,7 @@ def acc2273_params(): acc2273_param( f_plasma_fuel_tritium=0.5, volrci=1299783.4, - wsvol=132304.1, + vol_plant_warm_shop_building=132304.1, expected=approx(74.12, abs=0.01), ), ] @@ -226,7 +226,7 @@ def acc2273_fix(request, monkeypatch, costs): # Mock variables used by acc2273() # Some may be parameterised - monkeypatch.setattr(data_structure.buildings_variables, "wsvol", param["wsvol"]) + monkeypatch.setattr(data_structure.buildings_variables, "vol_plant_warm_shop_building", param["vol_plant_warm_shop_building"]) monkeypatch.setattr(data_structure.buildings_variables, "volrci", param["volrci"]) monkeypatch.setattr( physics_variables, "f_plasma_fuel_tritium", param["f_plasma_fuel_tritium"] @@ -258,7 +258,7 @@ def test_acc2274(monkeypatch, costs): :param monkeypatch: Mock fixture :type monkeypatch: object """ - monkeypatch.setattr(data_structure.buildings_variables, "wsvol", 132304.1) + monkeypatch.setattr(data_structure.buildings_variables, "vol_plant_warm_shop_building", 132304.1) monkeypatch.setattr(data_structure.buildings_variables, "volrci", 1299783.4) monkeypatch.setattr(cost_variables, "fkind", 1) monkeypatch.setattr(cost_variables, "c2274", 0) @@ -711,7 +711,7 @@ class Acc21Param(NamedTuple): convol: Any = None - wsvol: Any = None + vol_plant_warm_shop_building: Any = None ucrb: Any = None @@ -794,7 +794,7 @@ class Acc21Param(NamedTuple): rmbvol=421473.52130148414, admvol=100000, convol=60000, - wsvol=130018.25667917728, + vol_plant_warm_shop_building=130018.25667917728, ucrb=400, ireactor=1, cturbb=38, @@ -839,7 +839,7 @@ class Acc21Param(NamedTuple): rmbvol=423252.94369581528, admvol=100000, convol=60000, - wsvol=130255.93791329287, + vol_plant_warm_shop_building=130255.93791329287, ucrb=400, ireactor=1, cturbb=38, @@ -906,7 +906,7 @@ def test_acc21(acc21param, monkeypatch, costs): monkeypatch.setattr(buildings_variables, "convol", acc21param.convol) - monkeypatch.setattr(buildings_variables, "wsvol", acc21param.wsvol) + monkeypatch.setattr(buildings_variables, "vol_plant_warm_shop_building", acc21param.vol_plant_warm_shop_building) monkeypatch.setattr(cost_variables, "ucrb", acc21param.ucrb) @@ -4477,7 +4477,7 @@ def test_acc2272_rut(acc2272param, monkeypatch, costs): class Acc2273Param(NamedTuple): - wsvol: Any = None + vol_plant_warm_shop_building: Any = None volrci: Any = None @@ -4498,7 +4498,7 @@ class Acc2273Param(NamedTuple): "acc2273param", ( Acc2273Param( - wsvol=130018.25667917728, + vol_plant_warm_shop_building=130018.25667917728, volrci=1205439.8543893537, fkind=1, f_plasma_fuel_tritium=0.5, @@ -4508,7 +4508,7 @@ class Acc2273Param(NamedTuple): expected_c2273=69.115208498727412, ), Acc2273Param( - wsvol=130255.93791329287, + vol_plant_warm_shop_building=130255.93791329287, volrci=1206887.4047542624, fkind=1, f_plasma_fuel_tritium=0.5, @@ -4532,7 +4532,7 @@ def test_acc2273_rut(acc2273param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(buildings_variables, "wsvol", acc2273param.wsvol) + monkeypatch.setattr(buildings_variables, "vol_plant_warm_shop_building", acc2273param.vol_plant_warm_shop_building) monkeypatch.setattr(buildings_variables, "volrci", acc2273param.volrci) @@ -4554,7 +4554,7 @@ def test_acc2273_rut(acc2273param, monkeypatch, costs): class Acc2274Param(NamedTuple): - wsvol: Any = None + vol_plant_warm_shop_building: Any = None volrci: Any = None @@ -4573,7 +4573,7 @@ class Acc2274Param(NamedTuple): "acc2274param", ( Acc2274Param( - wsvol=130018.25667917728, + vol_plant_warm_shop_building=130018.25667917728, volrci=1205439.8543893537, fkind=1, c227=0, @@ -4582,7 +4582,7 @@ class Acc2274Param(NamedTuple): expected_c2274=79.525098581749191, ), Acc2274Param( - wsvol=130255.93791329287, + vol_plant_warm_shop_building=130255.93791329287, volrci=1206887.4047542624, fkind=1, c227=284.96904049038437, @@ -4605,7 +4605,7 @@ def test_acc2274_rut(acc2274param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(buildings_variables, "wsvol", acc2274param.wsvol) + monkeypatch.setattr(buildings_variables, "vol_plant_warm_shop_building", acc2274param.vol_plant_warm_shop_building) monkeypatch.setattr(buildings_variables, "volrci", acc2274param.volrci) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index 66879372a6..a0957ba4dc 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2878,7 +2878,7 @@ class IfebdgParam(NamedTuple): rmbvol: Any = None shovol: Any = None volrci: Any = None - wsvol: Any = None + vol_plant_warm_shop_building: Any = None volnucb: Any = None whtshld: Any = None helpow: Any = None @@ -2927,7 +2927,7 @@ class IfebdgParam(NamedTuple): rmbvol=0.0, shovol=0.0, volrci=0.0, - wsvol=0.0, + vol_plant_warm_shop_building=0.0, volnucb=0.0, whtshld=1067310.9593707009, helpow=20277.29636048527, @@ -2989,7 +2989,7 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): monkeypatch.setattr(buildings_variables, "rmbvol", ifebdgparam.rmbvol) monkeypatch.setattr(buildings_variables, "shovol", ifebdgparam.shovol) monkeypatch.setattr(buildings_variables, "volrci", ifebdgparam.volrci) - monkeypatch.setattr(buildings_variables, "wsvol", ifebdgparam.wsvol) + monkeypatch.setattr(buildings_variables, "vol_plant_warm_shop_building", ifebdgparam.vol_plant_warm_shop_building) monkeypatch.setattr(buildings_variables, "volnucb", ifebdgparam.volnucb) monkeypatch.setattr(fwbs_variables, "whtshld", ifebdgparam.whtshld) monkeypatch.setattr(heat_transport_variables, "helpow", ifebdgparam.helpow) @@ -3013,7 +3013,7 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): assert buildings_variables.rmbvol == pytest.approx(ifebdgparam.expected_rmbvol) assert buildings_variables.shovol == pytest.approx(ifebdgparam.expected_shovol) assert buildings_variables.volrci == pytest.approx(ifebdgparam.expected_volrci) - assert buildings_variables.wsvol == pytest.approx(ifebdgparam.expected_wsvol) + assert buildings_variables.vol_plant_warm_shop_building == pytest.approx(ifebdgparam.expected_wsvol) assert buildings_variables.volnucb == pytest.approx(ifebdgparam.expected_volnucb) From f6eea19e38ab81ff062237a143745be1c2991ae4 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 13:58:21 +0000 Subject: [PATCH 06/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20`rmbvol`=20to=20`?= =?UTF-8?q?vol=5Fplant=5Fmaintenance=5Fassembly=5Fbuilding`=20and=20update?= =?UTF-8?q?=20references=20across=20models=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/data_structure/buildings_variables.py | 6 +-- process/models/buildings.py | 2 +- process/models/costs/costs.py | 13 ++++-- process/models/ife.py | 2 +- tests/unit/test_costs_1990.py | 40 ++++++++++++++----- tests/unit/test_ife.py | 24 ++++++++--- 6 files changed, 64 insertions(+), 23 deletions(-) diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index d9ff2ebadc..8e3223f9fa 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -394,7 +394,7 @@ """reactor building wall thickness (m)""" -rmbvol: float = None +vol_plant_maintenance_assembly_building: float = None """volume of maintenance and assembly building (m3)""" @@ -711,7 +711,7 @@ def init_buildings_variables(): reactor_hall_h, \ reactor_roof_thk, \ reactor_wall_thk, \ - rmbvol, \ + vol_plant_maintenance_assembly_building, \ robotics_l, \ robotics_w, \ robotics_h, \ @@ -865,7 +865,7 @@ def init_buildings_variables(): reactor_hall_h = 0.0 reactor_roof_thk = 1.0 reactor_wall_thk = 2.0 - rmbvol = 0.0 + vol_plant_maintenance_assembly_building = 0.0 robotics_l = 50.0 robotics_w = 30.0 robotics_h = 30.0 diff --git a/process/models/buildings.py b/process/models/buildings.py index 881f124d16..8f82fc9e78 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -89,7 +89,7 @@ def run(self, output: bool = False): buildings_variables.cryvol, buildings_variables.volrci, buildings_variables.rbvol, - buildings_variables.rmbvol, + buildings_variables.vol_plant_maintenance_assembly_building, buildings_variables.vol_plant_warm_shop_building, buildings_variables.elevol, ) = self.iter_1992.calculate_building_sizes_1992( diff --git a/process/models/costs/costs.py b/process/models/costs/costs.py index 538f6456e0..94531d91cf 100644 --- a/process/models/costs/costs.py +++ b/process/models/costs/costs.py @@ -1103,7 +1103,7 @@ def acc21(self): cost_variables.c2141 = ( 1.0e-6 * cost_variables.UCMB - * buildings_variables.rmbvol**exprb + * buildings_variables.vol_plant_maintenance_assembly_building**exprb * cmlsa[cost_variables.lsa - 1] ) cost_variables.c2142 = ( @@ -2401,7 +2401,10 @@ def acc2273(self): * cost_variables.UCDTC * ( (cfrht / 1.0e4) ** 0.6e0 - * (buildings_variables.volrci + buildings_variables.vol_plant_warm_shop_building) + * ( + buildings_variables.volrci + + buildings_variables.vol_plant_warm_shop_building + ) ) ) else: @@ -2416,7 +2419,11 @@ def acc2274(self): cost_variables.c2274 = ( 1.0e-6 * cost_variables.UCNBV - * (buildings_variables.volrci + buildings_variables.vol_plant_warm_shop_building) ** 0.8e0 + * ( + buildings_variables.volrci + + buildings_variables.vol_plant_warm_shop_building + ) + ** 0.8e0 ) # Apply Nth kind factor diff --git a/process/models/ife.py b/process/models/ife.py index bdf74b0814..2c21520151 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2383,7 +2383,7 @@ def ifebdg(self, output: bool = False): buildings_variables.convol = buildings_variables.conv buildings_variables.elevol = elev buildings_variables.rbvol = rbv - buildings_variables.rmbvol = rmbv + buildings_variables.vol_plant_maintenance_assembly_building = rmbv buildings_variables.shovol = buildings_variables.shov buildings_variables.volrci = vrci buildings_variables.vol_plant_warm_shop_building = wsv diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index ab6a0640c7..17026097f9 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -226,7 +226,11 @@ def acc2273_fix(request, monkeypatch, costs): # Mock variables used by acc2273() # Some may be parameterised - monkeypatch.setattr(data_structure.buildings_variables, "vol_plant_warm_shop_building", param["vol_plant_warm_shop_building"]) + monkeypatch.setattr( + data_structure.buildings_variables, + "vol_plant_warm_shop_building", + param["vol_plant_warm_shop_building"], + ) monkeypatch.setattr(data_structure.buildings_variables, "volrci", param["volrci"]) monkeypatch.setattr( physics_variables, "f_plasma_fuel_tritium", param["f_plasma_fuel_tritium"] @@ -258,7 +262,9 @@ def test_acc2274(monkeypatch, costs): :param monkeypatch: Mock fixture :type monkeypatch: object """ - monkeypatch.setattr(data_structure.buildings_variables, "vol_plant_warm_shop_building", 132304.1) + monkeypatch.setattr( + data_structure.buildings_variables, "vol_plant_warm_shop_building", 132304.1 + ) monkeypatch.setattr(data_structure.buildings_variables, "volrci", 1299783.4) monkeypatch.setattr(cost_variables, "fkind", 1) monkeypatch.setattr(cost_variables, "c2274", 0) @@ -705,7 +711,7 @@ class Acc21Param(NamedTuple): cryvol: Any = None - rmbvol: Any = None + vol_plant_maintenance_assembly_building: Any = None admvol: Any = None @@ -791,7 +797,7 @@ class Acc21Param(NamedTuple): elevol=51601.097615432001, rbvol=1356973.2891062023, cryvol=15247.180612719381, - rmbvol=421473.52130148414, + vol_plant_maintenance_assembly_building=421473.52130148414, admvol=100000, convol=60000, vol_plant_warm_shop_building=130018.25667917728, @@ -836,7 +842,7 @@ class Acc21Param(NamedTuple): elevol=51609.268177478581, rbvol=1358540.6868905292, cryvol=25826.919937316459, - rmbvol=423252.94369581528, + vol_plant_maintenance_assembly_building=423252.94369581528, admvol=100000, convol=60000, vol_plant_warm_shop_building=130255.93791329287, @@ -900,13 +906,21 @@ def test_acc21(acc21param, monkeypatch, costs): monkeypatch.setattr(buildings_variables, "cryvol", acc21param.cryvol) - monkeypatch.setattr(buildings_variables, "rmbvol", acc21param.rmbvol) + monkeypatch.setattr( + buildings_variables, + "vol_plant_maintenance_assembly_building", + acc21param.vol_plant_maintenance_assembly_building, + ) monkeypatch.setattr(buildings_variables, "admvol", acc21param.admvol) monkeypatch.setattr(buildings_variables, "convol", acc21param.convol) - monkeypatch.setattr(buildings_variables, "vol_plant_warm_shop_building", acc21param.vol_plant_warm_shop_building) + monkeypatch.setattr( + buildings_variables, + "vol_plant_warm_shop_building", + acc21param.vol_plant_warm_shop_building, + ) monkeypatch.setattr(cost_variables, "ucrb", acc21param.ucrb) @@ -4532,7 +4546,11 @@ def test_acc2273_rut(acc2273param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(buildings_variables, "vol_plant_warm_shop_building", acc2273param.vol_plant_warm_shop_building) + monkeypatch.setattr( + buildings_variables, + "vol_plant_warm_shop_building", + acc2273param.vol_plant_warm_shop_building, + ) monkeypatch.setattr(buildings_variables, "volrci", acc2273param.volrci) @@ -4605,7 +4623,11 @@ def test_acc2274_rut(acc2274param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(buildings_variables, "vol_plant_warm_shop_building", acc2274param.vol_plant_warm_shop_building) + monkeypatch.setattr( + buildings_variables, + "vol_plant_warm_shop_building", + acc2274param.vol_plant_warm_shop_building, + ) monkeypatch.setattr(buildings_variables, "volrci", acc2274param.volrci) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index a0957ba4dc..4ac74dbf04 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2875,7 +2875,7 @@ class IfebdgParam(NamedTuple): convol: Any = None elevol: Any = None rbvol: Any = None - rmbvol: Any = None + vol_plant_maintenance_assembly_building: Any = None shovol: Any = None volrci: Any = None vol_plant_warm_shop_building: Any = None @@ -2924,7 +2924,7 @@ class IfebdgParam(NamedTuple): convol=0.0, elevol=0.0, rbvol=0.0, - rmbvol=0.0, + vol_plant_maintenance_assembly_building=0.0, shovol=0.0, volrci=0.0, vol_plant_warm_shop_building=0.0, @@ -2986,10 +2986,18 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): monkeypatch.setattr(buildings_variables, "convol", ifebdgparam.convol) monkeypatch.setattr(buildings_variables, "elevol", ifebdgparam.elevol) monkeypatch.setattr(buildings_variables, "rbvol", ifebdgparam.rbvol) - monkeypatch.setattr(buildings_variables, "rmbvol", ifebdgparam.rmbvol) + monkeypatch.setattr( + buildings_variables, + "vol_plant_maintenance_assembly_building", + ifebdgparam.vol_plant_maintenance_assembly_building, + ) monkeypatch.setattr(buildings_variables, "shovol", ifebdgparam.shovol) monkeypatch.setattr(buildings_variables, "volrci", ifebdgparam.volrci) - monkeypatch.setattr(buildings_variables, "vol_plant_warm_shop_building", ifebdgparam.vol_plant_warm_shop_building) + monkeypatch.setattr( + buildings_variables, + "vol_plant_warm_shop_building", + ifebdgparam.vol_plant_warm_shop_building, + ) monkeypatch.setattr(buildings_variables, "volnucb", ifebdgparam.volnucb) monkeypatch.setattr(fwbs_variables, "whtshld", ifebdgparam.whtshld) monkeypatch.setattr(heat_transport_variables, "helpow", ifebdgparam.helpow) @@ -3010,10 +3018,14 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): assert buildings_variables.convol == pytest.approx(ifebdgparam.expected_convol) assert buildings_variables.elevol == pytest.approx(ifebdgparam.expected_elevol) assert buildings_variables.rbvol == pytest.approx(ifebdgparam.expected_rbvol) - assert buildings_variables.rmbvol == pytest.approx(ifebdgparam.expected_rmbvol) + assert buildings_variables.vol_plant_maintenance_assembly_building == pytest.approx( + ifebdgparam.expected_rmbvol + ) assert buildings_variables.shovol == pytest.approx(ifebdgparam.expected_shovol) assert buildings_variables.volrci == pytest.approx(ifebdgparam.expected_volrci) - assert buildings_variables.vol_plant_warm_shop_building == pytest.approx(ifebdgparam.expected_wsvol) + assert buildings_variables.vol_plant_warm_shop_building == pytest.approx( + ifebdgparam.expected_wsvol + ) assert buildings_variables.volnucb == pytest.approx(ifebdgparam.expected_volnucb) From ba430953d5b33f5c982c4f752cd026644509045b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 13:59:04 +0000 Subject: [PATCH 07/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20`elevol`=20to=20`?= =?UTF-8?q?vol=5Fplant=5Felectrical=5Fbuilding`=20and=20update=20reference?= =?UTF-8?q?s=20across=20models=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/data_structure/buildings_variables.py | 6 +++--- process/models/buildings.py | 2 +- process/models/costs/costs.py | 2 +- process/models/ife.py | 2 +- tests/unit/test_costs_1990.py | 12 ++++++++---- tests/unit/test_ife.py | 14 ++++++++++---- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index 8e3223f9fa..9cdfce84bb 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -158,7 +158,7 @@ """Energy Storage facilities height (m)""" -elevol: float = None +vol_plant_electrical_building: float = None """volume of electrical equipment building (m3)""" @@ -652,7 +652,7 @@ def init_buildings_variables(): elecstore_l, \ elecstore_w, \ elecstore_h, \ - elevol, \ + vol_plant_electrical_building, \ esbldgm3, \ fc_building_l, \ fc_building_w, \ @@ -806,7 +806,7 @@ def init_buildings_variables(): elecstore_l = 100.0 elecstore_w = 60.0 elecstore_h = 12.0 - elevol = 0.0 + vol_plant_electrical_building = 0.0 esbldgm3 = 1.0e3 fc_building_l = 60.0 fc_building_w = 60.0 diff --git a/process/models/buildings.py b/process/models/buildings.py index 8f82fc9e78..d0aa57a7e1 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -91,7 +91,7 @@ def run(self, output: bool = False): buildings_variables.rbvol, buildings_variables.vol_plant_maintenance_assembly_building, buildings_variables.vol_plant_warm_shop_building, - buildings_variables.elevol, + buildings_variables.vol_plant_electrical_building, ) = self.iter_1992.calculate_building_sizes_1992( output, pfcoil_variables.r_pf_coil_outer_max, diff --git a/process/models/costs/costs.py b/process/models/costs/costs.py index 94531d91cf..dd925dc025 100644 --- a/process/models/costs/costs.py +++ b/process/models/costs/costs.py @@ -1128,7 +1128,7 @@ def acc21(self): cost_variables.c216 = ( 1.0e-6 * cost_variables.UCEL - * buildings_variables.elevol**exprb + * buildings_variables.vol_plant_electrical_building**exprb * cmlsa[cost_variables.lsa - 1] ) diff --git a/process/models/ife.py b/process/models/ife.py index 2c21520151..57beed7e98 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2381,7 +2381,7 @@ def ifebdg(self, output: bool = False): buildings_variables.admvol = buildings_variables.admv buildings_variables.convol = buildings_variables.conv - buildings_variables.elevol = elev + buildings_variables.vol_plant_electrical_building = elev buildings_variables.rbvol = rbv buildings_variables.vol_plant_maintenance_assembly_building = rmbv buildings_variables.shovol = buildings_variables.shov diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index 17026097f9..43a4526d9f 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -705,7 +705,7 @@ class Acc21Param(NamedTuple): triv: Any = None - elevol: Any = None + vol_plant_electrical_building: Any = None rbvol: Any = None @@ -794,7 +794,7 @@ class Acc21Param(NamedTuple): Acc21Param( shovol=100000, triv=40000, - elevol=51601.097615432001, + vol_plant_electrical_building=51601.097615432001, rbvol=1356973.2891062023, cryvol=15247.180612719381, vol_plant_maintenance_assembly_building=421473.52130148414, @@ -839,7 +839,7 @@ class Acc21Param(NamedTuple): Acc21Param( shovol=100000, triv=40000, - elevol=51609.268177478581, + vol_plant_electrical_building=51609.268177478581, rbvol=1358540.6868905292, cryvol=25826.919937316459, vol_plant_maintenance_assembly_building=423252.94369581528, @@ -900,7 +900,11 @@ def test_acc21(acc21param, monkeypatch, costs): monkeypatch.setattr(buildings_variables, "triv", acc21param.triv) - monkeypatch.setattr(buildings_variables, "elevol", acc21param.elevol) + monkeypatch.setattr( + buildings_variables, + "vol_plant_electrical_building", + acc21param.vol_plant_electrical_building, + ) monkeypatch.setattr(buildings_variables, "rbvol", acc21param.rbvol) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index 4ac74dbf04..6e754c46f4 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2873,7 +2873,7 @@ class IfebdgParam(NamedTuple): shov: Any = None admvol: Any = None convol: Any = None - elevol: Any = None + vol_plant_electrical_building: Any = None rbvol: Any = None vol_plant_maintenance_assembly_building: Any = None shovol: Any = None @@ -2922,7 +2922,7 @@ class IfebdgParam(NamedTuple): shov=100000.0, admvol=0.0, convol=0.0, - elevol=0.0, + vol_plant_electrical_building=0.0, rbvol=0.0, vol_plant_maintenance_assembly_building=0.0, shovol=0.0, @@ -2984,7 +2984,11 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): monkeypatch.setattr(buildings_variables, "shov", ifebdgparam.shov) monkeypatch.setattr(buildings_variables, "admvol", ifebdgparam.admvol) monkeypatch.setattr(buildings_variables, "convol", ifebdgparam.convol) - monkeypatch.setattr(buildings_variables, "elevol", ifebdgparam.elevol) + monkeypatch.setattr( + buildings_variables, + "vol_plant_electrical_building", + ifebdgparam.vol_plant_electrical_building, + ) monkeypatch.setattr(buildings_variables, "rbvol", ifebdgparam.rbvol) monkeypatch.setattr( buildings_variables, @@ -3016,7 +3020,9 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): ) assert buildings_variables.admvol == pytest.approx(ifebdgparam.expected_admvol) assert buildings_variables.convol == pytest.approx(ifebdgparam.expected_convol) - assert buildings_variables.elevol == pytest.approx(ifebdgparam.expected_elevol) + assert buildings_variables.vol_plant_electrical_building == pytest.approx( + ifebdgparam.expected_elevol + ) assert buildings_variables.rbvol == pytest.approx(ifebdgparam.expected_rbvol) assert buildings_variables.vol_plant_maintenance_assembly_building == pytest.approx( ifebdgparam.expected_rmbvol From c7d50b5c91c5bc8a9df5881f83a8a897ebc210f9 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 13:59:48 +0000 Subject: [PATCH 08/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20`rbvol`=20to=20`v?= =?UTF-8?q?ol=5Fplant=5Freactor=5Fbuilding`=20and=20update=20references=20?= =?UTF-8?q?across=20models=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/data_structure/buildings_variables.py | 6 +++--- process/models/buildings.py | 2 +- process/models/costs/costs.py | 2 +- process/models/ife.py | 2 +- tests/unit/test_costs_1990.py | 12 ++++++++---- tests/unit/test_ife.py | 14 ++++++++++---- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index 9cdfce84bb..5bcbab4141 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -358,7 +358,7 @@ """reactor building roof thickness (m)""" -rbvol: float = None +vol_plant_reactor_building: float = None """reactor building volume (m3)""" @@ -702,7 +702,7 @@ def init_buildings_variables(): qnty_sfty_fac, \ rbvfac, \ rbrt, \ - rbvol, \ + vol_plant_reactor_building, \ rbwt, \ reactor_clrnc, \ reactor_fndtn_thk, \ @@ -856,7 +856,7 @@ def init_buildings_variables(): qnty_sfty_fac = 2.0 rbvfac = 1.6 rbrt = 1.0 - rbvol = 0.0 + vol_plant_reactor_building = 0.0 rbwt = 2.0 reactor_clrnc = 4.0 reactor_fndtn_thk = 2.0 diff --git a/process/models/buildings.py b/process/models/buildings.py index d0aa57a7e1..88488dd43e 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -88,7 +88,7 @@ def run(self, output: bool = False): ( buildings_variables.cryvol, buildings_variables.volrci, - buildings_variables.rbvol, + buildings_variables.vol_plant_reactor_building, buildings_variables.vol_plant_maintenance_assembly_building, buildings_variables.vol_plant_warm_shop_building, buildings_variables.vol_plant_electrical_building, diff --git a/process/models/costs/costs.py b/process/models/costs/costs.py index dd925dc025..75aefbec86 100644 --- a/process/models/costs/costs.py +++ b/process/models/costs/costs.py @@ -1087,7 +1087,7 @@ def acc21(self): cost_variables.c212 = ( 1.0e-6 * cost_variables.ucrb - * buildings_variables.rbvol**exprb + * buildings_variables.vol_plant_reactor_building**exprb * cmlsa[cost_variables.lsa - 1] ) diff --git a/process/models/ife.py b/process/models/ife.py index 57beed7e98..a982e2013b 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2382,7 +2382,7 @@ def ifebdg(self, output: bool = False): buildings_variables.admvol = buildings_variables.admv buildings_variables.convol = buildings_variables.conv buildings_variables.vol_plant_electrical_building = elev - buildings_variables.rbvol = rbv + buildings_variables.vol_plant_reactor_building = rbv buildings_variables.vol_plant_maintenance_assembly_building = rmbv buildings_variables.shovol = buildings_variables.shov buildings_variables.volrci = vrci diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index 43a4526d9f..fc27390dba 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -707,7 +707,7 @@ class Acc21Param(NamedTuple): vol_plant_electrical_building: Any = None - rbvol: Any = None + vol_plant_reactor_building: Any = None cryvol: Any = None @@ -795,7 +795,7 @@ class Acc21Param(NamedTuple): shovol=100000, triv=40000, vol_plant_electrical_building=51601.097615432001, - rbvol=1356973.2891062023, + vol_plant_reactor_building=1356973.2891062023, cryvol=15247.180612719381, vol_plant_maintenance_assembly_building=421473.52130148414, admvol=100000, @@ -840,7 +840,7 @@ class Acc21Param(NamedTuple): shovol=100000, triv=40000, vol_plant_electrical_building=51609.268177478581, - rbvol=1358540.6868905292, + vol_plant_reactor_building=1358540.6868905292, cryvol=25826.919937316459, vol_plant_maintenance_assembly_building=423252.94369581528, admvol=100000, @@ -906,7 +906,11 @@ def test_acc21(acc21param, monkeypatch, costs): acc21param.vol_plant_electrical_building, ) - monkeypatch.setattr(buildings_variables, "rbvol", acc21param.rbvol) + monkeypatch.setattr( + buildings_variables, + "vol_plant_reactor_building", + acc21param.vol_plant_reactor_building, + ) monkeypatch.setattr(buildings_variables, "cryvol", acc21param.cryvol) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index 6e754c46f4..a85479b766 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2874,7 +2874,7 @@ class IfebdgParam(NamedTuple): admvol: Any = None convol: Any = None vol_plant_electrical_building: Any = None - rbvol: Any = None + vol_plant_reactor_building: Any = None vol_plant_maintenance_assembly_building: Any = None shovol: Any = None volrci: Any = None @@ -2923,7 +2923,7 @@ class IfebdgParam(NamedTuple): admvol=0.0, convol=0.0, vol_plant_electrical_building=0.0, - rbvol=0.0, + vol_plant_reactor_building=0.0, vol_plant_maintenance_assembly_building=0.0, shovol=0.0, volrci=0.0, @@ -2989,7 +2989,11 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): "vol_plant_electrical_building", ifebdgparam.vol_plant_electrical_building, ) - monkeypatch.setattr(buildings_variables, "rbvol", ifebdgparam.rbvol) + monkeypatch.setattr( + buildings_variables, + "vol_plant_reactor_building", + ifebdgparam.vol_plant_reactor_building, + ) monkeypatch.setattr( buildings_variables, "vol_plant_maintenance_assembly_building", @@ -3023,7 +3027,9 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): assert buildings_variables.vol_plant_electrical_building == pytest.approx( ifebdgparam.expected_elevol ) - assert buildings_variables.rbvol == pytest.approx(ifebdgparam.expected_rbvol) + assert buildings_variables.vol_plant_reactor_building == pytest.approx( + ifebdgparam.expected_rbvol + ) assert buildings_variables.vol_plant_maintenance_assembly_building == pytest.approx( ifebdgparam.expected_rmbvol ) From 18078762c0a47494286917e1f8b538c9e7506980 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 14:00:42 +0000 Subject: [PATCH 09/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20`volrci`=20to=20`?= =?UTF-8?q?vol=5Fplant=5Freactor=5Fbuilding=5Finternal`=20and=20update=20r?= =?UTF-8?q?eferences=20across=20models=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/data_structure/buildings_variables.py | 6 ++--- process/models/buildings.py | 2 +- process/models/costs/costs.py | 4 ++-- process/models/ife.py | 2 +- tests/unit/test_costs_1990.py | 24 +++++++++---------- tests/unit/test_ife.py | 8 +++---- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index 5bcbab4141..b29bb14c31 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -494,7 +494,7 @@ """tritiated waste storage building height (m)""" -volrci: float = None +vol_plant_reactor_building_internal: float = None """internal volume of reactor building (m3)""" @@ -736,7 +736,7 @@ def init_buildings_variables(): tw_storage_l, \ tw_storage_w, \ tw_storage_h, \ - volrci, \ + vol_plant_reactor_building_internal, \ volnucb, \ warm_shop_l, \ warm_shop_w, \ @@ -891,7 +891,7 @@ def init_buildings_variables(): tw_storage_w = 30.0 tw_storage_h = 5.0 volnucb = 0.0 - volrci = 0.0 + vol_plant_reactor_building_internal = 0.0 warm_shop_l = 100.0 warm_shop_w = 50.0 warm_shop_h = 10.0 diff --git a/process/models/buildings.py b/process/models/buildings.py index 88488dd43e..03a83568f0 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -87,7 +87,7 @@ def run(self, output: bool = False): # Previous estimation work ( buildings_variables.cryvol, - buildings_variables.volrci, + buildings_variables.vol_plant_reactor_building_internal, buildings_variables.vol_plant_reactor_building, buildings_variables.vol_plant_maintenance_assembly_building, buildings_variables.vol_plant_warm_shop_building, diff --git a/process/models/costs/costs.py b/process/models/costs/costs.py index 75aefbec86..dba70a1a90 100644 --- a/process/models/costs/costs.py +++ b/process/models/costs/costs.py @@ -2402,7 +2402,7 @@ def acc2273(self): * ( (cfrht / 1.0e4) ** 0.6e0 * ( - buildings_variables.volrci + buildings_variables.vol_plant_reactor_building_internal + buildings_variables.vol_plant_warm_shop_building ) ) @@ -2420,7 +2420,7 @@ def acc2274(self): 1.0e-6 * cost_variables.UCNBV * ( - buildings_variables.volrci + buildings_variables.vol_plant_reactor_building_internal + buildings_variables.vol_plant_warm_shop_building ) ** 0.8e0 diff --git a/process/models/ife.py b/process/models/ife.py index a982e2013b..dc01917a93 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2385,7 +2385,7 @@ def ifebdg(self, output: bool = False): buildings_variables.vol_plant_reactor_building = rbv buildings_variables.vol_plant_maintenance_assembly_building = rmbv buildings_variables.shovol = buildings_variables.shov - buildings_variables.volrci = vrci + buildings_variables.vol_plant_reactor_building_internal = vrci buildings_variables.vol_plant_warm_shop_building = wsv # Total volume of nuclear buildings diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index fc27390dba..209ed9e0ba 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -182,7 +182,7 @@ def acc2273_param(**kwargs): # Default parameters defaults = { "f_plasma_fuel_tritium": 0.0001, - "volrci": data_structure.buildings_variables.volrci, + "vol_plant_reactor_building_internal": data_structure.buildings_variables.vol_plant_reactor_building_internal, "vol_plant_warm_shop_building": data_structure.buildings_variables.vol_plant_warm_shop_building, "expected": approx(0.0, abs=0.00001), } @@ -204,7 +204,7 @@ def acc2273_params(): acc2273_param(), acc2273_param( f_plasma_fuel_tritium=0.5, - volrci=1299783.4, + vol_plant_reactor_building_internal=1299783.4, vol_plant_warm_shop_building=132304.1, expected=approx(74.12, abs=0.01), ), @@ -231,7 +231,7 @@ def acc2273_fix(request, monkeypatch, costs): "vol_plant_warm_shop_building", param["vol_plant_warm_shop_building"], ) - monkeypatch.setattr(data_structure.buildings_variables, "volrci", param["volrci"]) + monkeypatch.setattr(data_structure.buildings_variables, "vol_plant_reactor_building_internal", param["vol_plant_reactor_building_internal"]) monkeypatch.setattr( physics_variables, "f_plasma_fuel_tritium", param["f_plasma_fuel_tritium"] ) @@ -265,7 +265,7 @@ def test_acc2274(monkeypatch, costs): monkeypatch.setattr( data_structure.buildings_variables, "vol_plant_warm_shop_building", 132304.1 ) - monkeypatch.setattr(data_structure.buildings_variables, "volrci", 1299783.4) + monkeypatch.setattr(data_structure.buildings_variables, "vol_plant_reactor_building_internal", 1299783.4) monkeypatch.setattr(cost_variables, "fkind", 1) monkeypatch.setattr(cost_variables, "c2274", 0) @@ -4501,7 +4501,7 @@ def test_acc2272_rut(acc2272param, monkeypatch, costs): class Acc2273Param(NamedTuple): vol_plant_warm_shop_building: Any = None - volrci: Any = None + vol_plant_reactor_building_internal: Any = None fkind: Any = None @@ -4521,7 +4521,7 @@ class Acc2273Param(NamedTuple): ( Acc2273Param( vol_plant_warm_shop_building=130018.25667917728, - volrci=1205439.8543893537, + vol_plant_reactor_building_internal=1205439.8543893537, fkind=1, f_plasma_fuel_tritium=0.5, c227=0, @@ -4531,7 +4531,7 @@ class Acc2273Param(NamedTuple): ), Acc2273Param( vol_plant_warm_shop_building=130255.93791329287, - volrci=1206887.4047542624, + vol_plant_reactor_building_internal=1206887.4047542624, fkind=1, f_plasma_fuel_tritium=0.5, c227=284.96904049038437, @@ -4560,7 +4560,7 @@ def test_acc2273_rut(acc2273param, monkeypatch, costs): acc2273param.vol_plant_warm_shop_building, ) - monkeypatch.setattr(buildings_variables, "volrci", acc2273param.volrci) + monkeypatch.setattr(buildings_variables, "vol_plant_reactor_building_internal", acc2273param.vol_plant_reactor_building_internal) monkeypatch.setattr(cost_variables, "fkind", acc2273param.fkind) @@ -4582,7 +4582,7 @@ def test_acc2273_rut(acc2273param, monkeypatch, costs): class Acc2274Param(NamedTuple): vol_plant_warm_shop_building: Any = None - volrci: Any = None + vol_plant_reactor_building_internal: Any = None fkind: Any = None @@ -4600,7 +4600,7 @@ class Acc2274Param(NamedTuple): ( Acc2274Param( vol_plant_warm_shop_building=130018.25667917728, - volrci=1205439.8543893537, + vol_plant_reactor_building_internal=1205439.8543893537, fkind=1, c227=0, c2274=0, @@ -4609,7 +4609,7 @@ class Acc2274Param(NamedTuple): ), Acc2274Param( vol_plant_warm_shop_building=130255.93791329287, - volrci=1206887.4047542624, + vol_plant_reactor_building_internal=1206887.4047542624, fkind=1, c227=284.96904049038437, c2274=79.525098581749191, @@ -4637,7 +4637,7 @@ def test_acc2274_rut(acc2274param, monkeypatch, costs): acc2274param.vol_plant_warm_shop_building, ) - monkeypatch.setattr(buildings_variables, "volrci", acc2274param.volrci) + monkeypatch.setattr(buildings_variables, "vol_plant_reactor_building_internal", acc2274param.vol_plant_reactor_building_internal) monkeypatch.setattr(cost_variables, "fkind", acc2274param.fkind) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index a85479b766..c525c615bf 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2877,7 +2877,7 @@ class IfebdgParam(NamedTuple): vol_plant_reactor_building: Any = None vol_plant_maintenance_assembly_building: Any = None shovol: Any = None - volrci: Any = None + vol_plant_reactor_building_internal: Any = None vol_plant_warm_shop_building: Any = None volnucb: Any = None whtshld: Any = None @@ -2926,7 +2926,7 @@ class IfebdgParam(NamedTuple): vol_plant_reactor_building=0.0, vol_plant_maintenance_assembly_building=0.0, shovol=0.0, - volrci=0.0, + vol_plant_reactor_building_internal=0.0, vol_plant_warm_shop_building=0.0, volnucb=0.0, whtshld=1067310.9593707009, @@ -3000,7 +3000,7 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): ifebdgparam.vol_plant_maintenance_assembly_building, ) monkeypatch.setattr(buildings_variables, "shovol", ifebdgparam.shovol) - monkeypatch.setattr(buildings_variables, "volrci", ifebdgparam.volrci) + monkeypatch.setattr(buildings_variables, "vol_plant_reactor_building_internal", ifebdgparam.vol_plant_reactor_building_internal) monkeypatch.setattr( buildings_variables, "vol_plant_warm_shop_building", @@ -3034,7 +3034,7 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): ifebdgparam.expected_rmbvol ) assert buildings_variables.shovol == pytest.approx(ifebdgparam.expected_shovol) - assert buildings_variables.volrci == pytest.approx(ifebdgparam.expected_volrci) + assert buildings_variables.vol_plant_reactor_building_internal == pytest.approx(ifebdgparam.expected_volrci) assert buildings_variables.vol_plant_warm_shop_building == pytest.approx( ifebdgparam.expected_wsvol ) From e4dc10a1d4532271beee248cc2b6565b5231a469 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 14:01:19 +0000 Subject: [PATCH 10/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20`cryvol`=20to=20`?= =?UTF-8?q?vol=5Fplant=5Fcryoplant=5Fbuilding`=20and=20update=20references?= =?UTF-8?q?=20across=20models=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/data_structure/buildings_variables.py | 6 ++-- process/models/buildings.py | 2 +- process/models/costs/costs.py | 2 +- tests/unit/test_costs_1990.py | 36 ++++++++++++++----- tests/unit/test_ife.py | 10 ++++-- 5 files changed, 41 insertions(+), 15 deletions(-) diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index b29bb14c31..c998c829a1 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -114,7 +114,7 @@ """vertical clearance from TF coil to cryostat (m)""" -cryvol: float = None +vol_plant_cryoplant_building: float = None """volume of cryoplant building (m3)""" @@ -641,7 +641,7 @@ def init_buildings_variables(): cryostore_w, \ cryostore_h, \ cryostat_clrnc, \ - cryvol, \ + vol_plant_cryoplant_building, \ a_plant_floor_effective, \ elecdist_l, \ elecdist_w, \ @@ -795,7 +795,7 @@ def init_buildings_variables(): cryostore_w = 30.0 cryostore_h = 20.0 cryostat_clrnc = 2.5 - cryvol = 0.0 + vol_plant_cryoplant_building = 0.0 a_plant_floor_effective = 0.0 elecdist_l = 380.0 elecdist_w = 350.0 diff --git a/process/models/buildings.py b/process/models/buildings.py index 03a83568f0..7e5222bfdb 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -86,7 +86,7 @@ def run(self, output: bool = False): else: # Previous estimation work ( - buildings_variables.cryvol, + buildings_variables.vol_plant_cryoplant_building, buildings_variables.vol_plant_reactor_building_internal, buildings_variables.vol_plant_reactor_building, buildings_variables.vol_plant_maintenance_assembly_building, diff --git a/process/models/costs/costs.py b/process/models/costs/costs.py index dba70a1a90..5f93540e89 100644 --- a/process/models/costs/costs.py +++ b/process/models/costs/costs.py @@ -1157,7 +1157,7 @@ def acc21(self): cost_variables.c2174 = ( 1.0e-6 * cost_variables.UCCR - * buildings_variables.cryvol**exprb + * buildings_variables.vol_plant_cryoplant_building**exprb * cmlsa[cost_variables.lsa - 1] ) cost_variables.c217 = ( diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index 209ed9e0ba..9e1d139c0c 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -231,7 +231,11 @@ def acc2273_fix(request, monkeypatch, costs): "vol_plant_warm_shop_building", param["vol_plant_warm_shop_building"], ) - monkeypatch.setattr(data_structure.buildings_variables, "vol_plant_reactor_building_internal", param["vol_plant_reactor_building_internal"]) + monkeypatch.setattr( + data_structure.buildings_variables, + "vol_plant_reactor_building_internal", + param["vol_plant_reactor_building_internal"], + ) monkeypatch.setattr( physics_variables, "f_plasma_fuel_tritium", param["f_plasma_fuel_tritium"] ) @@ -265,7 +269,11 @@ def test_acc2274(monkeypatch, costs): monkeypatch.setattr( data_structure.buildings_variables, "vol_plant_warm_shop_building", 132304.1 ) - monkeypatch.setattr(data_structure.buildings_variables, "vol_plant_reactor_building_internal", 1299783.4) + monkeypatch.setattr( + data_structure.buildings_variables, + "vol_plant_reactor_building_internal", + 1299783.4, + ) monkeypatch.setattr(cost_variables, "fkind", 1) monkeypatch.setattr(cost_variables, "c2274", 0) @@ -709,7 +717,7 @@ class Acc21Param(NamedTuple): vol_plant_reactor_building: Any = None - cryvol: Any = None + vol_plant_cryoplant_building: Any = None vol_plant_maintenance_assembly_building: Any = None @@ -796,7 +804,7 @@ class Acc21Param(NamedTuple): triv=40000, vol_plant_electrical_building=51601.097615432001, vol_plant_reactor_building=1356973.2891062023, - cryvol=15247.180612719381, + vol_plant_cryoplant_building=15247.180612719381, vol_plant_maintenance_assembly_building=421473.52130148414, admvol=100000, convol=60000, @@ -841,7 +849,7 @@ class Acc21Param(NamedTuple): triv=40000, vol_plant_electrical_building=51609.268177478581, vol_plant_reactor_building=1358540.6868905292, - cryvol=25826.919937316459, + vol_plant_cryoplant_building=25826.919937316459, vol_plant_maintenance_assembly_building=423252.94369581528, admvol=100000, convol=60000, @@ -912,7 +920,11 @@ def test_acc21(acc21param, monkeypatch, costs): acc21param.vol_plant_reactor_building, ) - monkeypatch.setattr(buildings_variables, "cryvol", acc21param.cryvol) + monkeypatch.setattr( + buildings_variables, + "vol_plant_cryoplant_building", + acc21param.vol_plant_cryoplant_building, + ) monkeypatch.setattr( buildings_variables, @@ -4560,7 +4572,11 @@ def test_acc2273_rut(acc2273param, monkeypatch, costs): acc2273param.vol_plant_warm_shop_building, ) - monkeypatch.setattr(buildings_variables, "vol_plant_reactor_building_internal", acc2273param.vol_plant_reactor_building_internal) + monkeypatch.setattr( + buildings_variables, + "vol_plant_reactor_building_internal", + acc2273param.vol_plant_reactor_building_internal, + ) monkeypatch.setattr(cost_variables, "fkind", acc2273param.fkind) @@ -4637,7 +4653,11 @@ def test_acc2274_rut(acc2274param, monkeypatch, costs): acc2274param.vol_plant_warm_shop_building, ) - monkeypatch.setattr(buildings_variables, "vol_plant_reactor_building_internal", acc2274param.vol_plant_reactor_building_internal) + monkeypatch.setattr( + buildings_variables, + "vol_plant_reactor_building_internal", + acc2274param.vol_plant_reactor_building_internal, + ) monkeypatch.setattr(cost_variables, "fkind", acc2274param.fkind) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index c525c615bf..bb63159bfb 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -3000,7 +3000,11 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): ifebdgparam.vol_plant_maintenance_assembly_building, ) monkeypatch.setattr(buildings_variables, "shovol", ifebdgparam.shovol) - monkeypatch.setattr(buildings_variables, "vol_plant_reactor_building_internal", ifebdgparam.vol_plant_reactor_building_internal) + monkeypatch.setattr( + buildings_variables, + "vol_plant_reactor_building_internal", + ifebdgparam.vol_plant_reactor_building_internal, + ) monkeypatch.setattr( buildings_variables, "vol_plant_warm_shop_building", @@ -3034,7 +3038,9 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): ifebdgparam.expected_rmbvol ) assert buildings_variables.shovol == pytest.approx(ifebdgparam.expected_shovol) - assert buildings_variables.vol_plant_reactor_building_internal == pytest.approx(ifebdgparam.expected_volrci) + assert buildings_variables.vol_plant_reactor_building_internal == pytest.approx( + ifebdgparam.expected_volrci + ) assert buildings_variables.vol_plant_warm_shop_building == pytest.approx( ifebdgparam.expected_wsvol ) From f78b733c09055318c7ab856bb3875857f3d6273b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 14:07:29 +0000 Subject: [PATCH 11/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20`rbwt`=20to=20`dx?= =?UTF-8?q?=5Fplant=5Freactor=5Fbuilding=5Fwall`=20and=20update=20referenc?= =?UTF-8?q?es=20across=20models=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/core/input.py | 2 +- process/data_structure/buildings_variables.py | 6 +++--- process/models/buildings.py | 6 +++--- process/models/ife.py | 2 +- tests/regression/input_files/IFE.IN.DAT | 2 +- tests/unit/test_buildings.py | 8 ++++---- tests/unit/test_ife.py | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/process/core/input.py b/process/core/input.py index 7cb7b76577..b442c33d8a 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -1234,7 +1234,7 @@ def __post_init__(self): ), "rbrt": InputVariable(data_structure.buildings_variables, float, range=(0.0, 10.0)), "rbvfac": InputVariable(data_structure.buildings_variables, float, range=(0.9, 3.0)), - "rbwt": InputVariable(data_structure.buildings_variables, float, range=(0.0, 10.0)), + "dx_plant_reactor_building_wall": InputVariable(data_structure.buildings_variables, float, range=(0.0, 10.0)), "radius_cp_coolant_channel": InputVariable( data_structure.tfcoil_variables, float, range=(1e-06, 1.0) ), diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index c998c829a1..54b6dbbd4e 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -362,7 +362,7 @@ """reactor building volume (m3)""" -rbwt: float = None +dx_plant_reactor_building_wall: float = None """reactor building wall thickness (m)""" @@ -703,7 +703,7 @@ def init_buildings_variables(): rbvfac, \ rbrt, \ vol_plant_reactor_building, \ - rbwt, \ + dx_plant_reactor_building_wall, \ reactor_clrnc, \ reactor_fndtn_thk, \ reactor_hall_l, \ @@ -857,7 +857,7 @@ def init_buildings_variables(): rbvfac = 1.6 rbrt = 1.0 vol_plant_reactor_building = 0.0 - rbwt = 2.0 + dx_plant_reactor_building_wall = 2.0 reactor_clrnc = 4.0 reactor_fndtn_thk = 2.0 reactor_hall_l = 0.0 diff --git a/process/models/buildings.py b/process/models/buildings.py index 7e5222bfdb..e9c9639f87 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -278,11 +278,11 @@ def calculate_building_sizes_1992( vrci = 1e10 # External dimensions of reactor building (m) - # rbwt : reactor building wall thickness, m + # dx_plant_reactor_building_wall : reactor building wall thickness, m # rbrt : reactor building roof thickness, m # fndt : foundation thickness, m - rbw = 2.0e0 * buildings_variables.wrbi + 2.0e0 * buildings_variables.rbwt - rbl = drbi + 2.0e0 * buildings_variables.rbwt + rbw = 2.0e0 * buildings_variables.wrbi + 2.0e0 * buildings_variables.dx_plant_reactor_building_wall + rbl = drbi + 2.0e0 * buildings_variables.dx_plant_reactor_building_wall rbh = hrbi + buildings_variables.rbrt + buildings_variables.fndt rbv = buildings_variables.rbvfac * rbw * rbl * rbh diff --git a/process/models/ife.py b/process/models/ife.py index dc01917a93..bd8208f720 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2282,7 +2282,7 @@ def ifebdg(self, output: bool = False): # RBWT = wall thickness # RBRT = roof thickness # FNDT = foundation thickness - rbw = 2.0 * (ife_variables.r7 + buildings_variables.rbwt) + rbw = 2.0 * (ife_variables.r7 + buildings_variables.dx_plant_reactor_building_wall) rbl = rbw rbh = hrbi + buildings_variables.rbrt + buildings_variables.fndt diff --git a/tests/regression/input_files/IFE.IN.DAT b/tests/regression/input_files/IFE.IN.DAT index 06493b2de5..06f3186a98 100644 --- a/tests/regression/input_files/IFE.IN.DAT +++ b/tests/regression/input_files/IFE.IN.DAT @@ -252,7 +252,7 @@ ucme = 3.0D8 *Cost of maintenance equipment ($) *---------------Buildings Variables----------------* pibv = 4.0D4 *Power injection building volume (m3) rbrt = 3.2 *Reactor building roof thickness (m) -rbwt = 3.2 *Reactor building wall thickness (m) +dx_plant_reactor_building_wall = 3.2 *Reactor building wall thickness (m) *---------------Heat Transport Variables-----------* eta_turbine = 0.45 *Thermal-to-electric conversion efficiency diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index cf9cec8cfb..b12f8e15da 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -769,7 +769,7 @@ class BldgsParam(NamedTuple): dz_tf_cryostat: Any stcl: Any rbvfac: Any - rbwt: Any + dx_plant_reactor_building_wall: Any rbrt: Any fndt: Any hcwt: Any @@ -833,7 +833,7 @@ class BldgsParam(NamedTuple): dz_tf_cryostat=5.7514039424138126, stcl=3, rbvfac=1.6000000000000001, - rbwt=2, + dx_plant_reactor_building_wall=2, rbrt=1, fndt=2, hcwt=1.5, @@ -893,7 +893,7 @@ class BldgsParam(NamedTuple): dz_tf_cryostat=5.8405005070918357, stcl=3, rbvfac=1.6000000000000001, - rbwt=2, + dx_plant_reactor_building_wall=2, rbrt=1, fndt=2, hcwt=1.5, @@ -955,7 +955,7 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): monkeypatch.setattr(buildings_variables, "dz_tf_cryostat", bldgsparam.dz_tf_cryostat) monkeypatch.setattr(buildings_variables, "stcl", bldgsparam.stcl) monkeypatch.setattr(buildings_variables, "rbvfac", bldgsparam.rbvfac) - monkeypatch.setattr(buildings_variables, "rbwt", bldgsparam.rbwt) + monkeypatch.setattr(buildings_variables, "dx_plant_reactor_building_wall", bldgsparam.dx_plant_reactor_building_wall) monkeypatch.setattr(buildings_variables, "rbrt", bldgsparam.rbrt) monkeypatch.setattr(buildings_variables, "fndt", bldgsparam.fndt) monkeypatch.setattr(buildings_variables, "hcwt", bldgsparam.hcwt) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index bb63159bfb..9b3b32e423 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2857,7 +2857,7 @@ def test_ifeacp(ifeacpparam, monkeypatch, ife): class IfebdgParam(NamedTuple): wrbi: Any = None - rbwt: Any = None + dx_plant_reactor_building_wall: Any = None rbrt: Any = None fndt: Any = None trcl: Any = None @@ -2906,7 +2906,7 @@ class IfebdgParam(NamedTuple): ( IfebdgParam( wrbi=0.0, - rbwt=3.2000000000000002, + dx_plant_reactor_building_wall=3.2000000000000002, rbrt=3.2000000000000002, fndt=2.0, trcl=1.0, @@ -2964,7 +2964,7 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ monkeypatch.setattr(buildings_variables, "wrbi", ifebdgparam.wrbi) - monkeypatch.setattr(buildings_variables, "rbwt", ifebdgparam.rbwt) + monkeypatch.setattr(buildings_variables, "dx_plant_reactor_building_wall", ifebdgparam.dx_plant_reactor_building_wall) monkeypatch.setattr(buildings_variables, "rbrt", ifebdgparam.rbrt) monkeypatch.setattr(buildings_variables, "fndt", ifebdgparam.fndt) monkeypatch.setattr(buildings_variables, "trcl", ifebdgparam.trcl) From 5bf933774a738b7f6d6764e9e5c2116ad6087121 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 14:09:13 +0000 Subject: [PATCH 12/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20`rbrt`=20to=20`dz?= =?UTF-8?q?=5Fplant=5Freactor=5Fbuilding=5Froof`=20and=20update=20referenc?= =?UTF-8?q?es=20across=20models=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/core/input.py | 8 ++++++-- process/data_structure/buildings_variables.py | 6 +++--- process/models/buildings.py | 13 ++++++++++--- process/models/ife.py | 10 ++++++++-- tests/regression/input_files/IFE.IN.DAT | 2 +- tests/unit/test_buildings.py | 18 +++++++++++++----- tests/unit/test_ife.py | 16 ++++++++++++---- 7 files changed, 53 insertions(+), 20 deletions(-) diff --git a/process/core/input.py b/process/core/input.py index b442c33d8a..0b2f4a88c1 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -1232,9 +1232,13 @@ def __post_init__(self): "outgrat_fw": InputVariable( data_structure.vacuum_variables, float, range=(1e-10, 1e-06) ), - "rbrt": InputVariable(data_structure.buildings_variables, float, range=(0.0, 10.0)), + "dz_plant_reactor_building_roof": InputVariable( + data_structure.buildings_variables, float, range=(0.0, 10.0) + ), "rbvfac": InputVariable(data_structure.buildings_variables, float, range=(0.9, 3.0)), - "dx_plant_reactor_building_wall": InputVariable(data_structure.buildings_variables, float, range=(0.0, 10.0)), + "dx_plant_reactor_building_wall": InputVariable( + data_structure.buildings_variables, float, range=(0.0, 10.0) + ), "radius_cp_coolant_channel": InputVariable( data_structure.tfcoil_variables, float, range=(1e-06, 1.0) ), diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index 54b6dbbd4e..8a6a79e7a4 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -354,7 +354,7 @@ """reactor building volume multiplication factor""" -rbrt: float = None +dz_plant_reactor_building_roof: float = None """reactor building roof thickness (m)""" @@ -701,7 +701,7 @@ def init_buildings_variables(): pibv, \ qnty_sfty_fac, \ rbvfac, \ - rbrt, \ + dz_plant_reactor_building_roof, \ vol_plant_reactor_building, \ dx_plant_reactor_building_wall, \ reactor_clrnc, \ @@ -855,7 +855,7 @@ def init_buildings_variables(): pibv = 2.0e4 qnty_sfty_fac = 2.0 rbvfac = 1.6 - rbrt = 1.0 + dz_plant_reactor_building_roof = 1.0 vol_plant_reactor_building = 0.0 dx_plant_reactor_building_wall = 2.0 reactor_clrnc = 4.0 diff --git a/process/models/buildings.py b/process/models/buildings.py index e9c9639f87..8d90b742d1 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -279,11 +279,18 @@ def calculate_building_sizes_1992( # External dimensions of reactor building (m) # dx_plant_reactor_building_wall : reactor building wall thickness, m - # rbrt : reactor building roof thickness, m + # dz_plant_reactor_building_roof : reactor building roof thickness, m # fndt : foundation thickness, m - rbw = 2.0e0 * buildings_variables.wrbi + 2.0e0 * buildings_variables.dx_plant_reactor_building_wall + rbw = ( + 2.0e0 * buildings_variables.wrbi + + 2.0e0 * buildings_variables.dx_plant_reactor_building_wall + ) rbl = drbi + 2.0e0 * buildings_variables.dx_plant_reactor_building_wall - rbh = hrbi + buildings_variables.rbrt + buildings_variables.fndt + rbh = ( + hrbi + + buildings_variables.dz_plant_reactor_building_roof + + buildings_variables.fndt + ) rbv = buildings_variables.rbvfac * rbw * rbl * rbh # Maintenance building diff --git a/process/models/ife.py b/process/models/ife.py index bd8208f720..fe3a2a7257 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2282,9 +2282,15 @@ def ifebdg(self, output: bool = False): # RBWT = wall thickness # RBRT = roof thickness # FNDT = foundation thickness - rbw = 2.0 * (ife_variables.r7 + buildings_variables.dx_plant_reactor_building_wall) + rbw = 2.0 * ( + ife_variables.r7 + buildings_variables.dx_plant_reactor_building_wall + ) rbl = rbw - rbh = hrbi + buildings_variables.rbrt + buildings_variables.fndt + rbh = ( + hrbi + + buildings_variables.dz_plant_reactor_building_roof + + buildings_variables.fndt + ) # External volume rbv = rbw * rbl * rbh diff --git a/tests/regression/input_files/IFE.IN.DAT b/tests/regression/input_files/IFE.IN.DAT index 06f3186a98..ddd58823e3 100644 --- a/tests/regression/input_files/IFE.IN.DAT +++ b/tests/regression/input_files/IFE.IN.DAT @@ -251,7 +251,7 @@ ucme = 3.0D8 *Cost of maintenance equipment ($) *---------------Buildings Variables----------------* pibv = 4.0D4 *Power injection building volume (m3) -rbrt = 3.2 *Reactor building roof thickness (m) +dz_plant_reactor_building_roof = 3.2 *Reactor building roof thickness (m) dx_plant_reactor_building_wall = 3.2 *Reactor building wall thickness (m) *---------------Heat Transport Variables-----------* diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index b12f8e15da..908a27fae4 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -770,7 +770,7 @@ class BldgsParam(NamedTuple): stcl: Any rbvfac: Any dx_plant_reactor_building_wall: Any - rbrt: Any + dz_plant_reactor_building_roof: Any fndt: Any hcwt: Any hccl: Any @@ -834,7 +834,7 @@ class BldgsParam(NamedTuple): stcl=3, rbvfac=1.6000000000000001, dx_plant_reactor_building_wall=2, - rbrt=1, + dz_plant_reactor_building_roof=1, fndt=2, hcwt=1.5, hccl=5, @@ -894,7 +894,7 @@ class BldgsParam(NamedTuple): stcl=3, rbvfac=1.6000000000000001, dx_plant_reactor_building_wall=2, - rbrt=1, + dz_plant_reactor_building_roof=1, fndt=2, hcwt=1.5, hccl=5, @@ -955,8 +955,16 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): monkeypatch.setattr(buildings_variables, "dz_tf_cryostat", bldgsparam.dz_tf_cryostat) monkeypatch.setattr(buildings_variables, "stcl", bldgsparam.stcl) monkeypatch.setattr(buildings_variables, "rbvfac", bldgsparam.rbvfac) - monkeypatch.setattr(buildings_variables, "dx_plant_reactor_building_wall", bldgsparam.dx_plant_reactor_building_wall) - monkeypatch.setattr(buildings_variables, "rbrt", bldgsparam.rbrt) + monkeypatch.setattr( + buildings_variables, + "dx_plant_reactor_building_wall", + bldgsparam.dx_plant_reactor_building_wall, + ) + monkeypatch.setattr( + buildings_variables, + "dz_plant_reactor_building_roof", + bldgsparam.dz_plant_reactor_building_roof, + ) monkeypatch.setattr(buildings_variables, "fndt", bldgsparam.fndt) monkeypatch.setattr(buildings_variables, "hcwt", bldgsparam.hcwt) monkeypatch.setattr(buildings_variables, "hccl", bldgsparam.hccl) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index 9b3b32e423..694fe8450d 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2858,7 +2858,7 @@ def test_ifeacp(ifeacpparam, monkeypatch, ife): class IfebdgParam(NamedTuple): wrbi: Any = None dx_plant_reactor_building_wall: Any = None - rbrt: Any = None + dz_plant_reactor_building_roof: Any = None fndt: Any = None trcl: Any = None hcwt: Any = None @@ -2907,7 +2907,7 @@ class IfebdgParam(NamedTuple): IfebdgParam( wrbi=0.0, dx_plant_reactor_building_wall=3.2000000000000002, - rbrt=3.2000000000000002, + dz_plant_reactor_building_roof=3.2000000000000002, fndt=2.0, trcl=1.0, hcwt=1.5, @@ -2964,8 +2964,16 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ monkeypatch.setattr(buildings_variables, "wrbi", ifebdgparam.wrbi) - monkeypatch.setattr(buildings_variables, "dx_plant_reactor_building_wall", ifebdgparam.dx_plant_reactor_building_wall) - monkeypatch.setattr(buildings_variables, "rbrt", ifebdgparam.rbrt) + monkeypatch.setattr( + buildings_variables, + "dx_plant_reactor_building_wall", + ifebdgparam.dx_plant_reactor_building_wall, + ) + monkeypatch.setattr( + buildings_variables, + "dz_plant_reactor_building_roof", + ifebdgparam.dz_plant_reactor_building_roof, + ) monkeypatch.setattr(buildings_variables, "fndt", ifebdgparam.fndt) monkeypatch.setattr(buildings_variables, "trcl", ifebdgparam.trcl) monkeypatch.setattr(buildings_variables, "hcwt", ifebdgparam.hcwt) From a4a122597f6125d311e814082f9b8acf571fdc7f Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 14:11:20 +0000 Subject: [PATCH 13/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20`tfcbv`=20to=20`v?= =?UTF-8?q?ol=5Fplant=5Ftf=5Fpower=5Fsupplies=5Fbuilding`=20and=20update?= =?UTF-8?q?=20references=20across=20models=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/core/input.py | 2 +- process/data_structure/buildings_variables.py | 6 +++--- process/models/buildings.py | 2 +- process/models/power.py | 12 ++++++------ tests/unit/test_buildings.py | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/process/core/input.py b/process/core/input.py index 0b2f4a88c1..4c5e405147 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -1520,7 +1520,7 @@ def __post_init__(self): "temp_plasma_separatrix_kev": InputVariable( data_structure.physics_variables, float, range=(0.0, 20.0) ), - "tfcbv": InputVariable( + "vol_plant_tf_power_supplies_building": InputVariable( data_structure.buildings_variables, float, range=(10000.0, 1000000.0) ), "dx_tf_wp_insertion_gap": InputVariable( diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index 8a6a79e7a4..2589c8379c 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -454,7 +454,7 @@ """clearance above crane to roof (m)""" -tfcbv: float = None +vol_plant_tf_power_supplies_building: float = None """volume of TF coil power supply building (m3) (calculated if TF coils are superconducting)""" @@ -726,7 +726,7 @@ def init_buildings_variables(): staff_buildings_area, \ staff_buildings_h, \ stcl, \ - tfcbv, \ + vol_plant_tf_power_supplies_building, \ transp_clrnc, \ trcl, \ triv, \ @@ -880,7 +880,7 @@ def init_buildings_variables(): staff_buildings_h = 5.0 staff_buildings_area = 4.8e5 stcl = 3.0 - tfcbv = 2.0e4 + vol_plant_tf_power_supplies_building = 2.0e4 transp_clrnc = 1.0 trcl = 1.0 triv = 4.0e4 diff --git a/process/models/buildings.py b/process/models/buildings.py index 8d90b742d1..c2c506161c 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -348,7 +348,7 @@ def calculate_building_sizes_1992( # pibv : power injection building volume, m3 # esbldgm3 is forced to be zero if no energy storage is required (i_pulsed_plant=0) elev = ( - buildings_variables.tfcbv + buildings_variables.vol_plant_tf_power_supplies_building + buildings_variables.pfbldgm3 + buildings_variables.esbldgm3 + buildings_variables.pibv diff --git a/process/models/power.py b/process/models/power.py index 9a85ed9465..e6848cf865 100644 --- a/process/models/power.py +++ b/process/models/power.py @@ -2010,7 +2010,7 @@ def tfpwcall(self, output: bool): tfcoil_variables.tfckw, tfcoil_variables.len_tf_bus, tfcoil_variables.drarea, - buildings_variables.tfcbv, + buildings_variables.vol_plant_tf_power_supplies_building, heat_transport_variables.p_tf_electric_supplies_mw, ) = self.tfcpwr( output, @@ -2171,7 +2171,7 @@ def tfcpwr( drarea = 0.5e0 * ndumpr * (1.0e0 + r1emj) ** 0.667e0 # Total TF coil power conversion building volume, m3 - tfcbv = 6.0e0 * tfcfsp + vol_plant_tf_power_supplies_building = 6.0e0 * tfcfsp # TF coil AC inductive power demand, MW xpwrmw = xpower / 0.9e0 @@ -2185,7 +2185,7 @@ def tfcpwr( # tftsp = tfcfsp # Total TF coil power conversion building volume, m3 - # tftbv = tfcbv + # tftbv = vol_plant_tf_power_supplies_building # Output section if output: @@ -2306,8 +2306,8 @@ def tfcpwr( po.ovarre( self.outfile, "TF coil power conv. building volume (m3)", - "(tfcbv)", - tfcbv, + "(vol_plant_tf_power_supplies_building)", + vol_plant_tf_power_supplies_building, "OP ", ) po.ovarre( @@ -2325,7 +2325,7 @@ def tfcpwr( "OP ", ) - return (tfckw, len_tf_bus, drarea, tfcbv, p_tf_electric_supplies_mw) + return (tfckw, len_tf_bus, drarea, vol_plant_tf_power_supplies_building, p_tf_electric_supplies_mw) def power_profiles_over_time( self, diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index 908a27fae4..a673d9df72 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -777,7 +777,7 @@ class BldgsParam(NamedTuple): wgt2: Any mbvfac: Any wsvfac: Any - tfcbv: Any + vol_plant_tf_power_supplies_building: Any pfbldgm3: Any esbldgm3: Any pibv: Any @@ -841,7 +841,7 @@ class BldgsParam(NamedTuple): wgt2=100000, mbvfac=2.7999999999999998, wsvfac=1.8999999999999999, - tfcbv=10601.097615432001, + vol_plant_tf_power_supplies_building=10601.097615432001, pfbldgm3=20000, esbldgm3=1000, pibv=20000, @@ -901,7 +901,7 @@ class BldgsParam(NamedTuple): wgt2=100000, mbvfac=2.7999999999999998, wsvfac=1.8999999999999999, - tfcbv=10609.268177478583, + vol_plant_tf_power_supplies_building=10609.268177478583, pfbldgm3=20000, esbldgm3=1000, pibv=20000, @@ -971,7 +971,7 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): monkeypatch.setattr(buildings_variables, "wgt2", bldgsparam.wgt2) monkeypatch.setattr(buildings_variables, "mbvfac", bldgsparam.mbvfac) monkeypatch.setattr(buildings_variables, "wsvfac", bldgsparam.wsvfac) - monkeypatch.setattr(buildings_variables, "tfcbv", bldgsparam.tfcbv) + monkeypatch.setattr(buildings_variables, "vol_plant_tf_power_supplies_building", bldgsparam.vol_plant_tf_power_supplies_building) monkeypatch.setattr(buildings_variables, "pfbldgm3", bldgsparam.pfbldgm3) monkeypatch.setattr(buildings_variables, "esbldgm3", bldgsparam.esbldgm3) monkeypatch.setattr(buildings_variables, "pibv", bldgsparam.pibv) From 1949c1fe1b3272094693198c37c4f6491ab76a6c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 14:19:16 +0000 Subject: [PATCH 14/28] =?UTF-8?q?=F0=9F=94=84=20Refactor=20buildings=20and?= =?UTF-8?q?=20power=20models=20to=20improve=20variable=20usage=20and=20rea?= =?UTF-8?q?dability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/models/buildings.py | 19 +++++++++---------- process/models/power.py | 8 +++++++- tests/unit/test_buildings.py | 6 +++++- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/process/models/buildings.py b/process/models/buildings.py index c2c506161c..062d1af125 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -16,6 +16,7 @@ heat_transport_variables, pfcoil_variables, physics_variables, + superconducting_tf_coil_variables, tfcoil_variables, ) from process.models.physics.current_drive import ( @@ -54,14 +55,12 @@ def output(self): 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.dr_tf_outboard * 0.5e0 - ) + r_tf_outboard_out = superconducting_tf_coil_variables.r_tf_outboard_out # inboard edge: inboard mid-leg radial position - half-thickness of inboard leg tfri = build_variables.r_tf_inboard_mid - (build_variables.dr_tf_inboard * 0.5e0) # Find width, in radial dimension, of TF coil (m) - tf_radial_dim = tfro - tfri + tf_radial_dim = r_tf_outboard_out - tfri # Find full height of TF coil (m) # = 2 * (mid-plane to TF coil inside edge + thickness of coil) @@ -96,7 +95,7 @@ def run(self, output: bool = False): output, pfcoil_variables.r_pf_coil_outer_max, pfcoil_variables.m_pf_coil_max, - tfro, + r_tf_outboard_out, tfri, tf_vertical_dim, tfmtn, @@ -119,7 +118,7 @@ def calculate_building_sizes_1992( output: bool, pfr, pfm, - tfro, + r_tf_outboard_out, tfri, tfh, tfm, @@ -151,7 +150,7 @@ def calculate_building_sizes_1992( largest PF coil outer radius, m pfm : largest PF coil mass, tonne - tfro : + r_tf_outboard_out : outer radius of TF coil, m tfri : inner radius of TF coil, m @@ -195,12 +194,12 @@ def calculate_building_sizes_1992( # Determine basic machine radius (m) # crr : cryostat radius (m) # pfr : radius of largest PF coil (m) - # tfro : outer radius of TF coil (m) - bmr = max(crr, pfr, tfro) + # r_tf_outboard_out : outer radius of TF coil (m) + bmr = max(crr, pfr, r_tf_outboard_out) # Determine largest transported piece sectl = shro - shri # Shield thicknes (m) - coill = tfro - tfri # TF coil thickness (m) + coill = r_tf_outboard_out - tfri # TF coil thickness (m) sectl = max(coill, sectl) # Calculate half width of building (m) diff --git a/process/models/power.py b/process/models/power.py index e6848cf865..a9100f7212 100644 --- a/process/models/power.py +++ b/process/models/power.py @@ -2325,7 +2325,13 @@ def tfcpwr( "OP ", ) - return (tfckw, len_tf_bus, drarea, vol_plant_tf_power_supplies_building, p_tf_electric_supplies_mw) + return ( + tfckw, + len_tf_bus, + drarea, + vol_plant_tf_power_supplies_building, + p_tf_electric_supplies_mw, + ) def power_profiles_over_time( self, diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index a673d9df72..76b0de5638 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -971,7 +971,11 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): monkeypatch.setattr(buildings_variables, "wgt2", bldgsparam.wgt2) monkeypatch.setattr(buildings_variables, "mbvfac", bldgsparam.mbvfac) monkeypatch.setattr(buildings_variables, "wsvfac", bldgsparam.wsvfac) - monkeypatch.setattr(buildings_variables, "vol_plant_tf_power_supplies_building", bldgsparam.vol_plant_tf_power_supplies_building) + monkeypatch.setattr( + buildings_variables, + "vol_plant_tf_power_supplies_building", + bldgsparam.vol_plant_tf_power_supplies_building, + ) monkeypatch.setattr(buildings_variables, "pfbldgm3", bldgsparam.pfbldgm3) monkeypatch.setattr(buildings_variables, "esbldgm3", bldgsparam.esbldgm3) monkeypatch.setattr(buildings_variables, "pibv", bldgsparam.pibv) From 0ad01c8cd215e6033ac42522cbc56eb568aac0e9 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 14:29:04 +0000 Subject: [PATCH 15/28] =?UTF-8?q?=F0=9F=94=84=20Add=20`dr=5Ftf=5Ffull=5Fmi?= =?UTF-8?q?dplane`=20variable=20to=20represent=20full=20radial=20thickness?= =?UTF-8?q?=20of=20TF=20coil=20at=20midplane?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/data_structure/tfcoil_variables.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/process/data_structure/tfcoil_variables.py b/process/data_structure/tfcoil_variables.py index 3b757b99a4..a54145a7c1 100644 --- a/process/data_structure/tfcoil_variables.py +++ b/process/data_structure/tfcoil_variables.py @@ -767,6 +767,9 @@ (calculated for stellarators) """ +dr_tf_full_midplane: float = None +"""Full radial thickness of TF coil at midplane (m) (`iteration variable 141`)""" + dr_tf_wp_with_insulation: float = None """radial thickness of winding pack (m) (`iteration variable 140`) (issue #514)""" @@ -1221,6 +1224,7 @@ def init_tfcoil_variables(): dx_tf_turn_insulation, \ layer_ins, \ dr_tf_nose_case, \ + dr_tf_full_midplane, \ dr_tf_wp_with_insulation, \ dx_tf_turn_steel, \ dx_tf_wp_insulation, \ @@ -1454,6 +1458,7 @@ def init_tfcoil_variables(): dx_tf_turn_insulation = 8e-4 layer_ins = 0.0 dr_tf_nose_case = 0.3 + dr_tf_full_midplane = 0.0 dr_tf_wp_with_insulation = 0.0 dx_tf_turn_steel = 8e-3 dx_tf_wp_insulation = 0.018 From 9aab25d559f6ca00fd9ed78f0f4334e95f2e6009 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 15:02:01 +0000 Subject: [PATCH 16/28] Update TF coil calculations to use `dr_tf_full_midplane` for improved accuracy --- process/core/io/plot_proc.py | 2 +- process/models/buildings.py | 8 +++++++- process/models/tfcoil/base.py | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/process/core/io/plot_proc.py b/process/core/io/plot_proc.py index e1006a497f..2443d6435c 100644 --- a/process/core/io/plot_proc.py +++ b/process/core/io/plot_proc.py @@ -10171,7 +10171,7 @@ def plot_tf_coil_structure(axis: plt.Axes, mfile: mf.MFile, scan: int, colour_sc axis.text( (r_tf_inboard_out + r_tf_outboard_in) / 1.5, 0.0, - f"{(r_tf_outboard_in + dr_tf_outboard) - r_tf_inboard_in:.3f} m", + f"{mfile.get('dr_tf_full_midplane', scan=scan):.3f} m", fontsize=7, color="black", verticalalignment="center", diff --git a/process/models/buildings.py b/process/models/buildings.py index 062d1af125..a6f19b7068 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -60,7 +60,7 @@ def run(self, output: bool = False): tfri = build_variables.r_tf_inboard_mid - (build_variables.dr_tf_inboard * 0.5e0) # Find width, in radial dimension, of TF coil (m) - tf_radial_dim = r_tf_outboard_out - tfri + tf_radial_dim = tfcoil_variables.dr_tf_full_midplane # Find full height of TF coil (m) # = 2 * (mid-plane to TF coil inside edge + thickness of coil) @@ -113,6 +113,9 @@ def run(self, output: bool = False): class BuildingsITER1992: + def __init__(self): + self.outfile = constants.NOUT + def calculate_building_sizes_1992( self, output: bool, @@ -431,6 +434,9 @@ def calculate_building_sizes_1992( class BuildingsChapman2024: + def __init__(self): + self.outfile = constants.NOUT + def calculate_building_sizes_chapman(self, output, tf_radial_dim, tf_vertical_dim): """Subroutine that estimates the sizes (footprints and volumes) of buildings within a fusion power plant. diff --git a/process/models/tfcoil/base.py b/process/models/tfcoil/base.py index 272aef36d9..1e64d0d200 100644 --- a/process/models/tfcoil/base.py +++ b/process/models/tfcoil/base.py @@ -82,6 +82,7 @@ def run_base_tf(self): superconducting_tf_coil_variables.r_tf_outboard_out, tfcoil_variables.dx_tf_inboard_out_toroidal, tfcoil_variables.a_tf_leg_outboard, + tfcoil_variables.dr_tf_full_midplane, tfcoil_variables.dr_tf_plasma_case, tfcoil_variables.dx_tf_side_case_min, ) = self.tf_global_geometry( @@ -204,6 +205,7 @@ def tf_global_geometry( - **rad_tf_coil_inboard_toroidal_half** (*float*): Toroidal angular spacing of each TF coil [radians]. - **tan_theta_coil** (*float*): Tangent of the toroidal angular spacing. - **a_tf_inboard_total** (*float*): Cross-sectional area of the inboard leg of the TF coil [m²]. + - **dr_tf_full_midplane** (*float*): Full external coil width at mid-plane [m]. - **r_tf_outboard_in** (*float*): Inner radius of the outboard leg of the TF coil [m]. - **r_tf_outboard_out** (*float*): Outer radius of the outboard leg of the TF coil [m]. - **dx_tf_inboard_out_toroidal** (*float*): Width of the inboard leg at the outer edge in the toroidal direction [m]. @@ -245,6 +247,11 @@ def tf_global_geometry( # Area of rectangular cross-section TF outboard leg [m^2] a_tf_leg_outboard = dx_tf_inboard_out_toroidal * dr_tf_outboard + # ===================================================================== + # Full external coil width at mid-plane [m] + + dr_tf_full_midplane = r_tf_outboard_out - r_tf_inboard_in + # ====================================================================== # Plasma facing front case thickness [m] @@ -293,6 +300,7 @@ def tf_global_geometry( r_tf_outboard_out, dx_tf_inboard_out_toroidal, a_tf_leg_outboard, + dr_tf_full_midplane, dr_tf_plasma_case, dx_tf_side_case_min, ) @@ -749,6 +757,13 @@ def outtf(self): "(dr_tf_outboard)", build_variables.dr_tf_outboard, ) + po.ovarre( + self.outfile, + "Full external coil width at mid-plane (m)", + "(dr_tf_full_midplane)", + tfcoil_variables.dr_tf_full_midplane, + "OP ", + ) po.ovarre( self.outfile, "Outboard leg toroidal thickness (m)", From aa971740b0c17f5a19e33feac47b896a2143303f Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 15:04:07 +0000 Subject: [PATCH 17/28] =?UTF-8?q?=F0=9F=94=84=20Add=20`dr=5Ftf=5Finternal?= =?UTF-8?q?=5Fmidplane`=20variable=20and=20update=20documentation=20for=20?= =?UTF-8?q?TF=20coil=20thickness?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/data_structure/tfcoil_variables.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/process/data_structure/tfcoil_variables.py b/process/data_structure/tfcoil_variables.py index a54145a7c1..cd58cbee44 100644 --- a/process/data_structure/tfcoil_variables.py +++ b/process/data_structure/tfcoil_variables.py @@ -768,7 +768,10 @@ """ dr_tf_full_midplane: float = None -"""Full radial thickness of TF coil at midplane (m) (`iteration variable 141`)""" +"""Full radial thickness of TF coil at midplane (m)""" + +dr_tf_internal_midplane: float = None +"""Internal radial thickness of TF coil at midplane (m)""" dr_tf_wp_with_insulation: float = None @@ -1225,6 +1228,7 @@ def init_tfcoil_variables(): layer_ins, \ dr_tf_nose_case, \ dr_tf_full_midplane, \ + dr_tf_internal_midplane, \ dr_tf_wp_with_insulation, \ dx_tf_turn_steel, \ dx_tf_wp_insulation, \ @@ -1459,6 +1463,7 @@ def init_tfcoil_variables(): layer_ins = 0.0 dr_tf_nose_case = 0.3 dr_tf_full_midplane = 0.0 + dr_tf_internal_midplane = 0.0 dr_tf_wp_with_insulation = 0.0 dx_tf_turn_steel = 8e-3 dx_tf_wp_insulation = 0.018 From 4674d2a07893c7b30f9f82dae7d15d0d8173dee7 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 24 Mar 2026 15:08:08 +0000 Subject: [PATCH 18/28] Update TF coil calculations to use `dr_tf_internal_midplane` for internal coil width and enhance documentation --- process/core/io/plot_proc.py | 2 +- process/models/tfcoil/base.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/process/core/io/plot_proc.py b/process/core/io/plot_proc.py index 2443d6435c..075e39d025 100644 --- a/process/core/io/plot_proc.py +++ b/process/core/io/plot_proc.py @@ -10147,7 +10147,7 @@ def plot_tf_coil_structure(axis: plt.Axes, mfile: mf.MFile, scan: int, colour_sc axis.text( (r_tf_inboard_out + r_tf_outboard_in) / 1.5, -z_tf_inside_half / 12, - f"{r_tf_outboard_in - r_tf_inboard_in:.3f} m", + f"{mfile.get('dr_tf_internal_midplane', scan=scan):.3f} m", fontsize=7, color="black", verticalalignment="center", diff --git a/process/models/tfcoil/base.py b/process/models/tfcoil/base.py index 1e64d0d200..398ead61cf 100644 --- a/process/models/tfcoil/base.py +++ b/process/models/tfcoil/base.py @@ -83,6 +83,7 @@ def run_base_tf(self): tfcoil_variables.dx_tf_inboard_out_toroidal, tfcoil_variables.a_tf_leg_outboard, tfcoil_variables.dr_tf_full_midplane, + tfcoil_variables.dr_tf_internal_midplane, tfcoil_variables.dr_tf_plasma_case, tfcoil_variables.dx_tf_side_case_min, ) = self.tf_global_geometry( @@ -206,6 +207,7 @@ def tf_global_geometry( - **tan_theta_coil** (*float*): Tangent of the toroidal angular spacing. - **a_tf_inboard_total** (*float*): Cross-sectional area of the inboard leg of the TF coil [m²]. - **dr_tf_full_midplane** (*float*): Full external coil width at mid-plane [m]. + - **dr_tf_internal_midplane** (*float*): Full internal coil width at mid-plane [m]. - **r_tf_outboard_in** (*float*): Inner radius of the outboard leg of the TF coil [m]. - **r_tf_outboard_out** (*float*): Outer radius of the outboard leg of the TF coil [m]. - **dx_tf_inboard_out_toroidal** (*float*): Width of the inboard leg at the outer edge in the toroidal direction [m]. @@ -252,6 +254,9 @@ def tf_global_geometry( dr_tf_full_midplane = r_tf_outboard_out - r_tf_inboard_in + # Full internal coil width at mid-plane [m] + dr_tf_internal_midplane = r_tf_outboard_in - r_tf_inboard_out + # ====================================================================== # Plasma facing front case thickness [m] @@ -301,6 +306,7 @@ def tf_global_geometry( dx_tf_inboard_out_toroidal, a_tf_leg_outboard, dr_tf_full_midplane, + dr_tf_internal_midplane, dr_tf_plasma_case, dx_tf_side_case_min, ) @@ -764,6 +770,13 @@ def outtf(self): tfcoil_variables.dr_tf_full_midplane, "OP ", ) + po.ovarre( + self.outfile, + "Full internal coil width at mid-plane (m)", + "(dr_tf_internal_midplane)", + tfcoil_variables.dr_tf_internal_midplane, + "OP ", + ) po.ovarre( self.outfile, "Outboard leg toroidal thickness (m)", From b26e1d2ce293f253ef95fcea5ef1085d039bf285 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 25 Mar 2026 09:26:05 +0000 Subject: [PATCH 19/28] =?UTF-8?q?=F0=9F=94=84=20Update=20building=20size?= =?UTF-8?q?=20calculations=20to=20use=20new=20model=20methods=20and=20impr?= =?UTF-8?q?ove=20variable=20assignments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/test_buildings.py | 6 +++--- tests/unit/test_tfcoil.py | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index 76b0de5638..4661513fb1 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -741,7 +741,7 @@ def test_bldgs_sizes(buildings, bldgssizesparam, monkeypatch): monkeypatch.setattr(physics_variables, "rmajor", bldgssizesparam.rmajor) monkeypatch.setattr(physics_variables, "rminor", bldgssizesparam.rminor) - buildings.calculate_building_sizes_chapman( + buildings.chapman_2024.calculate_building_sizes_chapman( tf_radial_dim=bldgssizesparam.tf_radial_dim, tf_vertical_dim=bldgssizesparam.tf_vertical_dim, output=False, @@ -993,11 +993,11 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): monkeypatch.setattr(buildings_variables, "convol", bldgsparam.convol) monkeypatch.setattr(buildings_variables, "volnucb", bldgsparam.volnucb) - cryv, vrci, rbv, rmbv, wsv, elev = buildings.calculate_building_sizes_1992( + cryv, vrci, rbv, rmbv, wsv, elev = buildings.iter_1992.calculate_building_sizes_1992( output=False, pfr=bldgsparam.pfr, pfm=bldgsparam.pfm, - tfro=bldgsparam.tfro, + r_tf_outboard_out=bldgsparam.tfro, tfri=bldgsparam.tfri, tfh=bldgsparam.tfh, tfm=bldgsparam.tfm, diff --git a/tests/unit/test_tfcoil.py b/tests/unit/test_tfcoil.py index e52b3a6f8d..23befda3f2 100644 --- a/tests/unit/test_tfcoil.py +++ b/tests/unit/test_tfcoil.py @@ -275,6 +275,8 @@ def test_cntrpst(cntrpst_asset, monkeypatch, reinitialise_error_module, tfcoil): pytest.approx(5.15), # r_tf_outboard_out pytest.approx(0.780361288064513), # dx_tf_inboard_out_toroidal pytest.approx(0.2341083864193539), # a_tf_leg_outboard + pytest.approx(5.15 - 1.5), # dr_tf_full_midplane + pytest.approx(4.85 - 2.0), # dr_tf_internal_midplane pytest.approx(0.03842943919353914), # dr_tf_plasma_case pytest.approx(0.0), # dx_tf_side_case_min ), @@ -300,6 +302,8 @@ def test_cntrpst(cntrpst_asset, monkeypatch, reinitialise_error_module, tfcoil): pytest.approx(4.625), # r_tf_outboard_out pytest.approx(0.9317485623690747), # dx_tf_inboard_out_toroidal pytest.approx(0.23293714059226867), # a_tf_leg_outboard + pytest.approx(4.625 - 1.4), # dr_tf_full_midplane + pytest.approx(4.375 - 1.8), # dr_tf_internal_midplane pytest.approx(0.04), # dr_tf_plasma_case pytest.approx(0.019426316451256392), # dx_tf_side_case_min ), From 57c5bab642b95f36cbf039cb1b673f42ec6c65ab Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 25 Mar 2026 13:56:15 +0000 Subject: [PATCH 20/28] :bug: Temporarily revert logic to allow proper regression testing --- process/models/buildings.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/process/models/buildings.py b/process/models/buildings.py index a6f19b7068..c23717857f 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -16,7 +16,6 @@ heat_transport_variables, pfcoil_variables, physics_variables, - superconducting_tf_coil_variables, tfcoil_variables, ) from process.models.physics.current_drive import ( @@ -55,12 +54,14 @@ def output(self): def run(self, output: bool = False): # Find TF coil radial positions # outboard edge: outboard mid-leg radial position + half-thickness of outboard leg - r_tf_outboard_out = superconducting_tf_coil_variables.r_tf_outboard_out + r_tf_outboard_out = build_variables.r_tf_outboard_mid + ( + build_variables.dr_tf_outboard * 0.5e0 + ) # inboard edge: inboard mid-leg radial position - half-thickness of inboard leg tfri = build_variables.r_tf_inboard_mid - (build_variables.dr_tf_inboard * 0.5e0) # Find width, in radial dimension, of TF coil (m) - tf_radial_dim = tfcoil_variables.dr_tf_full_midplane + tf_radial_dim = r_tf_outboard_out - tfri # Find full height of TF coil (m) # = 2 * (mid-plane to TF coil inside edge + thickness of coil) From 7d4428cbb29994d9ec657e80ae350faeecac06cc Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 25 Mar 2026 14:03:01 +0000 Subject: [PATCH 21/28] =?UTF-8?q?=F0=9F=94=84=20Refactor=20TF=20coil=20cal?= =?UTF-8?q?culations=20to=20improve=20variable=20naming=20and=20enhance=20?= =?UTF-8?q?clarity=20in=20building=20size=20computations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/models/buildings.py | 117 ++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 51 deletions(-) diff --git a/process/models/buildings.py b/process/models/buildings.py index c23717857f..3b6b317f82 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -58,10 +58,12 @@ def run(self, output: bool = False): build_variables.dr_tf_outboard * 0.5e0 ) # inboard edge: inboard mid-leg radial position - half-thickness of inboard leg - tfri = build_variables.r_tf_inboard_mid - (build_variables.dr_tf_inboard * 0.5e0) + r_tf_inboard_in = build_variables.r_tf_inboard_mid - ( + build_variables.dr_tf_inboard * 0.5e0 + ) # Find width, in radial dimension, of TF coil (m) - tf_radial_dim = r_tf_outboard_out - tfri + tf_radial_dim = r_tf_outboard_out - r_tf_inboard_in # Find full height of TF coil (m) # = 2 * (mid-plane to TF coil inside edge + thickness of coil) @@ -94,22 +96,22 @@ def run(self, output: bool = False): buildings_variables.vol_plant_electrical_building, ) = self.iter_1992.calculate_building_sizes_1992( output, - pfcoil_variables.r_pf_coil_outer_max, - pfcoil_variables.m_pf_coil_max, - r_tf_outboard_out, - tfri, - tf_vertical_dim, - tfmtn, - tfcoil_variables.n_tf_coils, - build_variables.r_shld_outboard_outer, - build_variables.r_shld_inboard_inner, - 2.0e0 + r_pf_coil_outer_max=pfcoil_variables.r_pf_coil_outer_max, + m_pf_coil_max=pfcoil_variables.m_pf_coil_max, + r_tf_outboard_out=r_tf_outboard_out, + r_tf_inboard_in=r_tf_inboard_in, + dz_tf_full=tf_vertical_dim, + m_tf_coil_tonne=tfmtn, + n_tf_coils=tfcoil_variables.n_tf_coils, + r_shld_outboard_outer=build_variables.r_shld_outboard_outer, + r_shld_inboard_inner=build_variables.r_shld_inboard_inner, + dz_shld=2.0e0 * (build_variables.z_tf_inside_half - build_variables.dz_shld_vv_gap) - build_variables.dz_vv_upper - build_variables.dz_vv_lower, - fwbs_variables.whtshld, - fwbs_variables.r_cryostat_inboard, - heat_transport_variables.helpow, + m_shld_total=fwbs_variables.whtshld, + r_cryostat_outboard=fwbs_variables.r_cryostat_inboard, + helpow=heat_transport_variables.helpow, ) @@ -120,18 +122,18 @@ def __init__(self): def calculate_building_sizes_1992( self, output: bool, - pfr, - pfm, + r_pf_coil_outer_max, + m_pf_coil_max, r_tf_outboard_out, - tfri, - tfh, - tfm, + r_tf_inboard_in, + dz_tf_full, + m_tf_coil_tonne, n_tf_coils, - shro, - shri, - shh, - shm, - crr, + r_shld_outboard_outer, + r_shld_inboard_inner, + dz_shld, + m_shld_total, + r_cryostat_outboard, helpow, ): """Determines the sizes of the plant buildings @@ -150,29 +152,29 @@ def calculate_building_sizes_1992( ---------- output: - pfr : + r_pf_coil_outer_max : largest PF coil outer radius, m - pfm : + m_pf_coil_max : largest PF coil mass, tonne r_tf_outboard_out : outer radius of TF coil, m - tfri : + r_tf_inboard_in : inner radius of TF coil, m - tfh : + dz_tf_full : full height of TF coil, m - tfm : + m_tf_coil_tonne : mass of one TF coil, tonne n_tf_coils : number of tf coils - shro : + r_shld_outboard_outer : outer radius of attached shield, m - shri : + r_shld_inboard_inner : inner radius of attached shield, m - shh : + dz_shld : height of attached shield, m - shm : + m_shld_total : total mass of attached shield, kg - crr : + r_cryostat_outboard : outer radius of common cryostat, m helpow : total cryogenic load, W @@ -196,14 +198,14 @@ def calculate_building_sizes_1992( # Reactor building # Determine basic machine radius (m) - # crr : cryostat radius (m) - # pfr : radius of largest PF coil (m) + # r_cryostat_outboard : cryostat radius (m) + # r_pf_coil_outer_max : radius of largest PF coil (m) # r_tf_outboard_out : outer radius of TF coil (m) - bmr = max(crr, pfr, r_tf_outboard_out) + bmr = max(r_cryostat_outboard, r_pf_coil_outer_max, r_tf_outboard_out) # Determine largest transported piece - sectl = shro - shri # Shield thicknes (m) - coill = r_tf_outboard_out - tfri # TF coil thickness (m) + sectl = r_shld_outboard_outer - r_shld_inboard_inner # Shield thicknes (m) + coill = r_tf_outboard_out - r_tf_inboard_in # TF coil thickness (m) sectl = max(coill, sectl) # Calculate half width of building (m) @@ -222,7 +224,7 @@ def calculate_building_sizes_1992( # Calculate length to allow PF or cryostat laydown (m) # Laydown length (m) - layl = max(crr, pfr) + layl = max(r_cryostat_outboard, r_pf_coil_outer_max) # Diagonal length (m) hy = bmr + buildings_variables.rxcl + sectl + buildings_variables.trcl + layl @@ -250,8 +252,8 @@ def calculate_building_sizes_1992( if buildings_variables.wgt > 1.0e0: wt = buildings_variables.wgt else: - wt = buildings_variables.shmf * shm / n_tf_coils - wt = max(wt, 1.0e3 * pfm, 1.0e3 * tfm) + wt = buildings_variables.shmf * m_shld_total / n_tf_coils + wt = max(wt, 1.0e3 * m_pf_coil_max, 1.0e3 * m_tf_coil_tonne) # Crane height (m) crcl = 9.41e-6 * wt + 5.1e0 @@ -260,10 +262,10 @@ def calculate_building_sizes_1992( # dz_tf_cryostat : clearance from TF coil to cryostat top, m # clh2 : clearance beneath TF coil to foundation, including basement, m # stcl : clearance above crane to roof, m - # Additional tfh allows TF coil to be lifted right out + # Additional dz_tf_full allows TF coil to be lifted right out hrbi = ( buildings_variables.clh2 - + 2.0e0 * tfh + + 2.0e0 * dz_tf_full + buildings_variables.dz_tf_cryostat + buildings_variables.trcl + crcl @@ -304,7 +306,11 @@ def calculate_building_sizes_1992( # Transport corridor size # hcwt : hot cell wall thickness, m - tcw = shro - shri + 4.0e0 * buildings_variables.trcl + tcw = ( + r_shld_outboard_outer + - r_shld_inboard_inner + + 4.0e0 * buildings_variables.trcl + ) tcl = 5.0e0 * tcw + 2.0e0 * buildings_variables.hcwt # Decontamination cell size @@ -312,8 +318,17 @@ def calculate_building_sizes_1992( # Hot cell size # hccl : clearance around components in hot cell, m - hcw = shro - shri + 3.0e0 * buildings_variables.hccl + 2.0e0 - hcl = 3.0e0 * (shro - shri) + 4.0e0 * buildings_variables.hccl + tcw + hcw = ( + r_shld_outboard_outer + - r_shld_inboard_inner + + 3.0e0 * buildings_variables.hccl + + 2.0e0 + ) + hcl = ( + 3.0e0 * (r_shld_outboard_outer - r_shld_inboard_inner) + + 4.0e0 * buildings_variables.hccl + + tcw + ) # Maintenance building dimensions rmbw = hcw + dcw + 3.0e0 * buildings_variables.hcwt @@ -325,18 +340,18 @@ def calculate_building_sizes_1992( if buildings_variables.wgt2 > 1.0e0: wgts = buildings_variables.wgt2 else: - wgts = buildings_variables.shmf * shm / n_tf_coils + wgts = buildings_variables.shmf * m_shld_total / n_tf_coils cran = 9.41e-6 * wgts + 5.1e0 rmbh = ( 10.0e0 - + shh + + dz_shld + buildings_variables.trcl + cran + buildings_variables.stcl + buildings_variables.fndt ) - tch = shh + buildings_variables.stcl + buildings_variables.fndt + tch = dz_shld + buildings_variables.stcl + buildings_variables.fndt # Volume rmbv = buildings_variables.mbvfac * rmbw * rmbl * rmbh + tcw * tcl * tch From b6e1f9b638897f544363c0d871991b3656d68b13 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 25 Mar 2026 14:10:29 +0000 Subject: [PATCH 22/28] =?UTF-8?q?=F0=9F=94=84=20Refactor=20building=20size?= =?UTF-8?q?=20calculations=20to=20improve=20variable=20naming=20and=20enha?= =?UTF-8?q?nce=20clarity=20in=20thickness=20computations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/models/buildings.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/process/models/buildings.py b/process/models/buildings.py index 3b6b317f82..696957247b 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -201,12 +201,16 @@ def calculate_building_sizes_1992( # r_cryostat_outboard : cryostat radius (m) # r_pf_coil_outer_max : radius of largest PF coil (m) # r_tf_outboard_out : outer radius of TF coil (m) - bmr = max(r_cryostat_outboard, r_pf_coil_outer_max, r_tf_outboard_out) + r_machine = max(r_cryostat_outboard, r_pf_coil_outer_max, r_tf_outboard_out) # Determine largest transported piece - sectl = r_shld_outboard_outer - r_shld_inboard_inner # Shield thicknes (m) - coill = r_tf_outboard_out - r_tf_inboard_in # TF coil thickness (m) - sectl = max(coill, sectl) + dz_shld_full = ( + r_shld_outboard_outer - r_shld_inboard_inner + ) # Shield thicknes (m) + dz_tf_full_midplane = ( + r_tf_outboard_out - r_tf_inboard_in + ) # TF coil thickness (m) + dz_shld_full = max(dz_tf_full_midplane, dz_shld_full) # Calculate half width of building (m) # rxcl : clearance around reactor, m @@ -214,9 +218,9 @@ def calculate_building_sizes_1992( # row : clearance to building wall for crane operation, m # 19.48258241468535 + 4 + max(13.764874193548387 - 4.7423258064516141, 17.123405859443331 - 2.9939411851091102) + 1 + 4 = 42.61204708901957 buildings_variables.wrbi = ( - bmr + r_machine + buildings_variables.rxcl - + sectl + + dz_shld_full + buildings_variables.trcl + buildings_variables.row ) @@ -227,7 +231,13 @@ def calculate_building_sizes_1992( layl = max(r_cryostat_outboard, r_pf_coil_outer_max) # Diagonal length (m) - hy = bmr + buildings_variables.rxcl + sectl + buildings_variables.trcl + layl + hy = ( + r_machine + + buildings_variables.rxcl + + dz_shld_full + + buildings_variables.trcl + + layl + ) # Angle between diagonal length and floor (m) ang = (buildings_variables.wrbi - buildings_variables.trcl - layl) / hy From f01c77c2e586b2e4ecd1070858a87a3e98626570 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 25 Mar 2026 14:12:40 +0000 Subject: [PATCH 23/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20transportation=20?= =?UTF-8?q?clearance=20variable=20to=20improve=20clarity=20and=20consisten?= =?UTF-8?q?cy=20across=20the=20codebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/core/input.py | 4 +++- process/data_structure/buildings_variables.py | 6 +++--- process/models/buildings.py | 20 +++++++++++-------- process/models/ife.py | 9 ++++++--- tests/unit/test_buildings.py | 12 +++++++---- tests/unit/test_ife.py | 20 +++++++++++++------ 6 files changed, 46 insertions(+), 25 deletions(-) diff --git a/process/core/input.py b/process/core/input.py index 4c5e405147..0f839f21a7 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -1590,7 +1590,9 @@ def __post_init__(self): "f_temp_plasma_ion_electron": InputVariable( data_structure.physics_variables, float, range=(0.0, 2.0) ), - "trcl": InputVariable(data_structure.buildings_variables, float, range=(0.0, 10.0)), + "dr_plant_reactor_building_transport_clearance": InputVariable( + data_structure.buildings_variables, float, range=(0.0, 10.0) + ), "triang": InputVariable(data_structure.physics_variables, float, range=(-1.0, 1.0)), "triang95": InputVariable(data_structure.physics_variables, float, range=(0.0, 1.0)), "p_tritium_plant_electric_mw": InputVariable( diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index 2589c8379c..0244b1adf8 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -462,7 +462,7 @@ """transportation clearance between components (m)""" -trcl: float = None +dr_plant_reactor_building_transport_clearance: float = None """transportation clearance between components (m)""" @@ -728,7 +728,7 @@ def init_buildings_variables(): stcl, \ vol_plant_tf_power_supplies_building, \ transp_clrnc, \ - trcl, \ + dr_plant_reactor_building_transport_clearance, \ triv, \ turbine_hall_l, \ turbine_hall_w, \ @@ -882,7 +882,7 @@ def init_buildings_variables(): stcl = 3.0 vol_plant_tf_power_supplies_building = 2.0e4 transp_clrnc = 1.0 - trcl = 1.0 + dr_plant_reactor_building_transport_clearance = 1.0 triv = 4.0e4 turbine_hall_l = 109.0 turbine_hall_w = 62.0 diff --git a/process/models/buildings.py b/process/models/buildings.py index 696957247b..962729d506 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -214,14 +214,14 @@ def calculate_building_sizes_1992( # Calculate half width of building (m) # rxcl : clearance around reactor, m - # trcl : transportation clearance between components, m + # dr_plant_reactor_building_transport_clearance : transportation clearance between components, m # row : clearance to building wall for crane operation, m # 19.48258241468535 + 4 + max(13.764874193548387 - 4.7423258064516141, 17.123405859443331 - 2.9939411851091102) + 1 + 4 = 42.61204708901957 buildings_variables.wrbi = ( r_machine + buildings_variables.rxcl + dz_shld_full - + buildings_variables.trcl + + buildings_variables.dr_plant_reactor_building_transport_clearance + buildings_variables.row ) @@ -235,12 +235,16 @@ def calculate_building_sizes_1992( r_machine + buildings_variables.rxcl + dz_shld_full - + buildings_variables.trcl + + buildings_variables.dr_plant_reactor_building_transport_clearance + layl ) # Angle between diagonal length and floor (m) - ang = (buildings_variables.wrbi - buildings_variables.trcl - layl) / hy + ang = ( + buildings_variables.wrbi + - buildings_variables.dr_plant_reactor_building_transport_clearance + - layl + ) / hy # Cap angle at 1 if abs(ang) > 1.0e0: @@ -248,7 +252,7 @@ def calculate_building_sizes_1992( # Length to allow laydown (m) drbi = ( - buildings_variables.trcl + buildings_variables.dr_plant_reactor_building_transport_clearance + layl + hy * np.sin(np.arccos(ang)) + buildings_variables.wrbi @@ -277,7 +281,7 @@ def calculate_building_sizes_1992( buildings_variables.clh2 + 2.0e0 * dz_tf_full + buildings_variables.dz_tf_cryostat - + buildings_variables.trcl + + buildings_variables.dr_plant_reactor_building_transport_clearance + crcl + buildings_variables.stcl ) @@ -319,7 +323,7 @@ def calculate_building_sizes_1992( tcw = ( r_shld_outboard_outer - r_shld_inboard_inner - + 4.0e0 * buildings_variables.trcl + + 4.0e0 * buildings_variables.dr_plant_reactor_building_transport_clearance ) tcl = 5.0e0 * tcw + 2.0e0 * buildings_variables.hcwt @@ -356,7 +360,7 @@ def calculate_building_sizes_1992( rmbh = ( 10.0e0 + dz_shld - + buildings_variables.trcl + + buildings_variables.dr_plant_reactor_building_transport_clearance + cran + buildings_variables.stcl + buildings_variables.fndt diff --git a/process/models/ife.py b/process/models/ife.py index fe3a2a7257..19b5b4fbb1 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -930,7 +930,7 @@ def bld2019(self): ife_variables.v3dzu = ( (ife_variables.zu6 + ife_variables.zl6) - + buildings_variables.trcl + + buildings_variables.dr_plant_reactor_building_transport_clearance + buildings_variables.stcl + 5.1 + 9.41e-6 * 1.0e5 @@ -2309,7 +2309,10 @@ def ifebdg(self, output: bool = False): # Transport corridor size - tcw = ife_variables.r6 + 4.0 * buildings_variables.trcl + tcw = ( + ife_variables.r6 + + 4.0 * buildings_variables.dr_plant_reactor_building_transport_clearance + ) tcl = 5.0 * tcw + 2.0 * buildings_variables.hcwt # Decontamination cell size @@ -2341,7 +2344,7 @@ def ifebdg(self, output: bool = False): rmbh = ( 10.0 + (ife_variables.zl6 + ife_variables.zu6) - + buildings_variables.trcl + + buildings_variables.dr_plant_reactor_building_transport_clearance + cran + 5.1 + buildings_variables.stcl diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index 4661513fb1..21b66623a0 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -761,7 +761,7 @@ def test_bldgs_sizes(buildings, bldgssizesparam, monkeypatch): class BldgsParam(NamedTuple): wrbi: Any rxcl: Any - trcl: Any + dr_plant_reactor_building_transport_clearance: Any row: Any wgt: Any shmf: Any @@ -825,7 +825,7 @@ class BldgsParam(NamedTuple): BldgsParam( wrbi=0, rxcl=4, - trcl=1, + dr_plant_reactor_building_transport_clearance=1, row=4, wgt=500000, shmf=0.5, @@ -885,7 +885,7 @@ class BldgsParam(NamedTuple): BldgsParam( wrbi=42.612047089019569, rxcl=4, - trcl=1, + dr_plant_reactor_building_transport_clearance=1, row=4, wgt=500000, shmf=0.5, @@ -947,7 +947,11 @@ class BldgsParam(NamedTuple): def test_bldgs(buildings, bldgsparam, monkeypatch): monkeypatch.setattr(buildings_variables, "wrbi", bldgsparam.wrbi) monkeypatch.setattr(buildings_variables, "rxcl", bldgsparam.rxcl) - monkeypatch.setattr(buildings_variables, "trcl", bldgsparam.trcl) + monkeypatch.setattr( + buildings_variables, + "dr_plant_reactor_building_transport_clearance", + bldgsparam.dr_plant_reactor_building_transport_clearance, + ) monkeypatch.setattr(buildings_variables, "row", bldgsparam.row) monkeypatch.setattr(buildings_variables, "wgt", bldgsparam.wgt) monkeypatch.setattr(buildings_variables, "shmf", bldgsparam.shmf) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index 694fe8450d..f76d0d56e1 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2272,7 +2272,7 @@ def test_ifepw1(ifepw1param, monkeypatch, ife): class Bld2019Param(NamedTuple): a_fw_total: Any = None - trcl: Any = None + dr_plant_reactor_building_transport_clearance: Any = None stcl: Any = None tbr: Any = None f_p_blkt_multiplication: Any = None @@ -2364,7 +2364,7 @@ class Bld2019Param(NamedTuple): ( Bld2019Param( a_fw_total=0.0, - trcl=1.0, + dr_plant_reactor_building_transport_clearance=1.0, stcl=3.0, tbr=0.0, f_p_blkt_multiplication=1.26, @@ -2645,7 +2645,11 @@ def test_bld2019(bld2019param, monkeypatch, ife): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ monkeypatch.setattr(first_wall_variables, "a_fw_total", bld2019param.a_fw_total) - monkeypatch.setattr(buildings_variables, "trcl", bld2019param.trcl) + monkeypatch.setattr( + buildings_variables, + "dr_plant_reactor_building_transport_clearance", + bld2019param.dr_plant_reactor_building_transport_clearance, + ) monkeypatch.setattr(buildings_variables, "stcl", bld2019param.stcl) monkeypatch.setattr(fwbs_variables, "tbr", bld2019param.tbr) monkeypatch.setattr( @@ -2860,7 +2864,7 @@ class IfebdgParam(NamedTuple): dx_plant_reactor_building_wall: Any = None dz_plant_reactor_building_roof: Any = None fndt: Any = None - trcl: Any = None + dr_plant_reactor_building_transport_clearance: Any = None hcwt: Any = None hccl: Any = None wgt2: Any = None @@ -2909,7 +2913,7 @@ class IfebdgParam(NamedTuple): dx_plant_reactor_building_wall=3.2000000000000002, dz_plant_reactor_building_roof=3.2000000000000002, fndt=2.0, - trcl=1.0, + dr_plant_reactor_building_transport_clearance=1.0, hcwt=1.5, hccl=5.0, wgt2=100000.0, @@ -2975,7 +2979,11 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): ifebdgparam.dz_plant_reactor_building_roof, ) monkeypatch.setattr(buildings_variables, "fndt", ifebdgparam.fndt) - monkeypatch.setattr(buildings_variables, "trcl", ifebdgparam.trcl) + monkeypatch.setattr( + buildings_variables, + "dr_plant_reactor_building_transport_clearance", + ifebdgparam.dr_plant_reactor_building_transport_clearance, + ) monkeypatch.setattr(buildings_variables, "hcwt", ifebdgparam.hcwt) monkeypatch.setattr(buildings_variables, "hccl", ifebdgparam.hccl) monkeypatch.setattr(buildings_variables, "wgt2", ifebdgparam.wgt2) From 2534ac545ce450d075408bd0813c1dccb07d3a91 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 25 Mar 2026 14:13:40 +0000 Subject: [PATCH 24/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20distance=20variab?= =?UTF-8?q?le=20for=20building=20wall=20to=20improve=20clarity=20and=20con?= =?UTF-8?q?sistency=20across=20the=20codebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/data_structure/buildings_variables.py | 6 +++--- process/models/buildings.py | 18 +++++++++++------- process/models/ife.py | 10 ++++++---- tests/unit/test_buildings.py | 16 +++++++++++----- tests/unit/test_ife.py | 14 ++++++++++---- 5 files changed, 41 insertions(+), 23 deletions(-) diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index 0244b1adf8..1d6236b49e 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -546,7 +546,7 @@ """[cold] workshop buildings height (m)""" -wrbi: float = None +dr_plant_reactor_building_internal_half: float = None """distance from centre of machine to building wall (m)""" @@ -749,7 +749,7 @@ def init_buildings_variables(): workshop_l, \ workshop_w, \ workshop_h, \ - wrbi, \ + dr_plant_reactor_building_internal_half, \ vol_plant_warm_shop_building, \ wsvfac, \ a_reactor_bldg, \ @@ -903,7 +903,7 @@ def init_buildings_variables(): workshop_h = 10.0 wgt = 5.0e5 wgt2 = 1.0e5 - wrbi = 0.0 + dr_plant_reactor_building_internal_half = 0.0 wsvfac = 1.9 vol_plant_warm_shop_building = 0.0 a_reactor_bldg = 8.32e3 diff --git a/process/models/buildings.py b/process/models/buildings.py index 962729d506..293ec69f53 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -217,7 +217,7 @@ def calculate_building_sizes_1992( # dr_plant_reactor_building_transport_clearance : transportation clearance between components, m # row : clearance to building wall for crane operation, m # 19.48258241468535 + 4 + max(13.764874193548387 - 4.7423258064516141, 17.123405859443331 - 2.9939411851091102) + 1 + 4 = 42.61204708901957 - buildings_variables.wrbi = ( + buildings_variables.dr_plant_reactor_building_internal_half = ( r_machine + buildings_variables.rxcl + dz_shld_full @@ -241,7 +241,7 @@ def calculate_building_sizes_1992( # Angle between diagonal length and floor (m) ang = ( - buildings_variables.wrbi + buildings_variables.dr_plant_reactor_building_internal_half - buildings_variables.dr_plant_reactor_building_transport_clearance - layl ) / hy @@ -255,7 +255,7 @@ def calculate_building_sizes_1992( buildings_variables.dr_plant_reactor_building_transport_clearance + layl + hy * np.sin(np.arccos(ang)) - + buildings_variables.wrbi + + buildings_variables.dr_plant_reactor_building_internal_half ) # Crane height based on maximum lift (m) @@ -288,7 +288,11 @@ def calculate_building_sizes_1992( # Internal volume (m3) vrci = ( - buildings_variables.rbvfac * 2.0e0 * buildings_variables.wrbi * drbi * hrbi + buildings_variables.rbvfac + * 2.0e0 + * buildings_variables.dr_plant_reactor_building_internal_half + * drbi + * hrbi ) try: assert vrci < np.inf @@ -301,7 +305,7 @@ def calculate_building_sizes_1992( # dz_plant_reactor_building_roof : reactor building roof thickness, m # fndt : foundation thickness, m rbw = ( - 2.0e0 * buildings_variables.wrbi + 2.0e0 * buildings_variables.dr_plant_reactor_building_internal_half + 2.0e0 * buildings_variables.dx_plant_reactor_building_wall ) rbl = drbi + 2.0e0 * buildings_variables.dx_plant_reactor_building_wall @@ -416,8 +420,8 @@ def calculate_building_sizes_1992( po.ovarre( self.outfile, "Dist from centre of torus to bldg wall (m)", - "(wrbi)", - buildings_variables.wrbi, + "(dr_plant_reactor_building_internal_half)", + buildings_variables.dr_plant_reactor_building_internal_half, ) po.ovarre( self.outfile, diff --git a/process/models/ife.py b/process/models/ife.py index 19b5b4fbb1..0d9bd6eeef 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2273,10 +2273,12 @@ def ifebdg(self, output: bool = False): hrbi = ife_variables.zl7 + ife_variables.zu7 # Distance from centre of device to wall - buildings_variables.wrbi = ife_variables.r7 + buildings_variables.dr_plant_reactor_building_internal_half = ife_variables.r7 # Internal volume (square floor) - vrci = (2.0 * buildings_variables.wrbi) ** 2 * hrbi + vrci = ( + 2.0 * buildings_variables.dr_plant_reactor_building_internal_half + ) ** 2 * hrbi # External dimensions # RBWT = wall thickness @@ -2411,8 +2413,8 @@ def ifebdg(self, output: bool = False): process_output.ovarre( self.outfile, "Dist from device centre to bldg wall (m)", - "(wrbi)", - buildings_variables.wrbi, + "(dr_plant_reactor_building_internal_half)", + buildings_variables.dr_plant_reactor_building_internal_half, ) process_output.ovarre( self.outfile, diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index 21b66623a0..286acc1794 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -759,7 +759,7 @@ def test_bldgs_sizes(buildings, bldgssizesparam, monkeypatch): class BldgsParam(NamedTuple): - wrbi: Any + dr_plant_reactor_building_internal_half: Any rxcl: Any dr_plant_reactor_building_transport_clearance: Any row: Any @@ -823,7 +823,7 @@ class BldgsParam(NamedTuple): "bldgsparam", ( BldgsParam( - wrbi=0, + dr_plant_reactor_building_internal_half=0, rxcl=4, dr_plant_reactor_building_transport_clearance=1, row=4, @@ -883,7 +883,7 @@ class BldgsParam(NamedTuple): expected_elev=51601.097615432001, ), BldgsParam( - wrbi=42.612047089019569, + dr_plant_reactor_building_internal_half=42.612047089019569, rxcl=4, dr_plant_reactor_building_transport_clearance=1, row=4, @@ -945,7 +945,11 @@ class BldgsParam(NamedTuple): ), ) def test_bldgs(buildings, bldgsparam, monkeypatch): - monkeypatch.setattr(buildings_variables, "wrbi", bldgsparam.wrbi) + monkeypatch.setattr( + buildings_variables, + "dr_plant_reactor_building_internal_half", + bldgsparam.dr_plant_reactor_building_internal_half, + ) monkeypatch.setattr(buildings_variables, "rxcl", bldgsparam.rxcl) monkeypatch.setattr( buildings_variables, @@ -1014,7 +1018,9 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): helpow=bldgsparam.helpow, ) - assert buildings_variables.wrbi == pytest.approx(bldgsparam.expected_wrbi) + assert buildings_variables.dr_plant_reactor_building_internal_half == pytest.approx( + bldgsparam.expected_wrbi + ) assert buildings_variables.a_plant_floor_effective == pytest.approx( bldgsparam.expected_a_plant_floor_effective ) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index f76d0d56e1..db01093250 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2860,7 +2860,7 @@ def test_ifeacp(ifeacpparam, monkeypatch, ife): class IfebdgParam(NamedTuple): - wrbi: Any = None + dr_plant_reactor_building_internal_half: Any = None dx_plant_reactor_building_wall: Any = None dz_plant_reactor_building_roof: Any = None fndt: Any = None @@ -2909,7 +2909,7 @@ class IfebdgParam(NamedTuple): "ifebdgparam", ( IfebdgParam( - wrbi=0.0, + dr_plant_reactor_building_internal_half=0.0, dx_plant_reactor_building_wall=3.2000000000000002, dz_plant_reactor_building_roof=3.2000000000000002, fndt=2.0, @@ -2967,7 +2967,11 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): :param monkeypatch: pytest fixture used to mock module/class variables :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(buildings_variables, "wrbi", ifebdgparam.wrbi) + monkeypatch.setattr( + buildings_variables, + "dr_plant_reactor_building_internal_half", + ifebdgparam.dr_plant_reactor_building_internal_half, + ) monkeypatch.setattr( buildings_variables, "dx_plant_reactor_building_wall", @@ -3038,7 +3042,9 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): ife.ifebdg() - assert buildings_variables.wrbi == pytest.approx(ifebdgparam.expected_wrbi) + assert buildings_variables.dr_plant_reactor_building_internal_half == pytest.approx( + ifebdgparam.expected_wrbi + ) assert buildings_variables.a_plant_floor_effective == pytest.approx( ifebdgparam.expected_a_plant_floor_effective ) From 8b426fca6a70cec251aa40278fcb92d370fb57ef Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 25 Mar 2026 14:14:42 +0000 Subject: [PATCH 25/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20reactor=20buildin?= =?UTF-8?q?g=20crane=20capacity=20variable=20for=20clarity=20and=20consist?= =?UTF-8?q?ency=20across=20the=20codebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/core/input.py | 2 +- process/data_structure/buildings_variables.py | 6 +++--- process/models/buildings.py | 6 +++--- tests/unit/test_buildings.py | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/process/core/input.py b/process/core/input.py index 0f839f21a7..946b9d9cfd 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -1779,7 +1779,7 @@ def __post_init__(self): "watertemp": InputVariable( data_structure.water_usage_variables, float, range=(0.0, 25.0) ), - "wgt": InputVariable( + "m_plant_reactor_building_crane_capacity": InputVariable( data_structure.buildings_variables, float, range=(10000.0, 1000000.0) ), "wgt2": InputVariable( diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index 1d6236b49e..748b9694d5 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -526,7 +526,7 @@ """water, laundry & drainage buildings height (m)""" -wgt: float = None +m_plant_reactor_building_crane_capacity: float = None """reactor building crane capacity (kg) (calculated if 0 is input)""" @@ -744,7 +744,7 @@ def init_buildings_variables(): water_buildings_l, \ water_buildings_w, \ water_buildings_h, \ - wgt, \ + m_plant_reactor_building_crane_capacity, \ wgt2, \ workshop_l, \ workshop_w, \ @@ -901,7 +901,7 @@ def init_buildings_variables(): workshop_l = 150.0 workshop_w = 125.0 workshop_h = 10.0 - wgt = 5.0e5 + m_plant_reactor_building_crane_capacity = 5.0e5 wgt2 = 1.0e5 dr_plant_reactor_building_internal_half = 0.0 wsvfac = 1.9 diff --git a/process/models/buildings.py b/process/models/buildings.py index 293ec69f53..8c1145eba3 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -259,12 +259,12 @@ def calculate_building_sizes_1992( ) # Crane height based on maximum lift (m) - # wgt : reactor building crane capacity (kg) + # m_plant_reactor_building_crane_capacity : reactor building crane capacity (kg) # Calculated if 0 is input # shmf : fraction of shield mass per TF coil to be moved in # the maximum shield lift - if buildings_variables.wgt > 1.0e0: - wt = buildings_variables.wgt + if buildings_variables.m_plant_reactor_building_crane_capacity > 1.0e0: + wt = buildings_variables.m_plant_reactor_building_crane_capacity else: wt = buildings_variables.shmf * m_shld_total / n_tf_coils wt = max(wt, 1.0e3 * m_pf_coil_max, 1.0e3 * m_tf_coil_tonne) diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index 286acc1794..c97d83d30e 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -763,7 +763,7 @@ class BldgsParam(NamedTuple): rxcl: Any dr_plant_reactor_building_transport_clearance: Any row: Any - wgt: Any + m_plant_reactor_building_crane_capacity: Any shmf: Any clh2: Any dz_tf_cryostat: Any @@ -827,7 +827,7 @@ class BldgsParam(NamedTuple): rxcl=4, dr_plant_reactor_building_transport_clearance=1, row=4, - wgt=500000, + m_plant_reactor_building_crane_capacity=500000, shmf=0.5, clh2=15, dz_tf_cryostat=5.7514039424138126, @@ -887,7 +887,7 @@ class BldgsParam(NamedTuple): rxcl=4, dr_plant_reactor_building_transport_clearance=1, row=4, - wgt=500000, + m_plant_reactor_building_crane_capacity=500000, shmf=0.5, clh2=15, dz_tf_cryostat=5.8405005070918357, @@ -957,7 +957,7 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): bldgsparam.dr_plant_reactor_building_transport_clearance, ) monkeypatch.setattr(buildings_variables, "row", bldgsparam.row) - monkeypatch.setattr(buildings_variables, "wgt", bldgsparam.wgt) + monkeypatch.setattr(buildings_variables, "m_plant_reactor_building_crane_capacity", bldgsparam.m_plant_reactor_building_crane_capacity) monkeypatch.setattr(buildings_variables, "shmf", bldgsparam.shmf) monkeypatch.setattr(buildings_variables, "clh2", bldgsparam.clh2) monkeypatch.setattr(buildings_variables, "dz_tf_cryostat", bldgsparam.dz_tf_cryostat) From 754558e518a0014d2bfcc5286dfe302964fb0867 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 25 Mar 2026 14:17:01 +0000 Subject: [PATCH 26/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20tritium=20buildin?= =?UTF-8?q?g=20volume=20variable=20to=20improve=20clarity=20and=20consiste?= =?UTF-8?q?ncy=20across=20the=20codebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/core/init.py | 2 +- process/core/input.py | 2 +- process/data_structure/buildings_variables.py | 6 +++--- process/models/buildings.py | 8 ++++---- process/models/costs/costs.py | 2 +- process/models/ife.py | 8 ++++---- tests/unit/test_buildings.py | 8 ++++---- tests/unit/test_costs_1990.py | 8 ++++---- tests/unit/test_ife.py | 6 +++--- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/process/core/init.py b/process/core/init.py index e3dada67a7..e0f5ae2e9c 100644 --- a/process/core/init.py +++ b/process/core/init.py @@ -403,7 +403,7 @@ def check_process(inputs): # noqa: ARG001 if ( data_structure.physics_variables.f_plasma_fuel_tritium < 1.0e-3 ): # tritium fraction is negligible - data_structure.buildings_variables.triv = 0.0 + data_structure.buildings_variables.vol_plant_tritium_fuel_building = 0.0 data_structure.heat_transport_variables.p_tritium_plant_electric_mw = 0.0 if data_structure.impurity_radiation_module.f_nd_impurity_electrons[1] != 0.1: diff --git a/process/core/input.py b/process/core/input.py index 946b9d9cfd..67d537bba1 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -1598,7 +1598,7 @@ def __post_init__(self): "p_tritium_plant_electric_mw": InputVariable( data_structure.heat_transport_variables, float, range=(0.0, 100.0) ), - "triv": InputVariable( + "vol_plant_tritium_fuel_building": InputVariable( data_structure.buildings_variables, float, range=(10000.0, 1000000.0) ), "turbine_hall_h": InputVariable( diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index 748b9694d5..a06f9eb0a1 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -466,7 +466,7 @@ """transportation clearance between components (m)""" -triv: float = None +vol_plant_tritium_fuel_building: float = None """volume of tritium, fuel handling and health physics buildings (m3)""" @@ -729,7 +729,7 @@ def init_buildings_variables(): vol_plant_tf_power_supplies_building, \ transp_clrnc, \ dr_plant_reactor_building_transport_clearance, \ - triv, \ + vol_plant_tritium_fuel_building, \ turbine_hall_l, \ turbine_hall_w, \ turbine_hall_h, \ @@ -883,7 +883,7 @@ def init_buildings_variables(): vol_plant_tf_power_supplies_building = 2.0e4 transp_clrnc = 1.0 dr_plant_reactor_building_transport_clearance = 1.0 - triv = 4.0e4 + vol_plant_tritium_fuel_building = 4.0e4 turbine_hall_l = 109.0 turbine_hall_w = 62.0 turbine_hall_h = 15.0 diff --git a/process/models/buildings.py b/process/models/buildings.py index 8c1145eba3..dea99f77c3 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -395,7 +395,7 @@ def calculate_building_sizes_1992( rbv + rmbv + wsv - + buildings_variables.triv + + buildings_variables.vol_plant_tritium_fuel_building + elev + buildings_variables.conv + cryv @@ -407,7 +407,7 @@ def calculate_building_sizes_1992( buildings_variables.convol = buildings_variables.conv # Total volume of nuclear buildings - buildings_variables.volnucb = vrci + rmbv + wsv + buildings_variables.triv + cryv + buildings_variables.volnucb = vrci + rmbv + wsv + buildings_variables.vol_plant_tritium_fuel_building + cryv # Output ! # !!!!!!!!! @@ -437,8 +437,8 @@ def calculate_building_sizes_1992( po.ovarre( self.outfile, "Tritium building volume (m3)", - "(triv)", - buildings_variables.triv, + "(vol_plant_tritium_fuel_building)", + buildings_variables.vol_plant_tritium_fuel_building, ) po.ovarre(self.outfile, "Electrical building volume (m3)", "(elev)", elev) po.ovarre( diff --git a/process/models/costs/costs.py b/process/models/costs/costs.py index 5f93540e89..9f74314deb 100644 --- a/process/models/costs/costs.py +++ b/process/models/costs/costs.py @@ -1119,7 +1119,7 @@ def acc21(self): cost_variables.c215 = ( 1.0e-6 * cost_variables.UCTR - * buildings_variables.triv**exprb + * buildings_variables.vol_plant_tritium_fuel_building**exprb * cmlsa[cost_variables.lsa - 1] ) diff --git a/process/models/ife.py b/process/models/ife.py index 0d9bd6eeef..7282df9e26 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2380,7 +2380,7 @@ def ifebdg(self, output: bool = False): rbv + rmbv + wsv - + buildings_variables.triv + + buildings_variables.vol_plant_tritium_fuel_building + elev + buildings_variables.conv + cryv @@ -2401,7 +2401,7 @@ def ifebdg(self, output: bool = False): # Total volume of nuclear buildings - buildings_variables.volnucb = vrci + rmbv + wsv + buildings_variables.triv + cryv + buildings_variables.volnucb = vrci + rmbv + wsv + buildings_variables.vol_plant_tritium_fuel_building + cryv if not output: return @@ -2430,8 +2430,8 @@ def ifebdg(self, output: bool = False): process_output.ovarre( self.outfile, "Tritium building volume (m3)", - "(triv)", - buildings_variables.triv, + "(vol_plant_tritium_fuel_building)", + buildings_variables.vol_plant_tritium_fuel_building, ) process_output.ovarre( self.outfile, "Electrical building volume (m3)", "(elev)", elev diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index c97d83d30e..b371b87da9 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -783,7 +783,7 @@ class BldgsParam(NamedTuple): pibv: Any a_plant_floor_effective: Any admvol: Any - triv: Any + vol_plant_tritium_fuel_building: Any conv: Any admv: Any shov: Any @@ -847,7 +847,7 @@ class BldgsParam(NamedTuple): pibv=20000, a_plant_floor_effective=0, admvol=0, - triv=40000, + vol_plant_tritium_fuel_building=40000, conv=60000, admv=100000, shov=100000, @@ -907,7 +907,7 @@ class BldgsParam(NamedTuple): pibv=20000, a_plant_floor_effective=379235.17804514873, admvol=100000, - triv=40000, + vol_plant_tritium_fuel_building=40000, conv=60000, admv=100000, shov=100000, @@ -993,7 +993,7 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): bldgsparam.a_plant_floor_effective, ) monkeypatch.setattr(buildings_variables, "admvol", bldgsparam.admvol) - monkeypatch.setattr(buildings_variables, "triv", bldgsparam.triv) + monkeypatch.setattr(buildings_variables, "vol_plant_tritium_fuel_building", bldgsparam.vol_plant_tritium_fuel_building) monkeypatch.setattr(buildings_variables, "conv", bldgsparam.conv) monkeypatch.setattr(buildings_variables, "admv", bldgsparam.admv) monkeypatch.setattr(buildings_variables, "shov", bldgsparam.shov) diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index 9e1d139c0c..44f8efa5dc 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -711,7 +711,7 @@ def test_acc9(monkeypatch, costs): class Acc21Param(NamedTuple): shovol: Any = None - triv: Any = None + vol_plant_tritium_fuel_building: Any = None vol_plant_electrical_building: Any = None @@ -801,7 +801,7 @@ class Acc21Param(NamedTuple): ( Acc21Param( shovol=100000, - triv=40000, + vol_plant_tritium_fuel_building=40000, vol_plant_electrical_building=51601.097615432001, vol_plant_reactor_building=1356973.2891062023, vol_plant_cryoplant_building=15247.180612719381, @@ -846,7 +846,7 @@ class Acc21Param(NamedTuple): ), Acc21Param( shovol=100000, - triv=40000, + vol_plant_tritium_fuel_building=40000, vol_plant_electrical_building=51609.268177478581, vol_plant_reactor_building=1358540.6868905292, vol_plant_cryoplant_building=25826.919937316459, @@ -906,7 +906,7 @@ def test_acc21(acc21param, monkeypatch, costs): monkeypatch.setattr(buildings_variables, "shovol", acc21param.shovol) - monkeypatch.setattr(buildings_variables, "triv", acc21param.triv) + monkeypatch.setattr(buildings_variables, "vol_plant_tritium_fuel_building", acc21param.vol_plant_tritium_fuel_building) monkeypatch.setattr( buildings_variables, diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index db01093250..a77b97290e 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2871,7 +2871,7 @@ class IfebdgParam(NamedTuple): stcl: Any = None pibv: Any = None a_plant_floor_effective: Any = None - triv: Any = None + vol_plant_tritium_fuel_building: Any = None conv: Any = None admv: Any = None shov: Any = None @@ -2920,7 +2920,7 @@ class IfebdgParam(NamedTuple): stcl=3.0, pibv=40000.0, a_plant_floor_effective=0.0, - triv=40000.0, + vol_plant_tritium_fuel_building=40000.0, conv=60000.0, admv=100000.0, shov=100000.0, @@ -2998,7 +2998,7 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): "a_plant_floor_effective", ifebdgparam.a_plant_floor_effective, ) - monkeypatch.setattr(buildings_variables, "triv", ifebdgparam.triv) + monkeypatch.setattr(buildings_variables, "vol_plant_tritium_fuel_building", ifebdgparam.vol_plant_tritium_fuel_building) monkeypatch.setattr(buildings_variables, "conv", ifebdgparam.conv) monkeypatch.setattr(buildings_variables, "admv", ifebdgparam.admv) monkeypatch.setattr(buildings_variables, "shov", ifebdgparam.shov) From f3ec162abf6ddf8cc45595c0e13bf4f458a85aef Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 25 Mar 2026 14:20:21 +0000 Subject: [PATCH 27/28] =?UTF-8?q?=F0=9F=94=84=20Rename=20nuclear=20buildin?= =?UTF-8?q?g=20volume=20variable=20for=20clarity=20and=20consistency=20acr?= =?UTF-8?q?oss=20the=20codebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/unique-models/buildings_sizes.md | 2 +- process/data_structure/buildings_variables.py | 6 +++--- process/models/buildings.py | 12 ++++++------ process/models/ife.py | 6 +++--- tests/unit/test_buildings.py | 18 +++++++++--------- tests/unit/test_ife.py | 8 ++++---- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/documentation/source/unique-models/buildings_sizes.md b/documentation/source/unique-models/buildings_sizes.md index 9b4570b15d..5dfaa8423d 100644 --- a/documentation/source/unique-models/buildings_sizes.md +++ b/documentation/source/unique-models/buildings_sizes.md @@ -141,4 +141,4 @@ Amalgamating multiple individual buildings (and using an average height), this e ## Summary variables - Effective floor area for AC power module, `a_plant_floor_effective`: total floor area (m2) across all buildings. This estimate attempts to account for multiple floors within buildings by assuming an average storey height of 6m across the site; the volume of all buildings is therefore summed and divided by 6. -- Total volume of nuclear buildings, `volnucb`: sum of all nuclear building (external) volumes. +- Total volume of nuclear buildings, `vol_plant_nuclear_buildings`: sum of all nuclear building (external) volumes. diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index a06f9eb0a1..c84a7bb90c 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -498,7 +498,7 @@ """internal volume of reactor building (m3)""" -volnucb: float = None +vol_plant_nuclear_buildings: float = None """sum of nuclear buildings volumes (m3)""" @@ -737,7 +737,7 @@ def init_buildings_variables(): tw_storage_w, \ tw_storage_h, \ vol_plant_reactor_building_internal, \ - volnucb, \ + vol_plant_nuclear_buildings, \ warm_shop_l, \ warm_shop_w, \ warm_shop_h, \ @@ -890,7 +890,7 @@ def init_buildings_variables(): tw_storage_l = 90.0 tw_storage_w = 30.0 tw_storage_h = 5.0 - volnucb = 0.0 + vol_plant_nuclear_buildings = 0.0 vol_plant_reactor_building_internal = 0.0 warm_shop_l = 100.0 warm_shop_w = 50.0 diff --git a/process/models/buildings.py b/process/models/buildings.py index dea99f77c3..2c8a07bcac 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -407,7 +407,7 @@ def calculate_building_sizes_1992( buildings_variables.convol = buildings_variables.conv # Total volume of nuclear buildings - buildings_variables.volnucb = vrci + rmbv + wsv + buildings_variables.vol_plant_tritium_fuel_building + cryv + buildings_variables.vol_plant_nuclear_buildings = vrci + rmbv + wsv + buildings_variables.vol_plant_tritium_fuel_building + cryv # Output ! # !!!!!!!!! @@ -460,8 +460,8 @@ def calculate_building_sizes_1992( po.ovarre( self.outfile, "Total volume of nuclear buildings (m3)", - "(volnucb)", - buildings_variables.volnucb, + "(vol_plant_nuclear_buildings)", + buildings_variables.vol_plant_nuclear_buildings, ) return cryv, vrci, rbv, rmbv, wsv, elev @@ -1065,7 +1065,7 @@ def calculate_building_sizes_chapman(self, output, tf_radial_dim, tf_vertical_di buildings_variables.a_plant_floor_effective = buildings_total_vol / 6.0e0 # Total volume of nuclear buildings - buildings_variables.volnucb = reactor_build_totvol + hotcell_vol_ext + buildings_variables.vol_plant_nuclear_buildings = reactor_build_totvol + hotcell_vol_ext # Output if output: @@ -1272,8 +1272,8 @@ def calculate_building_sizes_chapman(self, output, tf_radial_dim, tf_vertical_di po.ovarre( self.outfile, "Total volume of nuclear buildings (m3)", - "(volnucb)", - buildings_variables.volnucb, + "(vol_plant_nuclear_buildings)", + buildings_variables.vol_plant_nuclear_buildings, ) if buildings_variables.i_bldgs_v == 1: diff --git a/process/models/ife.py b/process/models/ife.py index 7282df9e26..f27b581f5e 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2401,7 +2401,7 @@ def ifebdg(self, output: bool = False): # Total volume of nuclear buildings - buildings_variables.volnucb = vrci + rmbv + wsv + buildings_variables.vol_plant_tritium_fuel_building + cryv + buildings_variables.vol_plant_nuclear_buildings = vrci + rmbv + wsv + buildings_variables.vol_plant_tritium_fuel_building + cryv if not output: return @@ -2457,8 +2457,8 @@ def ifebdg(self, output: bool = False): process_output.ovarre( self.outfile, "Total volume of nuclear buildings (m3)", - "(volnucb)", - buildings_variables.volnucb, + "(vol_plant_nuclear_buildings)", + buildings_variables.vol_plant_nuclear_buildings, ) def ifevac(self): diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index b371b87da9..c93daa3868 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -29,7 +29,7 @@ def buildings(): class BldgsSizesParam(NamedTuple): i_bldgs_v: Any a_plant_floor_effective: Any - volnucb: Any + vol_plant_nuclear_buildings: Any bioshld_thk: Any reactor_wall_thk: Any reactor_roof_thk: Any @@ -172,7 +172,7 @@ class BldgsSizesParam(NamedTuple): BldgsSizesParam( i_bldgs_v=0, a_plant_floor_effective=0, - volnucb=0, + vol_plant_nuclear_buildings=0, bioshld_thk=2.5, reactor_wall_thk=2, reactor_roof_thk=1, @@ -311,7 +311,7 @@ class BldgsSizesParam(NamedTuple): BldgsSizesParam( i_bldgs_v=0, a_plant_floor_effective=1539392.0963074313, - volnucb=5212998.1139194397, + vol_plant_nuclear_buildings=5212998.1139194397, bioshld_thk=2.5, reactor_wall_thk=2, reactor_roof_thk=1, @@ -456,7 +456,7 @@ def test_bldgs_sizes(buildings, bldgssizesparam, monkeypatch): "a_plant_floor_effective", bldgssizesparam.a_plant_floor_effective, ) - monkeypatch.setattr(buildings_variables, "volnucb", bldgssizesparam.volnucb) + monkeypatch.setattr(buildings_variables, "vol_plant_nuclear_buildings", bldgssizesparam.vol_plant_nuclear_buildings) monkeypatch.setattr(buildings_variables, "bioshld_thk", bldgssizesparam.bioshld_thk) monkeypatch.setattr( buildings_variables, "reactor_wall_thk", bldgssizesparam.reactor_wall_thk @@ -789,7 +789,7 @@ class BldgsParam(NamedTuple): shov: Any shovol: Any convol: Any - volnucb: Any + vol_plant_nuclear_buildings: Any iprint: Any outfile: Any pfr: Any @@ -853,7 +853,7 @@ class BldgsParam(NamedTuple): shov=100000, shovol=0, convol=0, - volnucb=0, + vol_plant_nuclear_buildings=0, iprint=0, outfile=11, pfr=18.98258241468535, @@ -913,7 +913,7 @@ class BldgsParam(NamedTuple): shov=100000, shovol=100000, convol=60000, - volnucb=1812276.5359386117, + vol_plant_nuclear_buildings=1812276.5359386117, iprint=0, outfile=11, pfr=18.982980877139834, @@ -999,7 +999,7 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): monkeypatch.setattr(buildings_variables, "shov", bldgsparam.shov) monkeypatch.setattr(buildings_variables, "shovol", bldgsparam.shovol) monkeypatch.setattr(buildings_variables, "convol", bldgsparam.convol) - monkeypatch.setattr(buildings_variables, "volnucb", bldgsparam.volnucb) + monkeypatch.setattr(buildings_variables, "vol_plant_nuclear_buildings", bldgsparam.vol_plant_nuclear_buildings) cryv, vrci, rbv, rmbv, wsv, elev = buildings.iter_1992.calculate_building_sizes_1992( output=False, @@ -1027,7 +1027,7 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): assert buildings_variables.admvol == pytest.approx(bldgsparam.expected_admvol) assert buildings_variables.shovol == pytest.approx(bldgsparam.expected_shovol) assert buildings_variables.convol == pytest.approx(bldgsparam.expected_convol) - assert buildings_variables.volnucb == pytest.approx(bldgsparam.expected_volnucb) + assert buildings_variables.vol_plant_nuclear_buildings == pytest.approx(bldgsparam.expected_volnucb) assert cryv == pytest.approx(bldgsparam.expected_cryv) assert vrci == pytest.approx(bldgsparam.expected_vrci) diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index a77b97290e..f715751dbe 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2883,7 +2883,7 @@ class IfebdgParam(NamedTuple): shovol: Any = None vol_plant_reactor_building_internal: Any = None vol_plant_warm_shop_building: Any = None - volnucb: Any = None + vol_plant_nuclear_buildings: Any = None whtshld: Any = None helpow: Any = None zl7: Any = None @@ -2932,7 +2932,7 @@ class IfebdgParam(NamedTuple): shovol=0.0, vol_plant_reactor_building_internal=0.0, vol_plant_warm_shop_building=0.0, - volnucb=0.0, + vol_plant_nuclear_buildings=0.0, whtshld=1067310.9593707009, helpow=20277.29636048527, zl7=5.8499999999999996, @@ -3030,7 +3030,7 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): "vol_plant_warm_shop_building", ifebdgparam.vol_plant_warm_shop_building, ) - monkeypatch.setattr(buildings_variables, "volnucb", ifebdgparam.volnucb) + monkeypatch.setattr(buildings_variables, "vol_plant_nuclear_buildings", ifebdgparam.vol_plant_nuclear_buildings) monkeypatch.setattr(fwbs_variables, "whtshld", ifebdgparam.whtshld) monkeypatch.setattr(heat_transport_variables, "helpow", ifebdgparam.helpow) monkeypatch.setattr(ife_variables, "zl7", ifebdgparam.zl7) @@ -3066,7 +3066,7 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): assert buildings_variables.vol_plant_warm_shop_building == pytest.approx( ifebdgparam.expected_wsvol ) - assert buildings_variables.volnucb == pytest.approx(ifebdgparam.expected_volnucb) + assert buildings_variables.vol_plant_nuclear_buildings == pytest.approx(ifebdgparam.expected_volnucb) class Ifepw2Param(NamedTuple): From d4184f2522deb3cfa57bcfdc5bf96ac9cbfd9abe Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 25 Mar 2026 14:30:21 +0000 Subject: [PATCH 28/28] Refactor variable names for clarity and consistency in buildings and IFE modules --- process/models/buildings.py | 74 +++++++++++++++++++++++------------ process/models/ife.py | 8 +++- tests/unit/test_buildings.py | 28 ++++++++++--- tests/unit/test_costs_1990.py | 6 ++- tests/unit/test_ife.py | 16 ++++++-- 5 files changed, 98 insertions(+), 34 deletions(-) diff --git a/process/models/buildings.py b/process/models/buildings.py index 2c8a07bcac..b4df007765 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -181,7 +181,7 @@ def calculate_building_sizes_1992( Returns ------- - cryv: + vol_plant_cryogenics_building: volume of cryogenic building, m3 vrci: inner volume of reactor building, m3 @@ -228,7 +228,7 @@ def calculate_building_sizes_1992( # Calculate length to allow PF or cryostat laydown (m) # Laydown length (m) - layl = max(r_cryostat_outboard, r_pf_coil_outer_max) + len_reactor_laydown = max(r_cryostat_outboard, r_pf_coil_outer_max) # Diagonal length (m) hy = ( @@ -236,14 +236,14 @@ def calculate_building_sizes_1992( + buildings_variables.rxcl + dz_shld_full + buildings_variables.dr_plant_reactor_building_transport_clearance - + layl + + len_reactor_laydown ) # Angle between diagonal length and floor (m) ang = ( buildings_variables.dr_plant_reactor_building_internal_half - buildings_variables.dr_plant_reactor_building_transport_clearance - - layl + - len_reactor_laydown ) / hy # Cap angle at 1 @@ -253,7 +253,7 @@ def calculate_building_sizes_1992( # Length to allow laydown (m) drbi = ( buildings_variables.dr_plant_reactor_building_transport_clearance - + layl + + len_reactor_laydown + hy * np.sin(np.arccos(ang)) + buildings_variables.dr_plant_reactor_building_internal_half ) @@ -264,25 +264,35 @@ def calculate_building_sizes_1992( # shmf : fraction of shield mass per TF coil to be moved in # the maximum shield lift if buildings_variables.m_plant_reactor_building_crane_capacity > 1.0e0: - wt = buildings_variables.m_plant_reactor_building_crane_capacity + m_plant_reactor_building_crane_capacity = ( + buildings_variables.m_plant_reactor_building_crane_capacity + ) else: - wt = buildings_variables.shmf * m_shld_total / n_tf_coils - wt = max(wt, 1.0e3 * m_pf_coil_max, 1.0e3 * m_tf_coil_tonne) + m_plant_reactor_building_crane_capacity = ( + buildings_variables.shmf * m_shld_total / n_tf_coils + ) + m_plant_reactor_building_crane_capacity = max( + m_plant_reactor_building_crane_capacity, + 1.0e3 * m_pf_coil_max, + 1.0e3 * m_tf_coil_tonne, + ) # Crane height (m) - crcl = 9.41e-6 * wt + 5.1e0 + dz_plant_reactor_building_crane = ( + 9.41e-6 * m_plant_reactor_building_crane_capacity + 5.1e0 + ) # Building height (m) # dz_tf_cryostat : clearance from TF coil to cryostat top, m # clh2 : clearance beneath TF coil to foundation, including basement, m # stcl : clearance above crane to roof, m # Additional dz_tf_full allows TF coil to be lifted right out - hrbi = ( + dz_plant_reactor_building_internal = ( buildings_variables.clh2 + 2.0e0 * dz_tf_full + buildings_variables.dz_tf_cryostat + buildings_variables.dr_plant_reactor_building_transport_clearance - + crcl + + dz_plant_reactor_building_crane + buildings_variables.stcl ) @@ -292,7 +302,7 @@ def calculate_building_sizes_1992( * 2.0e0 * buildings_variables.dr_plant_reactor_building_internal_half * drbi - * hrbi + * dz_plant_reactor_building_internal ) try: assert vrci < np.inf @@ -310,7 +320,7 @@ def calculate_building_sizes_1992( ) rbl = drbi + 2.0e0 * buildings_variables.dx_plant_reactor_building_wall rbh = ( - hrbi + dz_plant_reactor_building_internal + buildings_variables.dz_plant_reactor_building_roof + buildings_variables.fndt ) @@ -324,15 +334,15 @@ def calculate_building_sizes_1992( # Transport corridor size # hcwt : hot cell wall thickness, m - tcw = ( + dr_plant_transport_corridor = ( r_shld_outboard_outer - r_shld_inboard_inner + 4.0e0 * buildings_variables.dr_plant_reactor_building_transport_clearance ) - tcl = 5.0e0 * tcw + 2.0e0 * buildings_variables.hcwt + tcl = 5.0e0 * dr_plant_transport_corridor + 2.0e0 * buildings_variables.hcwt # Decontamination cell size - dcw = 2.0e0 * tcw + 1.0e0 + dcw = 2.0e0 * dr_plant_transport_corridor + 1.0e0 # Hot cell size # hccl : clearance around components in hot cell, m @@ -345,7 +355,7 @@ def calculate_building_sizes_1992( hcl = ( 3.0e0 * (r_shld_outboard_outer - r_shld_inboard_inner) + 4.0e0 * buildings_variables.hccl - + tcw + + dr_plant_transport_corridor ) # Maintenance building dimensions @@ -372,14 +382,17 @@ def calculate_building_sizes_1992( tch = dz_shld + buildings_variables.stcl + buildings_variables.fndt # Volume - rmbv = buildings_variables.mbvfac * rmbw * rmbl * rmbh + tcw * tcl * tch + rmbv = ( + buildings_variables.mbvfac * rmbw * rmbl * rmbh + + dr_plant_transport_corridor * tcl * tch + ) # Warm shop and hot cell gallery wsa = (rmbw + 7.0e0) * 20.0e0 + rmbl * 7.0e0 wsv = buildings_variables.wsvfac * wsa * rmbh # Cryogenic building volume - cryv = 55.0e0 * helpow**0.5 + vol_plant_cryogenics_building = 55.0e0 * helpow**0.5 # Other building volumes # pibv : power injection building volume, m3 # esbldgm3 is forced to be zero if no energy storage is required (i_pulsed_plant=0) @@ -398,7 +411,7 @@ def calculate_building_sizes_1992( + buildings_variables.vol_plant_tritium_fuel_building + elev + buildings_variables.conv - + cryv + + vol_plant_cryogenics_building + buildings_variables.admv + buildings_variables.shov ) / 6.0e0 @@ -407,7 +420,13 @@ def calculate_building_sizes_1992( buildings_variables.convol = buildings_variables.conv # Total volume of nuclear buildings - buildings_variables.vol_plant_nuclear_buildings = vrci + rmbv + wsv + buildings_variables.vol_plant_tritium_fuel_building + cryv + buildings_variables.vol_plant_nuclear_buildings = ( + vrci + + rmbv + + wsv + + buildings_variables.vol_plant_tritium_fuel_building + + vol_plant_cryogenics_building + ) # Output ! # !!!!!!!!! @@ -447,7 +466,12 @@ def calculate_building_sizes_1992( "(conv)", buildings_variables.conv, ) - po.ovarre(self.outfile, "Cryogenics building volume (m3)", "(cryv)", cryv) + po.ovarre( + self.outfile, + "Cryogenics building volume (m3)", + "(vol_plant_cryogenics_building)", + vol_plant_cryogenics_building, + ) po.ovarre( self.outfile, "Administration building volume (m3)", @@ -464,7 +488,7 @@ def calculate_building_sizes_1992( buildings_variables.vol_plant_nuclear_buildings, ) - return cryv, vrci, rbv, rmbv, wsv, elev + return vol_plant_cryogenics_building, vrci, rbv, rmbv, wsv, elev class BuildingsChapman2024: @@ -1065,7 +1089,9 @@ def calculate_building_sizes_chapman(self, output, tf_radial_dim, tf_vertical_di buildings_variables.a_plant_floor_effective = buildings_total_vol / 6.0e0 # Total volume of nuclear buildings - buildings_variables.vol_plant_nuclear_buildings = reactor_build_totvol + hotcell_vol_ext + buildings_variables.vol_plant_nuclear_buildings = ( + reactor_build_totvol + hotcell_vol_ext + ) # Output if output: diff --git a/process/models/ife.py b/process/models/ife.py index f27b581f5e..aa99dc294b 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -2401,7 +2401,13 @@ def ifebdg(self, output: bool = False): # Total volume of nuclear buildings - buildings_variables.vol_plant_nuclear_buildings = vrci + rmbv + wsv + buildings_variables.vol_plant_tritium_fuel_building + cryv + buildings_variables.vol_plant_nuclear_buildings = ( + vrci + + rmbv + + wsv + + buildings_variables.vol_plant_tritium_fuel_building + + cryv + ) if not output: return diff --git a/tests/unit/test_buildings.py b/tests/unit/test_buildings.py index c93daa3868..a05a837c59 100644 --- a/tests/unit/test_buildings.py +++ b/tests/unit/test_buildings.py @@ -456,7 +456,11 @@ def test_bldgs_sizes(buildings, bldgssizesparam, monkeypatch): "a_plant_floor_effective", bldgssizesparam.a_plant_floor_effective, ) - monkeypatch.setattr(buildings_variables, "vol_plant_nuclear_buildings", bldgssizesparam.vol_plant_nuclear_buildings) + monkeypatch.setattr( + buildings_variables, + "vol_plant_nuclear_buildings", + bldgssizesparam.vol_plant_nuclear_buildings, + ) monkeypatch.setattr(buildings_variables, "bioshld_thk", bldgssizesparam.bioshld_thk) monkeypatch.setattr( buildings_variables, "reactor_wall_thk", bldgssizesparam.reactor_wall_thk @@ -957,7 +961,11 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): bldgsparam.dr_plant_reactor_building_transport_clearance, ) monkeypatch.setattr(buildings_variables, "row", bldgsparam.row) - monkeypatch.setattr(buildings_variables, "m_plant_reactor_building_crane_capacity", bldgsparam.m_plant_reactor_building_crane_capacity) + monkeypatch.setattr( + buildings_variables, + "m_plant_reactor_building_crane_capacity", + bldgsparam.m_plant_reactor_building_crane_capacity, + ) monkeypatch.setattr(buildings_variables, "shmf", bldgsparam.shmf) monkeypatch.setattr(buildings_variables, "clh2", bldgsparam.clh2) monkeypatch.setattr(buildings_variables, "dz_tf_cryostat", bldgsparam.dz_tf_cryostat) @@ -993,13 +1001,21 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): bldgsparam.a_plant_floor_effective, ) monkeypatch.setattr(buildings_variables, "admvol", bldgsparam.admvol) - monkeypatch.setattr(buildings_variables, "vol_plant_tritium_fuel_building", bldgsparam.vol_plant_tritium_fuel_building) + monkeypatch.setattr( + buildings_variables, + "vol_plant_tritium_fuel_building", + bldgsparam.vol_plant_tritium_fuel_building, + ) monkeypatch.setattr(buildings_variables, "conv", bldgsparam.conv) monkeypatch.setattr(buildings_variables, "admv", bldgsparam.admv) monkeypatch.setattr(buildings_variables, "shov", bldgsparam.shov) monkeypatch.setattr(buildings_variables, "shovol", bldgsparam.shovol) monkeypatch.setattr(buildings_variables, "convol", bldgsparam.convol) - monkeypatch.setattr(buildings_variables, "vol_plant_nuclear_buildings", bldgsparam.vol_plant_nuclear_buildings) + monkeypatch.setattr( + buildings_variables, + "vol_plant_nuclear_buildings", + bldgsparam.vol_plant_nuclear_buildings, + ) cryv, vrci, rbv, rmbv, wsv, elev = buildings.iter_1992.calculate_building_sizes_1992( output=False, @@ -1027,7 +1043,9 @@ def test_bldgs(buildings, bldgsparam, monkeypatch): assert buildings_variables.admvol == pytest.approx(bldgsparam.expected_admvol) assert buildings_variables.shovol == pytest.approx(bldgsparam.expected_shovol) assert buildings_variables.convol == pytest.approx(bldgsparam.expected_convol) - assert buildings_variables.vol_plant_nuclear_buildings == pytest.approx(bldgsparam.expected_volnucb) + assert buildings_variables.vol_plant_nuclear_buildings == pytest.approx( + bldgsparam.expected_volnucb + ) assert cryv == pytest.approx(bldgsparam.expected_cryv) assert vrci == pytest.approx(bldgsparam.expected_vrci) diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index 44f8efa5dc..b02784d450 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -906,7 +906,11 @@ def test_acc21(acc21param, monkeypatch, costs): monkeypatch.setattr(buildings_variables, "shovol", acc21param.shovol) - monkeypatch.setattr(buildings_variables, "vol_plant_tritium_fuel_building", acc21param.vol_plant_tritium_fuel_building) + monkeypatch.setattr( + buildings_variables, + "vol_plant_tritium_fuel_building", + acc21param.vol_plant_tritium_fuel_building, + ) monkeypatch.setattr( buildings_variables, diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index f715751dbe..896c54f27e 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2998,7 +2998,11 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): "a_plant_floor_effective", ifebdgparam.a_plant_floor_effective, ) - monkeypatch.setattr(buildings_variables, "vol_plant_tritium_fuel_building", ifebdgparam.vol_plant_tritium_fuel_building) + monkeypatch.setattr( + buildings_variables, + "vol_plant_tritium_fuel_building", + ifebdgparam.vol_plant_tritium_fuel_building, + ) monkeypatch.setattr(buildings_variables, "conv", ifebdgparam.conv) monkeypatch.setattr(buildings_variables, "admv", ifebdgparam.admv) monkeypatch.setattr(buildings_variables, "shov", ifebdgparam.shov) @@ -3030,7 +3034,11 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): "vol_plant_warm_shop_building", ifebdgparam.vol_plant_warm_shop_building, ) - monkeypatch.setattr(buildings_variables, "vol_plant_nuclear_buildings", ifebdgparam.vol_plant_nuclear_buildings) + monkeypatch.setattr( + buildings_variables, + "vol_plant_nuclear_buildings", + ifebdgparam.vol_plant_nuclear_buildings, + ) monkeypatch.setattr(fwbs_variables, "whtshld", ifebdgparam.whtshld) monkeypatch.setattr(heat_transport_variables, "helpow", ifebdgparam.helpow) monkeypatch.setattr(ife_variables, "zl7", ifebdgparam.zl7) @@ -3066,7 +3074,9 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): assert buildings_variables.vol_plant_warm_shop_building == pytest.approx( ifebdgparam.expected_wsvol ) - assert buildings_variables.vol_plant_nuclear_buildings == pytest.approx(ifebdgparam.expected_volnucb) + assert buildings_variables.vol_plant_nuclear_buildings == pytest.approx( + ifebdgparam.expected_volnucb + ) class Ifepw2Param(NamedTuple):