diff --git a/process/core/caller.py b/process/core/caller.py index 953add544..051ccf3b7 100644 --- a/process/core/caller.py +++ b/process/core/caller.py @@ -15,6 +15,7 @@ from process.core.solver import constraints from process.core.solver.iteration_variables import set_scaled_iteration_variable from process.core.solver.objectives import objective_function +from process.models.blankets.blanket_library import BlktModelTypes from process.models.tfcoil.base import TFConductorModel from process.models.tfcoil.superconducting import SuperconductingTFTurnType @@ -341,11 +342,11 @@ def _call_models_once(self, xc: np.ndarray): 4 | KIT HCLL model 5 | DCLL model """ - if data_structure.fwbs_variables.i_blanket_type == 1: + if data_structure.fwbs_variables.i_blanket_type == BlktModelTypes.CCFE_HCPB: # CCFE HCPB model self.models.ccfe_hcpb.run() - elif data_structure.fwbs_variables.i_blanket_type == 5: + elif data_structure.fwbs_variables.i_blanket_type == BlktModelTypes.DCLL: # DCLL model self.models.dcll.run() diff --git a/process/core/init.py b/process/core/init.py index 0fa2e9ecb..81928c0fe 100644 --- a/process/core/init.py +++ b/process/core/init.py @@ -58,6 +58,7 @@ ) from process.data_structure.tfcoil_variables import init_tfcoil_variables from process.data_structure.times_variables import init_times_variables +from process.models.blankets.blanket_library import BlktModelTypes from process.models.stellarator.initialization import st_init from process.models.superconductors import ( SuperconductorMaterial, @@ -1178,7 +1179,7 @@ def check_process(inputs, data): # noqa: ARG001 # CCFE HCPB Model if data_structure.stellarator_variables.istell == 0 and ( - data_structure.fwbs_variables.i_blanket_type == 1 + data_structure.fwbs_variables.i_blanket_type == BlktModelTypes.CCFE_HCPB ): fsum = ( data_structure.fwbs_variables.breeder_multiplier diff --git a/process/core/output.py b/process/core/output.py index 07982308d..b2041e08e 100644 --- a/process/core/output.py +++ b/process/core/output.py @@ -1,5 +1,6 @@ from process import data_structure from process.core.log import logging_model_handler +from process.models.blankets.blanket_library import BlktModelTypes from process.models.tfcoil.base import TFConductorModel from process.models.tfcoil.superconducting import ( SuperconductingTFTurnType, @@ -122,11 +123,11 @@ def write(models, _outfile): # First wall geometry models.fw.output() - if data_structure.fwbs_variables.i_blanket_type == 1: + if data_structure.fwbs_variables.i_blanket_type == BlktModelTypes.CCFE_HCPB: # CCFE HCPB model models.ccfe_hcpb.output() - elif data_structure.fwbs_variables.i_blanket_type == 5: + elif data_structure.fwbs_variables.i_blanket_type == BlktModelTypes.DCLL: # DCLL model models.dcll.output() diff --git a/process/models/blankets/blanket_library.py b/process/models/blankets/blanket_library.py index c22162026..3d403cd88 100644 --- a/process/models/blankets/blanket_library.py +++ b/process/models/blankets/blanket_library.py @@ -40,6 +40,13 @@ # FCI Flow Channel Insert +class BlktModelTypes(IntEnum): + """Enum for blanket model types. `i_blanket_type`""" + + CCFE_HCPB = 1 + DCLL = 5 + + class FWBlktCoolantLoopTypes(IntEnum): """Enumeration for first wall and blanket coolant loop types. `i_fw_blkt_shared_coolant`.""" @@ -884,7 +891,8 @@ def set_blanket_module_geometry(self): Error If the poloidal segment length is less than three times the minimum liquid breeder pipe width. """ - if fwbs_variables.i_blanket_type == 5: + i_blanket_type = BlktModelTypes(fwbs_variables.i_blanket_type) + if i_blanket_type == BlktModelTypes.DCLL: # Unless DCLL then we will use BZ blanket_library.len_blkt_inboard_coolant_channel_radial = ( build_variables.blbuith diff --git a/process/models/power.py b/process/models/power.py index 1ec6ae044..b51665778 100644 --- a/process/models/power.py +++ b/process/models/power.py @@ -26,6 +26,7 @@ tfcoil_variables, times_variables, ) +from process.models.blankets.blanket_library import BlktModelTypes class PumpingPowerModelTypes(IntEnum): @@ -1900,9 +1901,10 @@ def plant_thermal_efficiency(self, eta_turbine): i_thermal_electric_conversion = ElectricConversionModelTypes( fwbs_variables.i_thermal_electric_conversion ) + i_blanket_type = BlktModelTypes(fwbs_variables.i_blanket_type) if i_thermal_electric_conversion == ElectricConversionModelTypes.CCFE_HCPB_VALUE: # CCFE HCPB Model - if fwbs_variables.i_blanket_type == 1: + if i_blanket_type == BlktModelTypes.CCFE_HCPB: # HCPB, efficiency taken from M. Kovari 2016 # "PROCESS": A systems code for fusion power plants - Part 2: Engineering # https://www.sciencedirect.com/science/article/pii/S0920379616300072 @@ -1917,7 +1919,7 @@ def plant_thermal_efficiency(self, eta_turbine): == ElectricConversionModelTypes.CCFE_HCPB_VALUE_WITH_DIVERTOR ): # CCFE HCPB Model - if fwbs_variables.i_blanket_type == 1: + if i_blanket_type == BlktModelTypes.CCFE_HCPB: # HCPB, efficiency taken from M. Kovari 2016 # "PROCESS": A systems code for fusion power plants - Part 2: Engineering # https://www.sciencedirect.com/science/article/pii/S0920379616300072 @@ -1937,7 +1939,7 @@ def plant_thermal_efficiency(self, eta_turbine): == ElectricConversionModelTypes.STEAM_RANKINE_CYCLE ): # CCFE HCPB Model - if fwbs_variables.i_blanket_type == 1: + if i_blanket_type == BlktModelTypes.CCFE_HCPB: # If coolant is helium, the steam cycle is assumed to be superheated # and a different correlation is used. The turbine inlet temperature # is assumed to be 20 degrees below the primary coolant outlet