From 66da600020c0ff7f41640412ca0b0d9121080ede Mon Sep 17 00:00:00 2001 From: Clair Mould <86794332+clmould@users.noreply.github.com> Date: Wed, 13 May 2026 17:15:22 +0100 Subject: [PATCH 1/3] convert constraint vars to dataclass --- process/core/model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/process/core/model.py b/process/core/model.py index 24d482926..68f422ed7 100644 --- a/process/core/model.py +++ b/process/core/model.py @@ -44,6 +44,7 @@ class DataStructure: buildings: BuildingsData = initialise_later constraints: ConstraintData = initialise_later dcll: DCLLData = initialise_later + constraints: ConstraintData = initialise_later current_drive: CurrentDriveData = initialise_later def __post_init__(self): From 0237566044acb62b45205497d476992e2157c63b Mon Sep 17 00:00:00 2001 From: Clair Mould <86794332+clmould@users.noreply.github.com> Date: Wed, 13 May 2026 18:16:20 +0100 Subject: [PATCH 2/3] dcll vars dataclass --- process/core/model.py | 1 - 1 file changed, 1 deletion(-) diff --git a/process/core/model.py b/process/core/model.py index 68f422ed7..24d482926 100644 --- a/process/core/model.py +++ b/process/core/model.py @@ -44,7 +44,6 @@ class DataStructure: buildings: BuildingsData = initialise_later constraints: ConstraintData = initialise_later dcll: DCLLData = initialise_later - constraints: ConstraintData = initialise_later current_drive: CurrentDriveData = initialise_later def __post_init__(self): From 6fde92b6f7c5e8a5a16cfa78ff8f2ee630e14157 Mon Sep 17 00:00:00 2001 From: Clair Mould <86794332+clmould@users.noreply.github.com> Date: Thu, 14 May 2026 16:25:06 +0100 Subject: [PATCH 3/3] convert heat transport vars to dataclass --- process/core/init.py | 6 +- process/core/input.py | 52 +-- process/core/model.py | 2 + process/core/scan.py | 5 +- process/core/solver/constraints.py | 8 +- process/core/solver/objectives.py | 3 +- .../heat_transport_variables.py | 385 ++++++------------ process/models/blankets/blanket_library.py | 27 +- process/models/blankets/dcll.py | 35 +- process/models/blankets/hcpb.py | 49 ++- process/models/buildings.py | 3 +- process/models/costs/costs.py | 51 ++- process/models/costs/costs_2015.py | 25 +- process/models/ife.py | 147 ++++--- process/models/physics/current_drive.py | 33 +- process/models/power.py | 331 ++++++++------- process/models/stellarator/build.py | 3 +- process/models/stellarator/heating.py | 3 +- process/models/stellarator/stellarator.py | 53 ++- process/models/water_use.py | 5 +- tests/unit/models/blankets/test_ccfe_hcpb.py | 21 +- .../unit/models/physics/test_current_drive.py | 43 +- .../models/stellarator/test_stellarator.py | 5 +- tests/unit/models/test_costs_1990.py | 85 ++-- tests/unit/models/test_costs_2015.py | 17 +- tests/unit/models/test_ife.py | 107 +++-- tests/unit/models/test_power.py | 111 ++--- 27 files changed, 720 insertions(+), 895 deletions(-) diff --git a/process/core/init.py b/process/core/init.py index a62969272..ce4ebdde7 100644 --- a/process/core/init.py +++ b/process/core/init.py @@ -17,9 +17,6 @@ from process.core.solver import iteration_variables from process.core.solver.constraints import ConstraintManager from process.data_structure.divertor_variables import init_divertor_variables -from process.data_structure.heat_transport_variables import ( - init_heat_transport_variables, -) from process.data_structure.ife_variables import init_ife_variables from process.data_structure.impurity_radiation_module import ( init_impurity_radiation_module, @@ -255,7 +252,6 @@ def init_all_module_vars(): data_structure.numerics.init_numerics() init_divertor_variables() data_structure.global_variables.init_global_variables() - init_heat_transport_variables() init_ife_variables() init_impurity_radiation_module() init_pfcoil_module() @@ -375,7 +371,7 @@ def check_process(inputs, data): # noqa: ARG001 data_structure.physics_variables.f_plasma_fuel_tritium < 1.0e-3 ): # tritium fraction is negligible data.buildings.triv = 0.0 - data_structure.heat_transport_variables.p_tritium_plant_electric_mw = 0.0 + data.heat_transport.p_tritium_plant_electric_mw = 0.0 if data_structure.impurity_radiation_module.f_nd_impurity_electrons[1] != 0.1: # noqa: RUF069 raise ProcessValidationError( diff --git a/process/core/input.py b/process/core/input.py index ff34b32cf..49bca620b 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -213,7 +213,7 @@ def __post_init__(self): data_structure.tfcoil_variables, float, range=(0.0, 30.0) ), "p_plant_electric_base": InputVariable( - data_structure.heat_transport_variables, float, range=(1000000.0, 10000000000.0) + "heat_transport", float, range=(1000000.0, 10000000000.0) ), "bcritsc": InputVariable(data_structure.tfcoil_variables, float, range=(10.0, 50.0)), "bctmp": InputVariable("pulse", float, range=(1.0, 800.0)), @@ -340,7 +340,7 @@ def __post_init__(self): "cryostore_l": InputVariable("buildings", float, range=(10.0, 1000.0)), "cryostore_w": InputVariable("buildings", float, range=(10.0, 1000.0)), "p_cryo_plant_electric_max_mw": InputVariable( - data_structure.heat_transport_variables, float, range=(0.01, 200.0) + "heat_transport", float, range=(0.01, 200.0) ), "csi": InputVariable("costs", float, range=(1.0, 100.0)), "cturbb": InputVariable("costs", float, range=(100.0, 1000.0)), @@ -461,12 +461,8 @@ def __post_init__(self): ), "etapsu": InputVariable(data_structure.pfcoil_variables, float, range=(0.0, 1.0)), "etapump": InputVariable(data_structure.tfcoil_variables, float, range=(0.0, 1.0)), - "etatf": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 1.0) - ), - "eta_turbine": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 1.0) - ), + "etatf": InputVariable("heat_transport", float, range=(0.0, 1.0)), + "eta_turbine": InputVariable("heat_transport", float, range=(0.0, 1.0)), "eyoung_al": InputVariable(data_structure.tfcoil_variables, float, range=(0.0, 1.0)), "eyoung_cond_axial": InputVariable( data_structure.tfcoil_variables, float, range=(0.0, 10000000000000.0) @@ -578,22 +574,20 @@ def __post_init__(self): "f_div_flux_expansion": InputVariable( data_structure.divertor_variables, float, range=(0.0, 10.0) ), - "fmgdmw": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 100.0) - ), + "fmgdmw": InputVariable("heat_transport", float, range=(0.0, 100.0)), "fndt": InputVariable("buildings", float, range=(0.0, 10.0)), "f_p_beam_orbit_loss": InputVariable("current_drive", float, range=(0.0, 0.999)), "f_p_blkt_coolant_pump_total_heat": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 0.2) + "heat_transport", float, range=(0.0, 0.2) ), "f_p_div_coolant_pump_total_heat": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 0.2) + "heat_transport", float, range=(0.0, 0.2) ), "f_p_fw_coolant_pump_total_heat": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 0.2) + "heat_transport", float, range=(0.0, 0.2) ), "f_p_shld_coolant_pump_total_heat": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 0.2) + "heat_transport", float, range=(0.0, 0.2) ), "fracture_toughness": InputVariable("cs_fatigue", float, range=(0.1, 100000000.0)), "fradpwr": InputVariable("constraints", float, range=(0.0, 1.0)), @@ -652,17 +646,13 @@ def __post_init__(self): "hot_sepdist": InputVariable("buildings", float, range=(0.0, 10.0)), "hotcell_h": InputVariable("buildings", float, range=(1.0, 100.0)), "p_blkt_coolant_pump_mw": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 1000.0) - ), - "p_div_coolant_pump_mw": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 1000.0) - ), - "p_fw_coolant_pump_mw": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 1000.0) + "heat_transport", float, range=(0.0, 1000.0) ), + "p_div_coolant_pump_mw": InputVariable("heat_transport", float, range=(0.0, 1000.0)), + "p_fw_coolant_pump_mw": InputVariable("heat_transport", float, range=(0.0, 1000.0)), "htpmw_ife": InputVariable(data_structure.ife_variables, float, range=(0.0, 1000.0)), "p_shld_coolant_pump_mw": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 1000.0) + "heat_transport", float, range=(0.0, 1000.0) ), "hw_storage_h": InputVariable("buildings", float, range=(1.0, 100.0)), "hw_storage_l": InputVariable("buildings", float, range=(10.0, 1000.0)), @@ -834,7 +824,7 @@ def __post_init__(self): "volflow_vac_pumps_max": InputVariable("vacuum", float, range=(1e-06, 1000.0)), "molflow_vac_pumps": InputVariable("vacuum", float, range=(0.0, 1e30)), "pflux_plant_floor_electric": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 1000.0) + "heat_transport", float, range=(0.0, 1000.0) ), "q0": InputVariable(data_structure.physics_variables, float, range=(0.01, 20.0)), "q95": InputVariable(data_structure.physics_variables, float, range=(1.0, 50.0)), @@ -1105,7 +1095,7 @@ def __post_init__(self): "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( - data_structure.heat_transport_variables, float, range=(0.0, 100.0) + "heat_transport", float, range=(0.0, 100.0) ), "triv": InputVariable("buildings", float, range=(10000.0, 1000000.0)), "turbine_hall_h": InputVariable("buildings", float, range=(1.0, 100.0)), @@ -1178,9 +1168,7 @@ def __post_init__(self): "v3dr": InputVariable(data_structure.ife_variables, float, range=(0.0, 50.0)), "v3dzl": InputVariable(data_structure.ife_variables, float, range=(0.0, 30.0)), "v3dzu": InputVariable(data_structure.ife_variables, float, range=(0.0, 30.0)), - "vachtmw": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 100.0) - ), + "vachtmw": InputVariable("heat_transport", float, range=(0.0, 100.0)), "vel_cp_coolant_midplane": InputVariable( data_structure.tfcoil_variables, float, range=(0.001, 100.0) ), @@ -1344,12 +1332,8 @@ def __post_init__(self): data_structure.pfcoil_variables, int, choices=[0, 1] ), "ipnet": InputVariable("costs", int, choices=[0, 1]), - "ipowerflow": InputVariable( - data_structure.heat_transport_variables, int, choices=[0, 1] - ), - "i_shld_primary_heat": InputVariable( - data_structure.heat_transport_variables, int, choices=[0, 1] - ), + "ipowerflow": InputVariable("heat_transport", int, choices=[0, 1]), + "i_shld_primary_heat": InputVariable("heat_transport", int, choices=[0, 1]), "i_beta_norm_max": InputVariable( data_structure.physics_variables, int, range=(0, 5) ), diff --git a/process/core/model.py b/process/core/model.py index 24d482926..c5161a5a4 100644 --- a/process/core/model.py +++ b/process/core/model.py @@ -13,6 +13,7 @@ from process.data_structure.dcll_variables import DCLLData from process.data_structure.first_wall_variables import FirstWallData from process.data_structure.fwbs_variables import FWBSData +from process.data_structure.heat_transport_variables import HeatTransportData from process.data_structure.primary_pumping_variables import PrimaryPumpingData from process.data_structure.pulse_variables import PulseData from process.data_structure.reinke_variables import ReinkeData @@ -45,6 +46,7 @@ class DataStructure: constraints: ConstraintData = initialise_later dcll: DCLLData = initialise_later current_drive: CurrentDriveData = initialise_later + heat_transport: HeatTransportData = initialise_later def __post_init__(self): for f in fields(self): diff --git a/process/core/scan.py b/process/core/scan.py index 2d66151e8..7588537e7 100644 --- a/process/core/scan.py +++ b/process/core/scan.py @@ -18,7 +18,6 @@ from process.data_structure import ( divertor_variables, global_variables, - heat_transport_variables, impurity_radiation_module, numerics, pfcoil_variables, @@ -1166,7 +1165,7 @@ def scan_select(self, nwp, swp, iscn): case 55: self.data.build.dr_shld_inboard = swp[iscn - 1] case 56: - heat_transport_variables.p_cryo_plant_electric_max_mw = swp[iscn - 1] + self.data.heat_transport.p_cryo_plant_electric_max_mw = swp[iscn - 1] case 57: numerics.boundl[1] = swp[iscn - 1] case 58: @@ -1206,7 +1205,7 @@ def scan_select(self, nwp, swp, iscn): case 75: self.data.fwbs.dx_fw_module = swp[iscn - 1] case 76: - heat_transport_variables.eta_turbine = swp[iscn - 1] + self.data.heat_transport.eta_turbine = swp[iscn - 1] case 77: self.data.costs.startupratio = swp[iscn - 1] case 78: diff --git a/process/core/solver/constraints.py b/process/core/solver/constraints.py index bc2e94e6a..f2537877f 100644 --- a/process/core/solver/constraints.py +++ b/process/core/solver/constraints.py @@ -587,7 +587,7 @@ def constraint_equation_16(constraint_registration, data): p_plant_electric_net_required_mw: required net electric power (MW) """ return geq( - data_structure.heat_transport_variables.p_plant_electric_net_mw, + data.heat_transport.p_plant_electric_net_mw, data.constraints.p_plant_electric_net_required_mw, constraint_registration, ) @@ -1757,15 +1757,15 @@ def constraint_equation_86(constraint_registration, _data): @ConstraintManager.register_constraint(87, "MW", "<=") -def constraint_equation_87(constraint_registration, _data): +def constraint_equation_87(constraint_registration, data): """Equation for TF coil cryogenic power upper limit p_cryo_plant_electric_mw: cryogenic plant power (MW) p_cryo_plant_electric_max_mw: Maximum cryogenic plant power (MW) """ return leq( - data_structure.heat_transport_variables.p_cryo_plant_electric_mw, - data_structure.heat_transport_variables.p_cryo_plant_electric_max_mw, + data.heat_transport.p_cryo_plant_electric_mw, + data.heat_transport.p_cryo_plant_electric_max_mw, constraint_registration, ) diff --git a/process/core/solver/objectives.py b/process/core/solver/objectives.py index 0405043ae..5fdb521b4 100644 --- a/process/core/solver/objectives.py +++ b/process/core/solver/objectives.py @@ -4,7 +4,6 @@ from process.core.model import DataStructure from process.data_structure import ( divertor_variables, - heat_transport_variables, pf_power_variables, physics_variables, tfcoil_variables, @@ -107,7 +106,7 @@ def objective_function(minmax: int, data: DataStructure) -> float: data.times.t_plant_pulse_burn / 7200.0 ) case 17: - objective_metric = heat_transport_variables.p_plant_electric_net_mw / 500.0 + objective_metric = data.heat_transport.p_plant_electric_net_mw / 500.0 case 18: objective_metric = 1.0 case 19: diff --git a/process/data_structure/heat_transport_variables.py b/process/data_structure/heat_transport_variables.py index 5b3a16eba..5512f6b79 100644 --- a/process/data_structure/heat_transport_variables.py +++ b/process/data_structure/heat_transport_variables.py @@ -5,321 +5,176 @@ - """ -p_plant_electric_base: float = None -"""base plant electric load (W)""" +from dataclasses import dataclass -p_cryo_plant_electric_mw: float = None -"""cryogenic plant power (MW)""" +@dataclass +class HeatTransportData: + p_plant_electric_base: float = 5.0e6 + """base plant electric load (W)""" + p_cryo_plant_electric_mw: float = 0.0 + """cryogenic plant power (MW)""" -p_cryo_plant_electric_max_mw: float = None -"""Maximum cryogenic plant power (MW) -Constraint equation icc = 87 -Scan variable nwseep = 56 -""" - - -etatf: float = None -"""AC to resistive power conversion for TF coils""" - - -eta_turbine: float = None -"""thermal to electric conversion efficiency if `i_thermal_electric_conversion=2`; otherwise calculated.""" - - -etath_liq: float = None - - -fachtmw: float = None -"""facility heat removal (MW)""" - - -p_plant_electric_base_total_mw: float = None -"""total baseline power required at all times (MW)""" - - -fgrosbop: float = None -"""scaled fraction of gross power to balance-of-plant""" - - -fmgdmw: float = None -"""power to mgf (motor-generator flywheel) units (MW) (ignored if `i_pf_energy_storage_source=2`)""" - - -f_p_blkt_coolant_pump_total_heat: float = None -"""fraction of total blanket thermal power required to drive the blanket -coolant pumps (default assumes water coolant) (`i_thermal_electric_conversion=0`) -""" - - -f_p_div_coolant_pump_total_heat: float = None -"""fraction of total divertor thermal power required to drive the divertor -coolant pumps (default assumes water coolant) -""" - - -f_p_fw_coolant_pump_total_heat: float = None -"""fraction of total first wall thermal power required to drive the FW coolant -pumps (default assumes water coolant) (`i_thermal_electric_conversion=0`) -""" - - -f_p_shld_coolant_pump_total_heat: float = None -"""fraction of total shield thermal power required to drive the shield coolant -pumps (default assumes water coolant) -""" - - -helpow: float = None -"""Heat removal at cryogenic temperature temp_tf_cryo (W)""" - - -helpow_cryal: float = None -"""Heat removal at cryogenic temperature temp_cp_coolant_inlet (W)""" - - -p_coolant_pump_elec_total_mw: float = None -"""heat transport system electrical pump power (MW)""" - - -p_blkt_coolant_pump_mw: float = None -"""blanket primary coolant mechanical pumping power (MW)""" - - -p_blkt_breeder_pump_mw: float = None -"""blanket secondary coolant mechanical pumping power (MW)""" - - -htpmw_blkt_tot: float = None -"""blanket primary + secondary coolant mechanical pumping power (MW)""" - - -p_div_coolant_pump_mw: float = None -"""divertor coolant mechanical pumping power (MW)""" - - -p_fw_coolant_pump_mw: float = None -"""first wall coolant mechanical pumping power (MW)""" - - -p_shld_coolant_pump_mw: float = None -"""shield and vacuum vessel coolant mechanical pumping power (MW)""" - - -p_coolant_pump_loss_total_mw: float = None -"""Waste power lost from primary coolant pumps (MW)""" - - -ipowerflow: int = None -"""switch for power flow model: -- =0 pre-2014 version -- =1 comprehensive 2014 model -""" - - -i_shld_primary_heat: int = None -"""Switch for shield thermal power destiny: -- =0 does not contribute to energy generation cycle -- =1 contributes to energy generation cycle -""" - + p_cryo_plant_electric_max_mw: float = 50.0 + """Maximum cryogenic plant power (MW) + Constraint equation icc = 87 + Scan variable nwseep = 56 + """ -n_primary_heat_exchangers: int = None -"""number of primary heat exchangers""" + etatf: float = 0.9 + """AC to resistive power conversion for TF coils""" + eta_turbine: float = 0.35 + """thermal to electric conversion efficiency if `i_thermal_electric_conversion=2`; otherwise calculated.""" -pacpmw: float = None -"""total pulsed power system load (MW)""" + etath_liq: float = 0.35 + fachtmw: float = 0.0 + """facility heat removal (MW)""" -peakmva: float = None -"""peak MVA requirement""" + p_plant_electric_base_total_mw: float = 0.0 + """total baseline power required at all times (MW)""" + fgrosbop: float = 0.0 + """scaled fraction of gross power to balance-of-plant""" -p_fw_div_heat_deposited_mw: float = None -"""heat removal from first wall/divertor (MW)""" + fmgdmw: float = 0.0 + """power to mgf (motor-generator flywheel) units (MW) (ignored if `i_pf_energy_storage_source=2`)""" + f_p_blkt_coolant_pump_total_heat: float = 0.005 + """fraction of total blanket thermal power required to drive the blanket + coolant pumps (default assumes water coolant) (`i_thermal_electric_conversion=0`) + """ -p_plant_electric_gross_mw: float = None -"""gross electric power (MW)""" + f_p_div_coolant_pump_total_heat: float = 0.005 + """fraction of total divertor thermal power required to drive the divertor + coolant pumps (default assumes water coolant) + """ + f_p_fw_coolant_pump_total_heat: float = 0.005 + """fraction of total first wall thermal power required to drive the FW coolant + pumps (default assumes water coolant) (`i_thermal_electric_conversion=0`) + """ -p_hcd_electric_loss_mw: float = None -"""power dissipated in heating and current drive system (MW)""" + f_p_shld_coolant_pump_total_heat: float = 0.005 + """fraction of total shield thermal power required to drive the shield coolant + pumps (default assumes water coolant) + """ + helpow: float = 0.0 + """Heat removal at cryogenic temperature temp_tf_cryo (W)""" -p_hcd_electric_total_mw: float = None -"""injector wall plug power (MW)""" + helpow_cryal: float = 0.0 + """Heat removal at cryogenic temperature temp_cp_coolant_inlet (W)""" + p_coolant_pump_elec_total_mw: float = 0.0 + """heat transport system electrical pump power (MW)""" -p_hcd_secondary_electric_mw: float = None -"""Secondary HCD system injector wall plug power (MW)""" + p_blkt_coolant_pump_mw: float = 0.0 + """blanket primary coolant mechanical pumping power (MW)""" + p_blkt_breeder_pump_mw: float = 0.0 + """blanket secondary coolant mechanical pumping power (MW)""" -p_hcd_primary_electric_mw: float = None -"""Primary HCD system injector wall plug power (MW)""" + htpmw_blkt_tot: float = 0.0 + """blanket primary + secondary coolant mechanical pumping power (MW)""" + p_div_coolant_pump_mw: float = 0.0 + """divertor coolant mechanical pumping power (MW)""" -p_plant_electric_net_mw: float = None -"""net electric power (MW)""" + p_fw_coolant_pump_mw: float = 0.0 + """first wall coolant mechanical pumping power (MW)""" + p_shld_coolant_pump_mw: float = 0.0 + """shield and vacuum vessel coolant mechanical pumping power (MW)""" -p_plant_electric_recirc_mw: float = None -"""recirculating electric power (MW)""" + p_coolant_pump_loss_total_mw: float = 0.0 + """Waste power lost from primary coolant pumps (MW)""" + ipowerflow: int = 1 + """switch for power flow model: + - =0 pre-2014 version + - =1 comprehensive 2014 model + """ -priheat: float = None -"""total thermal power removed from fusion core (MW)""" + i_shld_primary_heat: int = 1 + """Switch for shield thermal power destiny: + - =0 does not contribute to energy generation cycle + - =1 contributes to energy generation cycle + """ + n_primary_heat_exchangers: int = 0 + """number of primary heat exchangers""" -p_div_secondary_heat_mw: float = None -"""Low-grade heat lost in divertor (MW)""" + pacpmw: float = 0.0 + """total pulsed power system load (MW)""" + peakmva: float = 0.0 + """peak MVA requirement""" -p_hcd_secondary_heat_mw: float = None -"""Low-grade heat lost into HCD apparatus (MW)""" + p_fw_div_heat_deposited_mw: float = 0.0 + """heat removal from first wall/divertor (MW)""" + p_plant_electric_gross_mw: float = 0.0 + """gross electric power (MW)""" -p_plant_secondary_heat_mw: float = None -"""Low-grade heat (MW)""" + p_hcd_electric_loss_mw: float = 0.0 + """power dissipated in heating and current drive system (MW)""" + p_hcd_electric_total_mw: float = 0.0 + """injector wall plug power (MW)""" -p_shld_secondary_heat_mw: float = None -"""Low-grade heat deposited in shield (MW)""" + p_hcd_secondary_electric_mw: float = 0.0 + """Secondary HCD system injector wall plug power (MW)""" + p_hcd_primary_electric_mw: float = None + """Primary HCD system injector wall plug power (MW)""" -p_plant_primary_heat_mw: float = None -"""High-grade heat useful for electric production (MW)""" + p_plant_electric_net_mw: float = 0.0 + """net electric power (MW)""" + p_plant_electric_recirc_mw: float = 0.0 + """recirculating electric power (MW)""" -pflux_plant_floor_electric: float = None -"""base AC power requirement per unit floor area (W/m2)""" + priheat: float = 0.0 + """total thermal power removed from fusion core (MW)""" + p_div_secondary_heat_mw: float = 0.0 + """Low-grade heat lost in divertor (MW)""" -p_tf_electric_supplies_mw: float = None -"""total steady state TF coil AC power demand (MW)""" + p_hcd_secondary_heat_mw: float = 0.0 + """Low-grade heat lost into HCD apparatus (MW)""" + p_plant_secondary_heat_mw: float = 0.0 + """Low-grade heat (MW)""" -tlvpmw: float = None -"""estimate of total low voltage power (MW)""" + p_shld_secondary_heat_mw: float = 0.0 + """Low-grade heat deposited in shield (MW)""" + p_plant_primary_heat_mw: float = 0.0 + """High-grade heat useful for electric production (MW)""" -p_tritium_plant_electric_mw: float = None -"""power required for tritium processing (MW)""" + pflux_plant_floor_electric: float = 150.0 + """base AC power requirement per unit floor area (W/m2)""" + p_tf_electric_supplies_mw: float = 0.0 + """total steady state TF coil AC power demand (MW)""" -temp_turbine_coolant_in: float = None -"""coolant temperature at turbine inlet (K) (`i_thermal_electric_conversion = 3,4`)""" + tlvpmw: float = 0.0 + """estimate of total low voltage power (MW)""" + p_tritium_plant_electric_mw: float = 15.0 + """power required for tritium processing (MW)""" -vachtmw: float = None -"""vacuum pump power (MW)""" + temp_turbine_coolant_in: float = 0.0 + """coolant temperature at turbine inlet (K) (`i_thermal_electric_conversion = 3,4`)""" + vachtmw: float = 0.5 + """vacuum pump power (MW)""" -f_p_plant_electric_recirc: float = None -"""fraction of recirculating electric power to total electric power""" + f_p_plant_electric_recirc: float = 0.0 + """fraction of recirculating electric power to total electric power""" -def init_heat_transport_variables(): - """Initialise heat transport variables""" - global \ - p_plant_electric_base, \ - p_cryo_plant_electric_mw, \ - p_cryo_plant_electric_max_mw, \ - etatf, \ - eta_turbine, \ - etath_liq, \ - fachtmw, \ - p_plant_electric_base_total_mw, \ - fgrosbop, \ - fmgdmw, \ - f_p_blkt_coolant_pump_total_heat, \ - f_p_div_coolant_pump_total_heat, \ - f_p_fw_coolant_pump_total_heat, \ - f_p_shld_coolant_pump_total_heat, \ - helpow, \ - helpow_cryal, \ - p_coolant_pump_elec_total_mw, \ - p_blkt_coolant_pump_mw, \ - p_blkt_breeder_pump_mw, \ - htpmw_blkt_tot, \ - p_div_coolant_pump_mw, \ - p_fw_coolant_pump_mw, \ - p_shld_coolant_pump_mw, \ - p_coolant_pump_loss_total_mw, \ - ipowerflow, \ - i_shld_primary_heat, \ - n_primary_heat_exchangers, \ - pacpmw, \ - peakmva, \ - p_fw_div_heat_deposited_mw, \ - p_plant_electric_gross_mw, \ - p_hcd_electric_loss_mw, \ - p_hcd_electric_total_mw, \ - p_hcd_secondary_electric_mw, \ - p_plant_electric_net_mw, \ - p_plant_electric_recirc_mw, \ - priheat, \ - p_div_secondary_heat_mw, \ - p_hcd_secondary_heat_mw, \ - p_plant_secondary_heat_mw, \ - p_shld_secondary_heat_mw, \ - p_plant_primary_heat_mw, \ - pflux_plant_floor_electric, \ - p_tf_electric_supplies_mw, \ - tlvpmw, \ - p_tritium_plant_electric_mw, \ - temp_turbine_coolant_in, \ - vachtmw, \ - f_p_plant_electric_recirc - - p_plant_electric_base = 5.0e6 - p_cryo_plant_electric_mw = 0.0 - p_cryo_plant_electric_max_mw = 50.0 - etatf = 0.9 - eta_turbine = 0.35 - etath_liq = 0.35 - fachtmw = 0.0 - p_plant_electric_base_total_mw = 0.0 - fgrosbop = 0.0 - fmgdmw = 0.0 - f_p_blkt_coolant_pump_total_heat = 0.005 - f_p_div_coolant_pump_total_heat = 0.005 - f_p_fw_coolant_pump_total_heat = 0.005 - f_p_shld_coolant_pump_total_heat = 0.005 - helpow = 0.0 - helpow_cryal = 0.0 - p_coolant_pump_elec_total_mw = 0.0 - p_blkt_coolant_pump_mw = 0.0 - p_blkt_breeder_pump_mw = 0.0 - htpmw_blkt_tot = 0.0 - p_div_coolant_pump_mw = 0.0 - p_fw_coolant_pump_mw = 0.0 - p_shld_coolant_pump_mw = 0.0 - p_coolant_pump_loss_total_mw = 0.0 - ipowerflow = 1 - i_shld_primary_heat = 1 - n_primary_heat_exchangers = 0 - pacpmw = 0.0 - peakmva = 0.0 - p_fw_div_heat_deposited_mw = 0.0 - p_plant_electric_gross_mw = 0.0 - p_hcd_electric_loss_mw = 0.0 - p_hcd_electric_total_mw = 0.0 - p_hcd_secondary_electric_mw = 0.0 - p_plant_electric_net_mw = 0.0 - p_plant_electric_recirc_mw = 0.0 - priheat = 0.0 - p_div_secondary_heat_mw = 0.0 - p_hcd_secondary_heat_mw = 0.0 - p_plant_secondary_heat_mw = 0.0 - p_shld_secondary_heat_mw = 0.0 - p_plant_primary_heat_mw = 0.0 - pflux_plant_floor_electric = 150.0 - p_tf_electric_supplies_mw = 0.0 - tlvpmw = 0.0 - p_tritium_plant_electric_mw = 15.0 - temp_turbine_coolant_in = 0.0 - vachtmw = 0.5 - f_p_plant_electric_recirc = 0.0 +CREATE_DICTS_FROM_DATACLASS = HeatTransportData diff --git a/process/models/blankets/blanket_library.py b/process/models/blankets/blanket_library.py index 51a322cf2..e11273a75 100644 --- a/process/models/blankets/blanket_library.py +++ b/process/models/blankets/blanket_library.py @@ -12,7 +12,6 @@ from process.core.model import Model from process.data_structure import ( divertor_variables, - heat_transport_variables, physics_variables, ) from process.models.build import FwBlktVVShape @@ -2440,7 +2439,7 @@ def thermo_hydraulic_model(self, output: bool): ) # Mechanical pumping power for the first wall (MW) - heat_transport_variables.p_fw_coolant_pump_mw = self.coolant_pumping_power( + self.data.heat_transport.p_fw_coolant_pump_mw = self.coolant_pumping_power( output=output, i_liquid_breeder=1, temp_coolant_pump_outlet=self.data.fwbs.temp_fw_coolant_in, @@ -2454,7 +2453,7 @@ def thermo_hydraulic_model(self, output: bool): ) # Mechanical pumping power for the blanket (MW) - heat_transport_variables.p_blkt_coolant_pump_mw = self.coolant_pumping_power( + self.data.heat_transport.p_blkt_coolant_pump_mw = self.coolant_pumping_power( output=output, i_liquid_breeder=1, temp_coolant_pump_outlet=self.data.fwbs.temp_blkt_coolant_in, @@ -2471,8 +2470,8 @@ def thermo_hydraulic_model(self, output: bool): # Total mechanical pumping power (MW) self.data.primary_pumping.p_fw_blkt_coolant_pump_mw = ( - heat_transport_variables.p_fw_coolant_pump_mw - + heat_transport_variables.p_blkt_coolant_pump_mw + self.data.heat_transport.p_fw_coolant_pump_mw + + self.data.heat_transport.p_blkt_coolant_pump_mw ) # If the blanket has a liquid metal breeder... @@ -2494,7 +2493,7 @@ def thermo_hydraulic_model(self, output: bool): ) # Mechanical pumping power for the blanket (MW) - heat_transport_variables.p_blkt_breeder_pump_mw = self.coolant_pumping_power( + self.data.heat_transport.p_blkt_breeder_pump_mw = self.coolant_pumping_power( output=output, i_liquid_breeder=2, temp_coolant_pump_outlet=self.data.fwbs.inlet_temp_liq, @@ -2509,9 +2508,9 @@ def thermo_hydraulic_model(self, output: bool): label="Liquid Metal Breeder/Coolant", ) - heat_transport_variables.htpmw_blkt_tot = ( + self.data.heat_transport.htpmw_blkt_tot = ( self.data.primary_pumping.p_fw_blkt_coolant_pump_mw - + heat_transport_variables.p_blkt_breeder_pump_mw + + self.data.heat_transport.p_blkt_breeder_pump_mw ) if output: @@ -2705,14 +2704,14 @@ def thermo_hydraulic_model(self, output: bool): self.outfile, "Mechanical pumping power for FW (MW)", "(p_fw_coolant_pump_mw)", - heat_transport_variables.p_fw_coolant_pump_mw, + self.data.heat_transport.p_fw_coolant_pump_mw, "OP ", ) po.ovarre( self.outfile, "Mechanical pumping power for blanket (primary) coolant (MW)", "(p_blkt_coolant_pump_mw)", - heat_transport_variables.p_blkt_coolant_pump_mw, + self.data.heat_transport.p_blkt_coolant_pump_mw, "OP ", ) if self.data.fwbs.i_blkt_dual_coolant > 0: @@ -2720,7 +2719,7 @@ def thermo_hydraulic_model(self, output: bool): self.outfile, "Mechanical pumping power for blanket liquid breeder (MW)", "(p_blkt_breeder_pump_mw)", - heat_transport_variables.p_blkt_breeder_pump_mw, + self.data.heat_transport.p_blkt_breeder_pump_mw, "OP ", ) po.ovarre( @@ -2735,21 +2734,21 @@ def thermo_hydraulic_model(self, output: bool): self.outfile, "Total mechanical pumping power for FW, blanket and liquid metal breeder(MW)", "(htpmw_blkt_tot)", - heat_transport_variables.htpmw_blkt_tot, + self.data.heat_transport.htpmw_blkt_tot, "OP ", ) po.ovarre( self.outfile, "Pumping power for divertor (MW)", "(p_div_coolant_pump_mw)", - heat_transport_variables.p_div_coolant_pump_mw, + self.data.heat_transport.p_div_coolant_pump_mw, "OP ", ) po.ovarre( self.outfile, "Pumping power for shield and vacuum vessel (MW)", "(p_shld_coolant_pump_mw)", - heat_transport_variables.p_shld_coolant_pump_mw, + self.data.heat_transport.p_shld_coolant_pump_mw, "OP ", ) diff --git a/process/models/blankets/dcll.py b/process/models/blankets/dcll.py index ee608726c..417e0ab54 100644 --- a/process/models/blankets/dcll.py +++ b/process/models/blankets/dcll.py @@ -4,7 +4,6 @@ ) from process.data_structure import ( divertor_variables, - heat_transport_variables, physics_variables, ) from process.models.blankets.blanket_library import InboardBlanket, OutboardBlanket @@ -309,15 +308,15 @@ def dcll_power_and_heating(self, output: bool): if i_p_coolant_pumping == PumpingPowerModelTypes.FRACTION_OF_HEAT: # User sets mechanical pumping power directly ( - heat_transport_variables.p_fw_coolant_pump_mw, - heat_transport_variables.p_blkt_coolant_pump_mw, - heat_transport_variables.p_shld_coolant_pump_mw, - heat_transport_variables.p_div_coolant_pump_mw, + self.data.heat_transport.p_fw_coolant_pump_mw, + self.data.heat_transport.p_blkt_coolant_pump_mw, + self.data.heat_transport.p_shld_coolant_pump_mw, + self.data.heat_transport.p_div_coolant_pump_mw, ) = pumping_powers_as_fractions( - f_p_fw_coolant_pump_total_heat=heat_transport_variables.f_p_fw_coolant_pump_total_heat, - f_p_blkt_coolant_pump_total_heat=heat_transport_variables.f_p_blkt_coolant_pump_total_heat, - f_p_shld_coolant_pump_total_heat=heat_transport_variables.f_p_shld_coolant_pump_total_heat, - f_p_div_coolant_pump_total_heat=heat_transport_variables.f_p_div_coolant_pump_total_heat, + f_p_fw_coolant_pump_total_heat=self.data.heat_transport.f_p_fw_coolant_pump_total_heat, + f_p_blkt_coolant_pump_total_heat=self.data.heat_transport.f_p_blkt_coolant_pump_total_heat, + f_p_shld_coolant_pump_total_heat=self.data.heat_transport.f_p_shld_coolant_pump_total_heat, + f_p_div_coolant_pump_total_heat=self.data.heat_transport.f_p_div_coolant_pump_total_heat, p_fw_nuclear_heat_total_mw=self.data.fwbs.p_fw_nuclear_heat_total_mw, psurffwi=self.data.fwbs.psurffwi, psurffwo=self.data.fwbs.psurffwo, @@ -336,8 +335,8 @@ def dcll_power_and_heating(self, output: bool): # Mechanical pumping power is calculated for first wall and blanket self.thermo_hydraulic_model(output=output) # For divertor,mechanical pumping power is a fraction of thermal power removed by coolant - heat_transport_variables.p_div_coolant_pump_mw = ( - heat_transport_variables.f_p_div_coolant_pump_total_heat + self.data.heat_transport.p_div_coolant_pump_mw = ( + self.data.heat_transport.f_p_div_coolant_pump_total_heat * ( physics_variables.p_plasma_separatrix_mw + self.data.fwbs.p_div_nuclear_heat_total_mw @@ -346,8 +345,8 @@ def dcll_power_and_heating(self, output: bool): ) # Shield power is negligible and this model doesn't have nuclear heating to the shield - heat_transport_variables.p_shld_coolant_pump_mw = ( - heat_transport_variables.f_p_shld_coolant_pump_total_heat * 0.0 + self.data.heat_transport.p_shld_coolant_pump_mw = ( + self.data.heat_transport.f_p_shld_coolant_pump_total_heat * 0.0 ) if output: @@ -361,14 +360,14 @@ def dcll_power_and_heating(self, output: bool): self.outfile, "Mechanical pumping power for first wall (MW)", "(p_fw_coolant_pump_mw)", - heat_transport_variables.p_fw_coolant_pump_mw, + self.data.heat_transport.p_fw_coolant_pump_mw, "OP ", ) po.ovarre( self.outfile, "Mechanical pumping power for blanket (MW)", "(p_blkt_coolant_pump_mw)", - heat_transport_variables.p_blkt_coolant_pump_mw, + self.data.heat_transport.p_blkt_coolant_pump_mw, "OP ", ) else: @@ -385,7 +384,7 @@ def dcll_power_and_heating(self, output: bool): self.outfile, "Mechanical pumping power for liquid metal breeder (MW)", "(p_blkt_breeder_pump_mw)", - heat_transport_variables.p_blkt_breeder_pump_mw, + self.data.heat_transport.p_blkt_breeder_pump_mw, "OP ", ) @@ -393,14 +392,14 @@ def dcll_power_and_heating(self, output: bool): self.outfile, "Mechanical pumping power for divertor (MW)", "(p_div_coolant_pump_mw)", - heat_transport_variables.p_div_coolant_pump_mw, + self.data.heat_transport.p_div_coolant_pump_mw, "OP ", ) po.ovarre( self.outfile, "Mechanical pumping power for shield and vacuum vessel (MW)", "(p_shld_coolant_pump_mw)", - heat_transport_variables.p_shld_coolant_pump_mw, + self.data.heat_transport.p_shld_coolant_pump_mw, "OP ", ) diff --git a/process/models/blankets/hcpb.py b/process/models/blankets/hcpb.py index 606633a09..6279f8fff 100644 --- a/process/models/blankets/hcpb.py +++ b/process/models/blankets/hcpb.py @@ -10,7 +10,6 @@ from process.core.exceptions import ProcessValueError from process.data_structure import ( divertor_variables, - heat_transport_variables, physics_variables, tfcoil_variables, ) @@ -785,20 +784,20 @@ def powerflow_calc(self, output: bool): if i_p_coolant_pumping == PumpingPowerModelTypes.FRACTION_OF_HEAT: # User sets mechanical pumping power directly ( - heat_transport_variables.p_fw_coolant_pump_mw, - heat_transport_variables.p_blkt_coolant_pump_mw, - heat_transport_variables.p_shld_coolant_pump_mw, - heat_transport_variables.p_div_coolant_pump_mw, + self.data.heat_transport.p_fw_coolant_pump_mw, + self.data.heat_transport.p_blkt_coolant_pump_mw, + self.data.heat_transport.p_shld_coolant_pump_mw, + self.data.heat_transport.p_div_coolant_pump_mw, ) = pumping_powers_as_fractions( - f_p_fw_coolant_pump_total_heat=heat_transport_variables.f_p_fw_coolant_pump_total_heat, - f_p_blkt_coolant_pump_total_heat=heat_transport_variables.f_p_blkt_coolant_pump_total_heat, - f_p_shld_coolant_pump_total_heat=heat_transport_variables.f_p_shld_coolant_pump_total_heat, - f_p_div_coolant_pump_total_heat=heat_transport_variables.f_p_div_coolant_pump_total_heat, + f_p_fw_coolant_pump_total_heat=self.data.heat_transport.f_p_fw_coolant_pump_total_heat, + f_p_blkt_coolant_pump_total_heat=self.data.heat_transport.f_p_blkt_coolant_pump_total_heat, + f_p_shld_coolant_pump_total_heat=self.data.heat_transport.f_p_shld_coolant_pump_total_heat, + f_p_div_coolant_pump_total_heat=self.data.heat_transport.f_p_div_coolant_pump_total_heat, p_fw_nuclear_heat_total_mw=self.data.fwbs.p_fw_nuclear_heat_total_mw, psurffwi=self.data.fwbs.psurffwi, psurffwo=self.data.fwbs.psurffwo, p_blkt_nuclear_heat_total_mw=self.data.fwbs.p_blkt_nuclear_heat_total_mw, - p_shld_nuclear_heat_mw=heat_transport_variables.p_shld_nuclear_heat_mw, + p_shld_nuclear_heat_mw=self.data.heat_transport.p_shld_nuclear_heat_mw, p_cp_shield_nuclear_heat_mw=self.data.fwbs.p_cp_shield_nuclear_heat_mw, p_plasma_separatrix_mw=physics_variables.p_plasma_separatrix_mw, p_div_nuclear_heat_total_mw=self.data.fwbs.p_div_nuclear_heat_total_mw, @@ -813,15 +812,15 @@ def powerflow_calc(self, output: bool): # For divertor and shield, mechanical pumping power is a fraction of thermal # power removed by coolant - heat_transport_variables.p_shld_coolant_pump_mw = ( - heat_transport_variables.f_p_shld_coolant_pump_total_heat + self.data.heat_transport.p_shld_coolant_pump_mw = ( + self.data.heat_transport.f_p_shld_coolant_pump_total_heat * ( self.data.fwbs.p_shld_nuclear_heat_mw + self.data.fwbs.p_cp_shield_nuclear_heat_mw ) ) - heat_transport_variables.p_div_coolant_pump_mw = ( - heat_transport_variables.f_p_div_coolant_pump_total_heat + self.data.heat_transport.p_div_coolant_pump_mw = ( + self.data.heat_transport.f_p_div_coolant_pump_total_heat * ( physics_variables.p_plasma_separatrix_mw + self.data.fwbs.p_div_nuclear_heat_total_mw @@ -868,15 +867,15 @@ def powerflow_calc(self, output: bool): # For divertor and shield, mechanical pumping power is a fraction of thermal # power removed by coolant - heat_transport_variables.p_shld_coolant_pump_mw = ( - heat_transport_variables.f_p_shld_coolant_pump_total_heat + self.data.heat_transport.p_shld_coolant_pump_mw = ( + self.data.heat_transport.f_p_shld_coolant_pump_total_heat * ( self.data.fwbs.p_shld_nuclear_heat_mw + self.data.fwbs.p_cp_shield_nuclear_heat_mw ) ) - heat_transport_variables.p_div_coolant_pump_mw = ( - heat_transport_variables.f_p_div_coolant_pump_total_heat + self.data.heat_transport.p_div_coolant_pump_mw = ( + self.data.heat_transport.f_p_div_coolant_pump_total_heat * ( physics_variables.p_plasma_separatrix_mw + self.data.fwbs.p_div_nuclear_heat_total_mw @@ -942,14 +941,14 @@ def powerflow_calc(self, output: bool): self.outfile, "Mechanical pumping power for divertor (MW)", "(p_div_coolant_pump_mw)", - heat_transport_variables.p_div_coolant_pump_mw, + self.data.heat_transport.p_div_coolant_pump_mw, "OP ", ) po.ovarre( self.outfile, "Mechanical pumping power for shield and vacuum vessel (MW)", "(p_shld_coolant_pump_mw)", - heat_transport_variables.p_shld_coolant_pump_mw, + self.data.heat_transport.p_shld_coolant_pump_mw, "OP ", ) po.ovarre( @@ -1522,35 +1521,35 @@ def write_output(self): self.outfile, "Mechanical pumping power for first wall (MW)", "(p_fw_coolant_pump_mw)", - heat_transport_variables.p_fw_coolant_pump_mw, + self.data.heat_transport.p_fw_coolant_pump_mw, "OP ", ) po.ovarre( self.outfile, "Mechanical pumping power for blanket (MW)", "(p_blkt_coolant_pump_mw)", - heat_transport_variables.p_blkt_coolant_pump_mw, + self.data.heat_transport.p_blkt_coolant_pump_mw, "OP ", ) po.ovarre( self.outfile, "Mechanical pumping power for divertor (MW)", "(p_div_coolant_pump_mw)", - heat_transport_variables.p_div_coolant_pump_mw, + self.data.heat_transport.p_div_coolant_pump_mw, "OP ", ) po.ovarre( self.outfile, "Mechanical pumping power for shield and vacuum vessel (MW)", "(p_shld_coolant_pump_mw)", - heat_transport_variables.p_shld_coolant_pump_mw, + self.data.heat_transport.p_shld_coolant_pump_mw, "OP ", ) po.ovarre( self.outfile, "Total electrical coolant pumping power: first wall, blanket, shield and divertor (MW)", "(p_coolant_pump_elec_total_mw)", - heat_transport_variables.p_coolant_pump_elec_total_mw, + self.data.heat_transport.p_coolant_pump_elec_total_mw, "OP ", ) diff --git a/process/models/buildings.py b/process/models/buildings.py index da859a540..d47005f4a 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -7,7 +7,6 @@ from process.core.model import Model from process.data_structure import ( divertor_variables, - heat_transport_variables, pfcoil_variables, physics_variables, tfcoil_variables, @@ -89,7 +88,7 @@ def run(self, output: bool = False): - self.data.build.dz_vv_lower, self.data.fwbs.whtshld, self.data.fwbs.r_cryostat_inboard, - heat_transport_variables.helpow, + self.data.heat_transport.helpow, ) def bldgs( diff --git a/process/models/costs/costs.py b/process/models/costs/costs.py index 435154613..fded82b1e 100644 --- a/process/models/costs/costs.py +++ b/process/models/costs/costs.py @@ -8,7 +8,6 @@ from process.core.model import Model from process.data_structure import ( divertor_variables, - heat_transport_variables, ife_variables, pf_power_variables, pfcoil_variables, @@ -2129,7 +2128,7 @@ def acc2252(self): pfpwr routine from the plant power module. """ self.data.costs.c22521 = ( - 1.0e-6 * self.data.costs.ucpfps * heat_transport_variables.peakmva + 1.0e-6 * self.data.costs.ucpfps * self.data.heat_transport.peakmva ) self.data.costs.c22521 = self.data.costs.fkind * self.data.costs.c22521 @@ -2225,7 +2224,7 @@ def acc2261(self): 1.0e-6 * self.data.costs.uchts[self.data.fwbs.i_blkt_coolant_type - 1] * ( - (1.0e6 * heat_transport_variables.p_fw_div_heat_deposited_mw) ** exphts + (1.0e6 * self.data.heat_transport.p_fw_div_heat_deposited_mw) ** exphts + (1.0e6 * self.data.fwbs.p_blkt_nuclear_heat_total_mw) ** exphts + (1.0e6 * self.data.fwbs.p_shld_nuclear_heat_mw) ** exphts ) @@ -2239,11 +2238,11 @@ def acc2261(self): self.data.costs.chx = ( 1.0e-6 * self.data.costs.UCPHX - * heat_transport_variables.n_primary_heat_exchangers + * self.data.heat_transport.n_primary_heat_exchangers * ( 1.0e6 - * heat_transport_variables.p_plant_primary_heat_mw - / heat_transport_variables.n_primary_heat_exchangers + * self.data.heat_transport.p_plant_primary_heat_mw + / self.data.heat_transport.n_primary_heat_exchangers ) ** exphts ) @@ -2265,12 +2264,12 @@ def acc2262(self): 1.0e-6 * self.data.costs.UCAHTS * ( - (1.0e6 * heat_transport_variables.p_hcd_electric_loss_mw) ** exphts - + (1.0e6 * heat_transport_variables.p_cryo_plant_electric_mw) ** exphts - + (1.0e6 * heat_transport_variables.vachtmw) ** exphts - + (1.0e6 * heat_transport_variables.p_tritium_plant_electric_mw) + (1.0e6 * self.data.heat_transport.p_hcd_electric_loss_mw) ** exphts + + (1.0e6 * self.data.heat_transport.p_cryo_plant_electric_mw) ** exphts + + (1.0e6 * self.data.heat_transport.vachtmw) ** exphts + + (1.0e6 * self.data.heat_transport.p_tritium_plant_electric_mw) ** exphts - + (1.0e6 * heat_transport_variables.fachtmw) ** exphts + + (1.0e6 * self.data.heat_transport.fachtmw) ** exphts ) ) @@ -2303,7 +2302,7 @@ def acc2263(self): * self.data.costs.uccry * 4.5e0 / tfcoil_variables.temp_tf_cryo - * heat_transport_variables.helpow**expcry + * self.data.heat_transport.helpow**expcry ) # Apply Nth kind and safety factors @@ -2434,7 +2433,7 @@ def acc23(self): self.data.costs.c23 = ( 1.0e-6 * self.data.costs.ucturb[self.data.fwbs.i_blkt_coolant_type - 1] - * (heat_transport_variables.p_plant_electric_gross_mw / 1200.0e0) + * (self.data.heat_transport.p_plant_electric_gross_mw / 1200.0e0) ** exptpe ) @@ -2471,9 +2470,9 @@ def acc242(self): # Account 242 : Transformers self.data.costs.c242 = 1.0e-6 * ( - self.data.costs.UCPP * (heat_transport_variables.pacpmw * 1.0e3) ** expepe + self.data.costs.UCPP * (self.data.heat_transport.pacpmw * 1.0e3) ** expepe + self.data.costs.UCAP - * (heat_transport_variables.p_plant_electric_base_total_mw * 1.0e3) + * (self.data.heat_transport.p_plant_electric_base_total_mw * 1.0e3) ) # Apply safety assurance factor @@ -2490,7 +2489,7 @@ def acc243(self): self.data.costs.c243 = ( 1.0e-6 * self.data.costs.UCLV - * heat_transport_variables.tlvpmw + * self.data.heat_transport.tlvpmw * 1.0e3 / 0.8e0 * cmlsa[self.data.costs.lsa - 1] @@ -2544,13 +2543,13 @@ def acc26(self): if self.data.costs.ireactor == 0: pwrrej = ( physics_variables.p_fusion_total_mw - + heat_transport_variables.p_hcd_electric_total_mw + + self.data.heat_transport.p_hcd_electric_total_mw + tfcoil_variables.tfcmw ) else: pwrrej = ( - heat_transport_variables.p_plant_primary_heat_mw - - heat_transport_variables.p_plant_electric_gross_mw + self.data.heat_transport.p_plant_primary_heat_mw + - self.data.heat_transport.p_plant_electric_gross_mw ) # self.data.costs.uchrs - reference cost of heat rejection system [$] @@ -2660,7 +2659,7 @@ def acc2253(self): shcss = 520.0e0 self.data.costs.c2253 = ( self.data.costs.ucblss - * (heat_transport_variables.p_plant_primary_heat_mw * 1.0e6) + * (self.data.heat_transport.p_plant_primary_heat_mw * 1.0e6) * self.data.times.t_plant_pulse_no_burn / (shcss * self.data.pulse.dtstor) ) @@ -2675,7 +2674,7 @@ def acc2253(self): self.data.costs.c2253 = ( self.data.costs.c2253 - * heat_transport_variables.p_plant_electric_net_mw + * self.data.heat_transport.p_plant_electric_net_mw / 1200.0e0 ) @@ -2701,14 +2700,14 @@ def coelc(self): if ife_variables.ife == 1: kwhpy = ( 1.0e3 - * heat_transport_variables.p_plant_electric_net_mw + * self.data.heat_transport.p_plant_electric_net_mw * (24.0e0 * constants.N_DAY_YEAR) * self.data.costs.f_t_plant_available ) else: kwhpy = ( 1.0e3 - * heat_transport_variables.p_plant_electric_net_mw + * self.data.heat_transport.p_plant_electric_net_mw * (24.0e0 * constants.N_DAY_YEAR) * self.data.costs.f_t_plant_available * self.data.times.t_plant_pulse_burn @@ -2866,14 +2865,14 @@ def coelc(self): # Annual cost of operation and maintenance - if heat_transport_variables.p_plant_electric_net_mw < 0: + if self.data.heat_transport.p_plant_electric_net_mw < 0: sqrt_p_plant_electric_net_mw_1200 = 0.0 logger.warning( "p_plant_electric_net_mw has gone negative! Clamping it to 0 for the calculation of annoam and annwst (cost of maintenance and cost of waste)." ) else: sqrt_p_plant_electric_net_mw_1200 = np.sqrt( - heat_transport_variables.p_plant_electric_net_mw / 1200.0e0 + self.data.heat_transport.p_plant_electric_net_mw / 1200.0e0 ) annoam = ( self.data.costs.ucoam[self.data.costs.lsa - 1] @@ -2893,7 +2892,7 @@ def coelc(self): # Sum D-T fuel cost and He3 fuel cost annfuel = ( self.data.costs.ucfuel - * heat_transport_variables.p_plant_electric_net_mw + * self.data.heat_transport.p_plant_electric_net_mw / 1200.0e0 + 1.0e-6 * physics_variables.f_plasma_fuel_helium3 diff --git a/process/models/costs/costs_2015.py b/process/models/costs/costs_2015.py index 24d429a73..296c10c92 100644 --- a/process/models/costs/costs_2015.py +++ b/process/models/costs/costs_2015.py @@ -7,7 +7,6 @@ from process.core.model import Model from process.data_structure import ( global_variables, - heat_transport_variables, pf_power_variables, pfcoil_variables, physics_variables, @@ -70,7 +69,7 @@ def run(self): # Electrical output (given availability) for a whole year self.data.costs_2015.mean_electric_output = ( - heat_transport_variables.p_plant_electric_net_mw * self.data.costs.cpfact + self.data.heat_transport.p_plant_electric_net_mw * self.data.costs.cpfact ) self.data.costs_2015.annual_electric_output = ( self.data.costs_2015.mean_electric_output * 24.0e0 * 365.25e0 @@ -415,7 +414,7 @@ def output(self): self.outfile, "Net electric output (MW)", "(p_plant_electric_net_mw)", - heat_transport_variables.p_plant_electric_net_mw, + self.data.heat_transport.p_plant_electric_net_mw, "OP ", ) po.ovarrf( @@ -507,7 +506,7 @@ def calc_building_costs(self): 130000.0e0 * self.data.costs.light_build_cost_per_vol ) # Scale with the total heat load on the cryoplant at ~4.5K (kW) - self.data.costs_2015.s_k[3] = heat_transport_variables.helpow / 1.0e3 + self.data.costs_2015.s_k[3] = self.data.heat_transport.helpow / 1.0e3 self.data.costs_2015.s_kref[3] = 61.0e0 self.data.costs_2015.s_cost[3] = ( self.data.costs_2015.s_cost_factor[3] @@ -567,8 +566,8 @@ def calc_building_costs(self): ) # Scale with total thermal power removed from the core (MW) self.data.costs_2015.s_k[7] = ( - heat_transport_variables.p_plant_primary_heat_mw - + heat_transport_variables.p_plant_secondary_heat_mw + self.data.heat_transport.p_plant_primary_heat_mw + + self.data.heat_transport.p_plant_secondary_heat_mw ) self.data.costs_2015.s_kref[7] = 880.0e0 self.data.costs_2015.s_cost[7] = ( @@ -840,7 +839,7 @@ def calc_n_plant_and_vv_costs(self): # ITER reference cost (2014 $) self.data.costs_2015.s_cref[32] = 86.0e6 # Scale with 4.5K cryopower (W) - self.data.costs_2015.s_k[32] = heat_transport_variables.helpow + self.data.costs_2015.s_k[32] = self.data.heat_transport.helpow self.data.costs_2015.s_kref[32] = 50.0e3 self.data.costs_2015.s_cost[32] = ( self.data.costs_2015.s_cost_factor[32] @@ -868,7 +867,7 @@ def calc_energy_conversion_system(self): # Cost of reference energy conversion system (Rolls Royce) self.data.costs_2015.s_cref[34] = 511.0e6 # Scale with gross electric power (MWe) - self.data.costs_2015.s_k[34] = heat_transport_variables.p_plant_electric_gross_mw + self.data.costs_2015.s_k[34] = self.data.heat_transport.p_plant_electric_gross_mw self.data.costs_2015.s_kref[34] = 692.0e0 self.data.costs_2015.s_cost[34] = ( self.data.costs_2015.s_cost_factor[34] @@ -953,8 +952,8 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cref[42] = 40.0e6 # Scale with total thermal power removed from fusion core (MW) self.data.costs_2015.s_k[42] = ( - heat_transport_variables.p_plant_primary_heat_mw - + heat_transport_variables.p_plant_secondary_heat_mw + self.data.heat_transport.p_plant_primary_heat_mw + + self.data.heat_transport.p_plant_secondary_heat_mw ) self.data.costs_2015.s_kref[42] = 550.0e0 self.data.costs_2015.s_cost[42] = ( @@ -986,8 +985,8 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cref[44] = 724.0e6 # Scale with total thermal power removed from fusion core (MW) self.data.costs_2015.s_k[44] = ( - heat_transport_variables.p_plant_primary_heat_mw - + heat_transport_variables.p_plant_secondary_heat_mw + self.data.heat_transport.p_plant_primary_heat_mw + + self.data.heat_transport.p_plant_secondary_heat_mw ) self.data.costs_2015.s_kref[44] = 550.0e0 self.data.costs_2015.s_cost[44] = ( @@ -1073,7 +1072,7 @@ def calc_remaining_subsystems(self): # Cost of ITER Cryoplant and distribution self.data.costs_2015.s_cref[50] = 397.0e6 # Scale with heat removal at 4.5 K approx (W) - self.data.costs_2015.s_k[50] = heat_transport_variables.helpow + self.data.costs_2015.s_k[50] = self.data.heat_transport.helpow self.data.costs_2015.s_kref[50] = 50000.0e0 self.data.costs_2015.s_cost[50] = ( self.data.costs_2015.s_cost_factor[50] diff --git a/process/models/ife.py b/process/models/ife.py index 0b4b0ad71..ca7def271 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -11,7 +11,6 @@ from process.core.exceptions import ProcessValueError from process.core.model import Model from process.data_structure import ( - heat_transport_variables, ife_variables, physics_variables, ) @@ -1830,14 +1829,14 @@ def ifepw1(self): # Primary nuclear heating (MW) # Total thermal power removed from fusion core - heat_transport_variables.priheat = ( + self.data.heat_transport.priheat = ( self.data.fwbs.f_p_blkt_multiplication * physics_variables.p_fusion_total_mw ) # Useful (high-grade) thermal power (MW) - heat_transport_variables.p_plant_primary_heat_mw = ( - heat_transport_variables.priheat * (1.0 - self.data.fwbs.fhole) + self.data.heat_transport.p_plant_primary_heat_mw = ( + self.data.heat_transport.priheat * (1.0 - self.data.fwbs.fhole) ) # Assume 0.24 of thermal power is intercepted by the first wall @@ -1847,17 +1846,17 @@ def ifepw1(self): # conventional blanket if ife_variables.ifetyp not in {3, 4}: - heat_transport_variables.p_fw_div_heat_deposited_mw = ( - 0.24 * heat_transport_variables.p_plant_primary_heat_mw + self.data.heat_transport.p_fw_div_heat_deposited_mw = ( + 0.24 * self.data.heat_transport.p_plant_primary_heat_mw ) self.data.fwbs.p_blkt_nuclear_heat_total_mw = ( - heat_transport_variables.p_plant_primary_heat_mw - - heat_transport_variables.p_fw_div_heat_deposited_mw + self.data.heat_transport.p_plant_primary_heat_mw + - self.data.heat_transport.p_fw_div_heat_deposited_mw ) else: - heat_transport_variables.p_fw_div_heat_deposited_mw = 0.0 + self.data.heat_transport.p_fw_div_heat_deposited_mw = 0.0 self.data.fwbs.p_blkt_nuclear_heat_total_mw = ( - heat_transport_variables.p_plant_primary_heat_mw + self.data.heat_transport.p_plant_primary_heat_mw ) self.data.fwbs.p_shld_nuclear_heat_mw = 0.0 @@ -1865,35 +1864,35 @@ def ifepw1(self): # Lost fusion power (MW) self.data.fwbs.pnucloss = ( - heat_transport_variables.priheat - - heat_transport_variables.p_plant_primary_heat_mw + self.data.heat_transport.priheat + - self.data.heat_transport.p_plant_primary_heat_mw ) # = priheat*fhole # Number of primary heat exchangers - heat_transport_variables.n_primary_heat_exchangers = np.ceil( - heat_transport_variables.p_plant_primary_heat_mw / 1000.0 + self.data.heat_transport.n_primary_heat_exchangers = np.ceil( + self.data.heat_transport.p_plant_primary_heat_mw / 1000.0 ) # Secondary heat (some of it... rest calculated in IFEPW2) # Wall plug driver power (MW) - heat_transport_variables.p_hcd_electric_total_mw = pdrvmw / ife_variables.etadrv + self.data.heat_transport.p_hcd_electric_total_mw = pdrvmw / ife_variables.etadrv # Waste driver power (MW) - heat_transport_variables.p_hcd_electric_loss_mw = ( - heat_transport_variables.p_hcd_electric_total_mw - pdrvmw + self.data.heat_transport.p_hcd_electric_loss_mw = ( + self.data.heat_transport.p_hcd_electric_total_mw - pdrvmw ) # Cryogenic power (MW) # Cryogenic temperature is assumed to be 4.5K - heat_transport_variables.p_cryo_plant_electric_mw = ife_variables.pifecr - heat_transport_variables.helpow = ( + self.data.heat_transport.p_cryo_plant_electric_mw = ife_variables.pifecr + self.data.heat_transport.helpow = ( 1.0e6 - * heat_transport_variables.p_cryo_plant_electric_mw + * self.data.heat_transport.p_cryo_plant_electric_mw * (0.13 * 4.5) / (constants.TEMP_ROOM - 4.5) ) @@ -1915,51 +1914,51 @@ def ifepw2(self, output: bool = False): (Default value = False) """ # Facility heat removal (p_plant_electric_base_total_mw calculated in IFEACP) - heat_transport_variables.fachtmw = ( - heat_transport_variables.p_plant_electric_base_total_mw + self.data.heat_transport.fachtmw = ( + self.data.heat_transport.p_plant_electric_base_total_mw ) # Total secondary heat - heat_transport_variables.p_plant_secondary_heat_mw = ( - heat_transport_variables.p_hcd_electric_loss_mw + self.data.heat_transport.p_plant_secondary_heat_mw = ( + self.data.heat_transport.p_hcd_electric_loss_mw + self.data.fwbs.pnucloss - + heat_transport_variables.fachtmw - + heat_transport_variables.vachtmw - + heat_transport_variables.p_tritium_plant_electric_mw + + self.data.heat_transport.fachtmw + + self.data.heat_transport.vachtmw + + self.data.heat_transport.p_tritium_plant_electric_mw + ife_variables.tdspmw + ife_variables.tfacmw - + heat_transport_variables.p_cryo_plant_electric_mw + + self.data.heat_transport.p_cryo_plant_electric_mw + ife_variables.htpmw_ife ) # Calculate powers relevant to a power-producing plant if self.data.costs.ireactor == 1: # Gross electric power - heat_transport_variables.p_plant_electric_gross_mw = ( - heat_transport_variables.p_plant_primary_heat_mw - * heat_transport_variables.eta_turbine + self.data.heat_transport.p_plant_electric_gross_mw = ( + self.data.heat_transport.p_plant_primary_heat_mw + * self.data.heat_transport.eta_turbine ) # Balance of plant recirculating power fraction - heat_transport_variables.fgrosbop = min( + self.data.heat_transport.fgrosbop = min( 0.5, ( ife_variables.fauxbop - / (heat_transport_variables.p_plant_electric_gross_mw / 1000.0) + / (self.data.heat_transport.p_plant_electric_gross_mw / 1000.0) ** 0.6 ), ) # Total recirculating power - heat_transport_variables.p_plant_electric_recirc_mw = ( - heat_transport_variables.fgrosbop - * heat_transport_variables.p_plant_electric_gross_mw - ) + heat_transport_variables.pacpmw + self.data.heat_transport.p_plant_electric_recirc_mw = ( + self.data.heat_transport.fgrosbop + * self.data.heat_transport.p_plant_electric_gross_mw + ) + self.data.heat_transport.pacpmw # Net electric power - heat_transport_variables.p_plant_electric_net_mw = ( - heat_transport_variables.p_plant_electric_gross_mw - - heat_transport_variables.p_plant_electric_recirc_mw + self.data.heat_transport.p_plant_electric_net_mw = ( + self.data.heat_transport.p_plant_electric_gross_mw + - self.data.heat_transport.p_plant_electric_recirc_mw ) if not output: @@ -1993,13 +1992,13 @@ def ifepw2(self, output: bool = False): self.outfile, "Driver wall plug power (MW)", "(p_hcd_electric_total_mw)", - heat_transport_variables.p_hcd_electric_total_mw, + self.data.heat_transport.p_hcd_electric_total_mw, ) process_output.ovarre( self.outfile, "First wall nuclear heating (MW)", "(p_fw_div_heat_deposited_mw)", - heat_transport_variables.p_fw_div_heat_deposited_mw, + self.data.heat_transport.p_fw_div_heat_deposited_mw, ) process_output.ovarre( self.outfile, @@ -2011,32 +2010,32 @@ def ifepw2(self, output: bool = False): self.outfile, "Primary heat (MW)", "(p_plant_primary_heat_mw)", - heat_transport_variables.p_plant_primary_heat_mw, + self.data.heat_transport.p_plant_primary_heat_mw, ) process_output.ovarre( self.outfile, "Secondary heat (MW)", "(p_plant_secondary_heat_mw)", - heat_transport_variables.p_plant_secondary_heat_mw, + self.data.heat_transport.p_plant_secondary_heat_mw, ) process_output.oblnkl(self.outfile) process_output.ovarre( self.outfile, "Heat removal from driver power (MW)", "(p_hcd_electric_loss_mw)", - heat_transport_variables.p_hcd_electric_loss_mw, + self.data.heat_transport.p_hcd_electric_loss_mw, ) process_output.ovarre( self.outfile, "Heat removal from cryogenic plant (MW)", "(p_cryo_plant_electric_mw)", - heat_transport_variables.p_cryo_plant_electric_mw, + self.data.heat_transport.p_cryo_plant_electric_mw, ) process_output.ovarre( self.outfile, "Heat removal from vacuum pumps (MW)", "(vachtmw)", - heat_transport_variables.vachtmw, + self.data.heat_transport.vachtmw, ) process_output.ovarre( self.outfile, @@ -2054,19 +2053,19 @@ def ifepw2(self, output: bool = False): self.outfile, "Heat removal from tritium plant (MW)", "(p_tritium_plant_electric_mw)", - heat_transport_variables.p_tritium_plant_electric_mw, + self.data.heat_transport.p_tritium_plant_electric_mw, ) process_output.ovarre( self.outfile, "Heat removal from facilities (MW)", "(fachtmw)", - heat_transport_variables.fachtmw, + self.data.heat_transport.fachtmw, ) process_output.ovarin( self.outfile, "Number of primary heat exchangers", "(n_primary_heat_exchangers)", - heat_transport_variables.n_primary_heat_exchangers, + self.data.heat_transport.n_primary_heat_exchangers, ) if self.data.costs.ireactor == 1: @@ -2075,19 +2074,19 @@ def ifepw2(self, output: bool = False): self.outfile, "Gross electric power (MW)", "(p_plant_electric_gross_mw)", - heat_transport_variables.p_plant_electric_gross_mw, + self.data.heat_transport.p_plant_electric_gross_mw, ) process_output.ovarre( self.outfile, "Net electric power (MW)", "(p_plant_electric_net_mw)", - heat_transport_variables.p_plant_electric_net_mw, + self.data.heat_transport.p_plant_electric_net_mw, ) process_output.ovarre( self.outfile, "Balance of plant aux. power fraction", "(fgrosbop)", - heat_transport_variables.fgrosbop, + self.data.heat_transport.fgrosbop, ) def ifeacp(self, output: bool = False): @@ -2103,22 +2102,22 @@ def ifeacp(self, output: bool = False): """ # Facility base load, MW (loads not dependent on floor area) - basemw = heat_transport_variables.p_plant_electric_base * 1e-6 + basemw = self.data.heat_transport.p_plant_electric_base * 1e-6 # Power needed per floor area, MW/m2 - pmwpm2 = heat_transport_variables.pflux_plant_floor_electric * 1e-6 + pmwpm2 = self.data.heat_transport.pflux_plant_floor_electric * 1e-6 # Total pulsed power system load, MW - heat_transport_variables.pacpmw = ( - heat_transport_variables.p_cryo_plant_electric_mw - + heat_transport_variables.vachtmw + self.data.heat_transport.pacpmw = ( + self.data.heat_transport.p_cryo_plant_electric_mw + + self.data.heat_transport.vachtmw + ife_variables.tdspmw + ife_variables.tfacmw + (ife_variables.htpmw_ife * ife_variables.reprat / 6.0) - + heat_transport_variables.p_tritium_plant_electric_mw - + heat_transport_variables.p_hcd_electric_total_mw + + self.data.heat_transport.p_tritium_plant_electric_mw + + self.data.heat_transport.p_hcd_electric_total_mw + basemw + (self.data.buildings.a_plant_floor_effective * pmwpm2) + ife_variables.lipmw @@ -2126,18 +2125,18 @@ def ifeacp(self, output: bool = False): # Total baseline power to facility loads, MW - heat_transport_variables.p_plant_electric_base_total_mw = basemw + ( + self.data.heat_transport.p_plant_electric_base_total_mw = basemw + ( self.data.buildings.a_plant_floor_effective * pmwpm2 ) # Estimate of the total low voltage power, MW - heat_transport_variables.tlvpmw = ( - heat_transport_variables.p_plant_electric_base_total_mw - + heat_transport_variables.p_tritium_plant_electric_mw + self.data.heat_transport.tlvpmw = ( + self.data.heat_transport.p_plant_electric_base_total_mw + + self.data.heat_transport.p_tritium_plant_electric_mw + (ife_variables.htpmw_ife * ife_variables.reprat / 6.0) - + heat_transport_variables.vachtmw - + 0.5 * heat_transport_variables.p_cryo_plant_electric_mw + + self.data.heat_transport.vachtmw + + 0.5 * self.data.heat_transport.p_cryo_plant_electric_mw + ife_variables.tfacmw ) @@ -2162,7 +2161,7 @@ def ifeacp(self, output: bool = False): self.outfile, "Driver power supplies (MW)", "(p_hcd_electric_total_mw)", - heat_transport_variables.p_hcd_electric_total_mw, + self.data.heat_transport.p_hcd_electric_total_mw, ) process_output.ovarre( self.outfile, @@ -2177,19 +2176,19 @@ def ifeacp(self, output: bool = False): self.outfile, "Tritium processing plant (MW)", "(p_tritium_plant_electric_mw)", - heat_transport_variables.p_tritium_plant_electric_mw, + self.data.heat_transport.p_tritium_plant_electric_mw, ) process_output.ovarre( self.outfile, "Vacuum pump motors (MW)", "(vachtmw)", - heat_transport_variables.vachtmw, + self.data.heat_transport.vachtmw, ) process_output.ovarre( self.outfile, "Cryogenic comp motors (MW)", "(p_cryo_plant_electric_mw)", - heat_transport_variables.p_cryo_plant_electric_mw, + self.data.heat_transport.p_cryo_plant_electric_mw, ) process_output.ovarre( self.outfile, @@ -2209,19 +2208,19 @@ def ifeacp(self, output: bool = False): self.outfile, "Total pulsed power (MW)", "(pacpmw)", - heat_transport_variables.pacpmw, + self.data.heat_transport.pacpmw, ) process_output.ovarre( self.outfile, "Total base power reqd at all times (MW)", "(p_plant_electric_base_total_mw)", - heat_transport_variables.p_plant_electric_base_total_mw, + self.data.heat_transport.p_plant_electric_base_total_mw, ) process_output.ovarre( self.outfile, "Total low voltage power (MW)", "(tlvpmw)", - heat_transport_variables.tlvpmw, + self.data.heat_transport.tlvpmw, ) def ifebdg(self, output: bool = False): @@ -2327,7 +2326,7 @@ def ifebdg(self, output: bool = False): # Cryogenic building volume - cryv = 55.0 * np.sqrt(heat_transport_variables.helpow) + cryv = 55.0 * np.sqrt(self.data.heat_transport.helpow) # Electrical building volume # (set equal to power injection (i.e. driver) building volume) diff --git a/process/models/physics/current_drive.py b/process/models/physics/current_drive.py index 666b13ba9..0cfcd1509 100644 --- a/process/models/physics/current_drive.py +++ b/process/models/physics/current_drive.py @@ -13,7 +13,6 @@ from process.core.exceptions import ProcessError, ProcessValueError from process.core.model import Model from process.data_structure import ( - heat_transport_variables, physics_variables, ) from process.models.physics.plasma_profiles import PlasmaProfile @@ -1880,7 +1879,7 @@ def current_drive(self): ) # Wall plug power - heat_transport_variables.p_hcd_secondary_electric_mw = ( + self.data.heat_transport.p_hcd_secondary_electric_mw = ( self.data.current_drive.p_hcd_secondary_injected_mw + self.data.current_drive.p_hcd_secondary_extra_heat_mw ) / self.data.current_drive.eta_lowhyb_injector_wall_plug @@ -1906,7 +1905,7 @@ def current_drive(self): ) # Wall plug power - heat_transport_variables.p_hcd_secondary_electric_mw = ( + self.data.heat_transport.p_hcd_secondary_electric_mw = ( self.data.current_drive.p_hcd_secondary_injected_mw + self.data.current_drive.p_hcd_secondary_extra_heat_mw ) / self.data.current_drive.eta_icrh_injector_wall_plug @@ -1932,7 +1931,7 @@ def current_drive(self): ) # Wall plug power - heat_transport_variables.p_hcd_secondary_electric_mw = ( + self.data.heat_transport.p_hcd_secondary_electric_mw = ( self.data.current_drive.p_hcd_secondary_injected_mw + self.data.current_drive.p_hcd_secondary_extra_heat_mw ) / self.data.current_drive.eta_ecrh_injector_wall_plug @@ -1958,7 +1957,7 @@ def current_drive(self): ) # Wall plug power - heat_transport_variables.p_hcd_secondary_electric_mw = ( + self.data.heat_transport.p_hcd_secondary_electric_mw = ( self.data.current_drive.p_hcd_secondary_injected_mw + self.data.current_drive.p_hcd_secondary_extra_heat_mw ) / self.data.current_drive.eta_ebw_injector_wall_plug @@ -2027,7 +2026,7 @@ def current_drive(self): / self.data.current_drive.eta_beam_injector_wall_plug ) # neutral beam wall plug power - heat_transport_variables.p_hcd_secondary_electric_mw = ( + self.data.heat_transport.p_hcd_secondary_electric_mw = ( self.data.current_drive.pwpnb ) @@ -2067,7 +2066,7 @@ def current_drive(self): ) # Wall plug power - heat_transport_variables.p_hcd_primary_electric_mw = ( + self.data.heat_transport.p_hcd_primary_electric_mw = ( self.data.current_drive.p_hcd_primary_injected_mw + self.data.current_drive.p_hcd_primary_extra_heat_mw ) / self.data.current_drive.eta_lowhyb_injector_wall_plug @@ -2093,7 +2092,7 @@ def current_drive(self): ) # Wall plug power - heat_transport_variables.p_hcd_primary_electric_mw = ( + self.data.heat_transport.p_hcd_primary_electric_mw = ( self.data.current_drive.p_hcd_primary_injected_mw + self.data.current_drive.p_hcd_primary_extra_heat_mw ) / self.data.current_drive.eta_icrh_injector_wall_plug @@ -2125,7 +2124,7 @@ def current_drive(self): ) # Wall plug to injector efficiency - heat_transport_variables.p_hcd_primary_electric_mw = ( + self.data.heat_transport.p_hcd_primary_electric_mw = ( self.data.current_drive.p_hcd_primary_injected_mw + self.data.current_drive.p_hcd_primary_extra_heat_mw ) / self.data.current_drive.eta_ecrh_injector_wall_plug @@ -2156,7 +2155,7 @@ def current_drive(self): ) # Wall plug to injector efficiency - heat_transport_variables.p_hcd_primary_electric_mw = ( + self.data.heat_transport.p_hcd_primary_electric_mw = ( self.data.current_drive.p_hcd_primary_injected_mw + self.data.current_drive.p_hcd_primary_extra_heat_mw ) / self.data.current_drive.eta_ebw_injector_wall_plug @@ -2225,7 +2224,7 @@ def current_drive(self): ) / self.data.current_drive.eta_beam_injector_wall_plug # Neutral beam wall plug power - heat_transport_variables.p_hcd_primary_electric_mw = ( + self.data.heat_transport.p_hcd_primary_electric_mw = ( self.data.current_drive.pwpnb ) self.data.current_drive.eta_hcd_primary_injector_wall_plug = ( @@ -2276,14 +2275,14 @@ def current_drive(self): ) # Total wall plug power for all heating systems - heat_transport_variables.p_hcd_electric_total_mw = ( - heat_transport_variables.p_hcd_primary_electric_mw - + heat_transport_variables.p_hcd_secondary_electric_mw + self.data.heat_transport.p_hcd_electric_total_mw = ( + self.data.heat_transport.p_hcd_primary_electric_mw + + self.data.heat_transport.p_hcd_secondary_electric_mw ) # Reset injected power to zero for ignited plasma (fudge) if physics_variables.i_plasma_ignited == 1: - heat_transport_variables.p_hcd_electric_total_mw = 0.0e0 + self.data.heat_transport.p_hcd_electric_total_mw = 0.0e0 # Ratio of fusion to input (injection+ohmic) power self.data.current_drive.big_q_plasma = ( @@ -2500,7 +2499,7 @@ def output(self): self.outfile, "Wall plug electric power of primary system", "(p_hcd_primary_electric_mw)", - heat_transport_variables.p_hcd_primary_electric_mw, + self.data.heat_transport.p_hcd_primary_electric_mw, "OP ", ) @@ -2724,7 +2723,7 @@ def output(self): self.outfile, "Wall plug electric power of secondary system", "(p_hcd_secondary_electric_mw)", - heat_transport_variables.p_hcd_secondary_electric_mw, + self.data.heat_transport.p_hcd_secondary_electric_mw, "OP ", ) diff --git a/process/models/power.py b/process/models/power.py index 4d03e3d0f..7a6abf312 100644 --- a/process/models/power.py +++ b/process/models/power.py @@ -12,7 +12,6 @@ from process.core.exceptions import ProcessValueError from process.core.model import Model from process.data_structure import ( - heat_transport_variables, numerics, pf_power_variables, pfcoil_variables, @@ -545,7 +544,7 @@ def pfpwr(self, output: bool): ) # Maximum total MVA requirements - heat_transport_variables.peakmva = max((powpfr + powpfi), powpfr2) + self.data.heat_transport.peakmva = max((powpfr + powpfi), powpfr2) pf_power_variables.vpfskv = 20.0e0 pf_power_variables.pfckts = ( @@ -687,47 +686,47 @@ def acpow(self, output: bool): output: bool """ - ptfmw = heat_transport_variables.p_tf_electric_supplies_mw + ptfmw = self.data.heat_transport.p_tf_electric_supplies_mw ppfmw = 1.0e-3 * pf_power_variables.srcktpm if pf_power_variables.i_pf_energy_storage_source == 2: - ppfmw += heat_transport_variables.peakmva + ppfmw += self.data.heat_transport.peakmva # Power to plasma heating supplies, MW pheatingmw = ( - heat_transport_variables.p_hcd_electric_total_mw + self.data.heat_transport.p_hcd_electric_total_mw ) # Should be zero if i_plasma_ignited==1 # Power to cryogenic comp. motors, MW - crymw = heat_transport_variables.p_cryo_plant_electric_mw + crymw = self.data.heat_transport.p_cryo_plant_electric_mw # Power to divertor coil supplies, MW bdvmw = 0.0e0 # Total pulsed power system load, MW - heat_transport_variables.pacpmw = ( + self.data.heat_transport.pacpmw = ( ppfmw + bdvmw + ptfmw + crymw - + heat_transport_variables.vachtmw - + heat_transport_variables.p_coolant_pump_elec_total_mw - + heat_transport_variables.p_tritium_plant_electric_mw + + self.data.heat_transport.vachtmw + + self.data.heat_transport.p_coolant_pump_elec_total_mw + + self.data.heat_transport.p_tritium_plant_electric_mw + pheatingmw ) # Add contribution from motor-generator flywheels if these are part of # the PF coil energy storage system if pf_power_variables.i_pf_energy_storage_source != 2: - heat_transport_variables.pacpmw += heat_transport_variables.fmgdmw + self.data.heat_transport.pacpmw += self.data.heat_transport.fmgdmw # Estimate of the total low voltage power, MW # MDK No idea what this is - especially the last term # It is used in the old cost routine, so I will leave it in place. - heat_transport_variables.tlvpmw = ( - heat_transport_variables.p_plant_electric_base_total_mw - + heat_transport_variables.p_tritium_plant_electric_mw - + heat_transport_variables.p_coolant_pump_elec_total_mw - + heat_transport_variables.vachtmw + self.data.heat_transport.tlvpmw = ( + self.data.heat_transport.p_plant_electric_base_total_mw + + self.data.heat_transport.p_tritium_plant_electric_mw + + self.data.heat_transport.p_coolant_pump_elec_total_mw + + self.data.heat_transport.vachtmw + 0.5e0 * (crymw + ppfmw) ) @@ -744,7 +743,7 @@ def acpow(self, output: bool): self.outfile, "Primary coolant pumps (MW)", "(p_coolant_pump_elec_total_mw..)", - heat_transport_variables.p_coolant_pump_elec_total_mw, + self.data.heat_transport.p_coolant_pump_elec_total_mw, "OP ", ) @@ -762,13 +761,13 @@ def acpow(self, output: bool): self.outfile, "Tritium processing (MW)", "(p_tritium_plant_electric_mw..)", - heat_transport_variables.p_tritium_plant_electric_mw, + self.data.heat_transport.p_tritium_plant_electric_mw, ) po.ovarre( self.outfile, "Vacuum pumps (MW)", "(vachtmw..)", - heat_transport_variables.vachtmw, + self.data.heat_transport.vachtmw, ) po.oblnkl(self.outfile) @@ -777,14 +776,14 @@ def acpow(self, output: bool): self.outfile, "Total pulsed power (MW)", "(pacpmw)", - heat_transport_variables.pacpmw, + self.data.heat_transport.pacpmw, "OP ", ) po.ovarre( self.outfile, "Total base power required at all times (MW)", "(p_plant_electric_base_total_mw)", - heat_transport_variables.p_plant_electric_base_total_mw, + self.data.heat_transport.p_plant_electric_base_total_mw, "OP ", ) # MDK Remove this output: no idea what this is @@ -803,8 +802,8 @@ def component_thermal_powers(self): PumpingPowerModelTypes.MECHANICAL_WITH_PRESSURE_DROP, }: self.data.primary_pumping.p_fw_blkt_coolant_pump_mw = ( - heat_transport_variables.p_fw_coolant_pump_mw - + heat_transport_variables.p_blkt_coolant_pump_mw + self.data.heat_transport.p_fw_coolant_pump_mw + + self.data.heat_transport.p_blkt_coolant_pump_mw ) # Account for pump electrical inefficiencies. The coolant pumps are not @@ -817,30 +816,30 @@ def component_thermal_powers(self): / self.data.fwbs.eta_coolant_pump_electric ) power_variables.p_shld_coolant_pump_elec_mw = ( - heat_transport_variables.p_shld_coolant_pump_mw + self.data.heat_transport.p_shld_coolant_pump_mw / self.data.fwbs.eta_coolant_pump_electric ) power_variables.p_div_coolant_pump_elec_mw = ( - heat_transport_variables.p_div_coolant_pump_mw + self.data.heat_transport.p_div_coolant_pump_mw / self.data.fwbs.eta_coolant_pump_electric ) # Secondary breeder coolant loop. Should return zero if not used. power_variables.p_blkt_breeder_pump_elec_mw = ( - heat_transport_variables.p_blkt_breeder_pump_mw + self.data.heat_transport.p_blkt_breeder_pump_mw / self.data.fwbs.eta_coolant_pump_electric ) # Total mechanical pump power needed (deposited in coolant) power_variables.p_coolant_pump_total_mw = ( self.data.primary_pumping.p_fw_blkt_coolant_pump_mw - + heat_transport_variables.p_blkt_breeder_pump_mw - + heat_transport_variables.p_shld_coolant_pump_mw - + heat_transport_variables.p_div_coolant_pump_mw + + self.data.heat_transport.p_blkt_breeder_pump_mw + + self.data.heat_transport.p_shld_coolant_pump_mw + + self.data.heat_transport.p_div_coolant_pump_mw ) # Minimum total electrical power for primary coolant pumps (MW) - heat_transport_variables.p_coolant_pump_elec_total_mw = ( + self.data.heat_transport.p_coolant_pump_elec_total_mw = ( power_variables.p_fw_blkt_coolant_pump_elec_mw + power_variables.p_blkt_breeder_pump_elec_mw + power_variables.p_shld_coolant_pump_elec_mw @@ -848,14 +847,14 @@ def component_thermal_powers(self): ) # Heat lost through pump power inefficiencies (MW) - heat_transport_variables.p_coolant_pump_loss_total_mw = ( - heat_transport_variables.p_coolant_pump_elec_total_mw + self.data.heat_transport.p_coolant_pump_loss_total_mw = ( + self.data.heat_transport.p_coolant_pump_elec_total_mw - power_variables.p_coolant_pump_total_mw ) # Heat lost in power supplies for heating and current drive - heat_transport_variables.p_hcd_electric_loss_mw = ( - heat_transport_variables.p_hcd_electric_total_mw + self.data.heat_transport.p_hcd_electric_loss_mw = ( + self.data.heat_transport.p_hcd_electric_total_mw - self.data.current_drive.p_hcd_injected_total_mw ) @@ -866,12 +865,12 @@ def component_thermal_powers(self): power_variables.p_blkt_liquid_breeder_heat_deposited_mw = ( self.data.fwbs.p_blkt_nuclear_heat_total_mw * self.data.fwbs.f_nuc_pow_bz_liq - ) + heat_transport_variables.p_blkt_breeder_pump_mw + ) + self.data.heat_transport.p_blkt_breeder_pump_mw # Liquid breeder is circulated but does no cooling elif self.data.fwbs.i_blkt_dual_coolant == 1: power_variables.p_blkt_liquid_breeder_heat_deposited_mw = ( - heat_transport_variables.p_blkt_breeder_pump_mw + self.data.heat_transport.p_blkt_breeder_pump_mw ) # Liquid breeder also acts a coolant @@ -880,7 +879,7 @@ def component_thermal_powers(self): self.data.fwbs.p_fw_nuclear_heat_total_mw + self.data.fwbs.p_fw_rad_total_mw + self.data.fwbs.p_blkt_nuclear_heat_total_mw - + heat_transport_variables.p_blkt_breeder_pump_mw + + self.data.heat_transport.p_blkt_breeder_pump_mw + self.data.primary_pumping.p_fw_blkt_coolant_pump_mw + self.data.current_drive.p_beam_orbit_loss_mw + physics_variables.p_fw_alpha_mw @@ -902,7 +901,7 @@ def component_thermal_powers(self): power_variables.p_fw_heat_deposited_mw = ( self.data.fwbs.p_fw_nuclear_heat_total_mw + self.data.fwbs.p_fw_rad_total_mw - + heat_transport_variables.p_fw_coolant_pump_mw + + self.data.heat_transport.p_fw_coolant_pump_mw + self.data.current_drive.p_beam_orbit_loss_mw + physics_variables.p_fw_alpha_mw + self.data.current_drive.p_beam_shine_through_mw @@ -911,14 +910,14 @@ def component_thermal_powers(self): # Total power deposited in blanket coolant (MW) power_variables.p_blkt_heat_deposited_mw = ( self.data.fwbs.p_blkt_nuclear_heat_total_mw - + heat_transport_variables.p_blkt_coolant_pump_mw + + self.data.heat_transport.p_blkt_coolant_pump_mw ) # Total power deposited in shield coolant (MW) power_variables.p_shld_heat_deposited_mw = ( self.data.fwbs.p_cp_shield_nuclear_heat_mw + self.data.fwbs.p_shld_nuclear_heat_mw - + heat_transport_variables.p_shld_coolant_pump_mw + + self.data.heat_transport.p_shld_coolant_pump_mw ) # Total thermal power deposited in divertor (MW) @@ -928,40 +927,40 @@ def component_thermal_powers(self): self.data.fwbs.p_div_nuclear_heat_total_mw + self.data.fwbs.p_div_rad_total_mw ) - + heat_transport_variables.p_div_coolant_pump_mw + + self.data.heat_transport.p_div_coolant_pump_mw ) # Heat removal from first wall and divertor (MW) (only used in costs.f90) i_p_coolant_pumping = PumpingPowerModelTypes(self.data.fwbs.i_p_coolant_pumping) if i_p_coolant_pumping != PumpingPowerModelTypes.MECHANICAL_WITH_PRESSURE_DROP: - heat_transport_variables.p_fw_div_heat_deposited_mw = ( + self.data.heat_transport.p_fw_div_heat_deposited_mw = ( power_variables.p_fw_heat_deposited_mw + power_variables.p_div_heat_deposited_mw ) # Thermal to electric efficiency - heat_transport_variables.eta_turbine = self.plant_thermal_efficiency( - heat_transport_variables.eta_turbine + self.data.heat_transport.eta_turbine = self.plant_thermal_efficiency( + self.data.heat_transport.eta_turbine ) - heat_transport_variables.etath_liq = self.plant_thermal_efficiency_2( - heat_transport_variables.etath_liq + self.data.heat_transport.etath_liq = self.plant_thermal_efficiency_2( + self.data.heat_transport.etath_liq ) # Primary (high-grade) thermal power, available for electricity generation. - # Switch heat_transport_variables.i_shld_primary_heat is 1 or 0, is user choice + # Switch self.data.heat_transport.i_shld_primary_heat is 1 or 0, is user choice # on whether the shield thermal power goes to primary or secondary heat i_thermal_electric_conversion = ElectricConversionModelTypes( self.data.fwbs.i_thermal_electric_conversion ) if i_thermal_electric_conversion == ElectricConversionModelTypes.CCFE_HCPB_VALUE: # Primary thermal power (MW) - heat_transport_variables.p_plant_primary_heat_mw = ( + self.data.heat_transport.p_plant_primary_heat_mw = ( power_variables.p_fw_blkt_heat_deposited_mw - + heat_transport_variables.i_shld_primary_heat + + self.data.heat_transport.i_shld_primary_heat * power_variables.p_shld_heat_deposited_mw ) # Secondary thermal power deposited in divertor (MW) - heat_transport_variables.p_div_secondary_heat_mw = ( + self.data.heat_transport.p_div_secondary_heat_mw = ( power_variables.p_div_heat_deposited_mw ) # Divertor primary/secondary power switch: does NOT contribute to @@ -969,25 +968,25 @@ def component_thermal_powers(self): power_variables.i_div_primary_heat = 0 else: # Primary thermal power used to generate electricity (MW) - heat_transport_variables.p_plant_primary_heat_mw = ( + self.data.heat_transport.p_plant_primary_heat_mw = ( power_variables.p_fw_blkt_heat_deposited_mw - + heat_transport_variables.i_shld_primary_heat + + self.data.heat_transport.i_shld_primary_heat * power_variables.p_shld_heat_deposited_mw + power_variables.p_div_heat_deposited_mw ) # Secondary thermal power deposited in divertor (MW) - heat_transport_variables.p_div_secondary_heat_mw = 0.0e0 + self.data.heat_transport.p_div_secondary_heat_mw = 0.0e0 # Divertor primary/secondary power switch: contributes to energy # generation cycle power_variables.i_div_primary_heat = 1 - if abs(heat_transport_variables.p_plant_primary_heat_mw) < 1.0e-4: + if abs(self.data.heat_transport.p_plant_primary_heat_mw) < 1.0e-4: logger.error(f"{'ERROR Primary thermal power is zero or negative'}") # #284 Fraction of total high-grade thermal power to divertor power_variables.f_p_div_primary_heat = ( power_variables.p_div_heat_deposited_mw - / heat_transport_variables.p_plant_primary_heat_mw + / self.data.heat_transport.p_plant_primary_heat_mw ) # Loss in efficiency as this primary power is collecetd at very low temperature power_variables.delta_eta = 0.339 * power_variables.f_p_div_primary_heat @@ -997,20 +996,20 @@ def component_thermal_powers(self): # ================================================ # Secondary thermal power deposited in shield - heat_transport_variables.p_shld_secondary_heat_mw = ( + self.data.heat_transport.p_shld_secondary_heat_mw = ( power_variables.p_shld_heat_deposited_mw - * (1 - heat_transport_variables.i_shld_primary_heat) + * (1 - self.data.heat_transport.i_shld_primary_heat) ) # Secondary thermal power lost to HCD apparatus and diagnostics - heat_transport_variables.p_hcd_secondary_heat_mw = ( + self.data.heat_transport.p_hcd_secondary_heat_mw = ( self.data.fwbs.p_fw_hcd_nuclear_heat_mw + self.data.fwbs.p_fw_hcd_rad_total_mw ) # Number of primary heat exchangers - heat_transport_variables.n_primary_heat_exchangers = math.ceil( - heat_transport_variables.p_plant_primary_heat_mw / 1000.0e0 + self.data.heat_transport.n_primary_heat_exchangers = math.ceil( + self.data.heat_transport.p_plant_primary_heat_mw / 1000.0e0 ) def calculate_cryo_loads(self): @@ -1025,15 +1024,15 @@ def calculate_cryo_loads(self): # Cryogenic power # --- # Initialisation (unchanged if all coil resisitive) - heat_transport_variables.helpow = 0.0e0 - heat_transport_variables.p_cryo_plant_electric_mw = 0.0e0 + self.data.heat_transport.helpow = 0.0e0 + self.data.heat_transport.p_cryo_plant_electric_mw = 0.0e0 p_tf_cryoal_cryo = 0.0e0 tfcoil_variables.cryo_cool_req = 0.0e0 # Superconductors TF/PF cryogenic cooling if tfcoil_variables.i_tf_sup == 1 or pfcoil_variables.i_pf_conductor == 0: - # heat_transport_variables.helpow calculation - heat_transport_variables.helpow = self.cryo( + # self.data.heat_transport.helpow calculation + self.data.heat_transport.helpow = self.cryo( tfcoil_variables.i_tf_sup, tfcoil_variables.tfcryoarea, self.data.structure.coldmass, @@ -1049,11 +1048,11 @@ def calculate_cryo_loads(self): # any reasons why? # Calculate electric power requirement for cryogenic plant at # tfcoil_variables.temp_tf_cryo (MW) - heat_transport_variables.p_cryo_plant_electric_mw = ( + self.data.heat_transport.p_cryo_plant_electric_mw = ( 1.0e-6 * (constants.TEMP_ROOM - tfcoil_variables.temp_tf_cryo) / (tfcoil_variables.eff_tf_cryo * tfcoil_variables.temp_tf_cryo) - * heat_transport_variables.helpow + * self.data.heat_transport.helpow ) # Cryogenic alumimium @@ -1064,7 +1063,7 @@ def calculate_cryo_loads(self): if tfcoil_variables.i_tf_sup == 2: # Heat removal power at cryogenic temperature # tfcoil_variables.temp_cp_coolant_inlet (W) - heat_transport_variables.helpow_cryal = ( + self.data.heat_transport.helpow_cryal = ( tfcoil_variables.p_cp_resistive + tfcoil_variables.p_tf_leg_resistive + tfcoil_variables.p_tf_joints_resistive @@ -1077,18 +1076,18 @@ def calculate_cryo_loads(self): 1.0e-6 * (constants.TEMP_ROOM - tfcoil_variables.temp_cp_coolant_inlet) / (tfcoil_variables.eff_tf_cryo * tfcoil_variables.temp_cp_coolant_inlet) - * heat_transport_variables.helpow_cryal + * self.data.heat_transport.helpow_cryal ) # Add to electric power requirement for cryogenic plant (MW) - heat_transport_variables.p_cryo_plant_electric_mw += p_tf_cryoal_cryo + self.data.heat_transport.p_cryo_plant_electric_mw += p_tf_cryoal_cryo # Calculate cryo cooling requirement at 4.5K (kW) tfcoil_variables.cryo_cool_req = ( - heat_transport_variables.helpow + self.data.heat_transport.helpow * ((293 / tfcoil_variables.temp_tf_cryo) - 1) / ((293 / 4.5) - 1) - + heat_transport_variables.helpow_cryal + + self.data.heat_transport.helpow_cryal * ((293 / tfcoil_variables.temp_cp_coolant_inlet) - 1) / ((293 / 4.5) - 1) ) / 1.0e3 @@ -1134,7 +1133,7 @@ def output_plant_thermal_powers(self): self.outfile, "Mechancial pumping power deposited in FW coolant [MW]", "(p_fw_coolant_pump_mw)", - heat_transport_variables.p_fw_coolant_pump_mw, + self.data.heat_transport.p_fw_coolant_pump_mw, ) po.oblnkl(self.outfile) po.ovarre( @@ -1170,7 +1169,7 @@ def output_plant_thermal_powers(self): self.outfile, "Mechancial pumping power deposited in Blanket(s) coolant [MW]", "(p_blkt_coolant_pump_mw)", - heat_transport_variables.p_blkt_coolant_pump_mw, + self.data.heat_transport.p_blkt_coolant_pump_mw, ) po.oblnkl(self.outfile) @@ -1220,7 +1219,7 @@ def output_plant_thermal_powers(self): self.outfile, "Mechancial pumping power deposited in shield coolant(s) [MW]", "(p_shld_coolant_pump_mw)", - heat_transport_variables.p_shld_coolant_pump_mw, + self.data.heat_transport.p_shld_coolant_pump_mw, ) po.oblnkl(self.outfile) @@ -1259,7 +1258,7 @@ def output_plant_thermal_powers(self): self.outfile, "Mechancial pumping power deposited in divertor coolant [MW]", "(p_div_coolant_pump_mw)", - heat_transport_variables.p_div_coolant_pump_mw, + self.data.heat_transport.p_div_coolant_pump_mw, ) po.oblnkl(self.outfile) @@ -1297,25 +1296,25 @@ def output_plant_thermal_powers(self): self.outfile, "Wall plug losses in H&CD systems [MW]", "(p_hcd_electric_loss_mw)", - heat_transport_variables.p_hcd_electric_loss_mw, + self.data.heat_transport.p_hcd_electric_loss_mw, ) po.ovarre( self.outfile, "Total wall plug losses in coolant pump systems [MW]", "(p_coolant_pump_loss_total_mw)", - heat_transport_variables.p_coolant_pump_loss_total_mw, + self.data.heat_transport.p_coolant_pump_loss_total_mw, ) po.ovarre( self.outfile, "Divertor thermal power not used for electricity production [MW]", "(p_div_secondary_heat_mw)", - heat_transport_variables.p_div_secondary_heat_mw, + self.data.heat_transport.p_div_secondary_heat_mw, ) po.ovarre( self.outfile, "Shield thermal power not used for electricity production [MW]", "(p_shld_secondary_heat_mw)", - heat_transport_variables.p_shld_secondary_heat_mw, + self.data.heat_transport.p_shld_secondary_heat_mw, ) po.ovarre( self.outfile, @@ -1340,14 +1339,14 @@ def output_plant_thermal_powers(self): self.outfile, "Total heat deposited in in H&CD systems and diagnostics [MW]", "(p_hcd_secondary_heat_mw)", - heat_transport_variables.p_hcd_secondary_heat_mw, + self.data.heat_transport.p_hcd_secondary_heat_mw, ) po.oblnkl(self.outfile) po.ovarre( self.outfile, "Total secondary heat not used for electricity production [MW]", "(p_plant_secondary_heat_mw)", - heat_transport_variables.p_plant_secondary_heat_mw, + self.data.heat_transport.p_plant_secondary_heat_mw, ) po.oblnkl(self.outfile) @@ -1400,7 +1399,7 @@ def output_plant_thermal_powers(self): self.outfile, "Total primary thermal power used for electricity production [MW]", "(p_plant_primary_heat_mw)", - heat_transport_variables.p_plant_primary_heat_mw, + self.data.heat_transport.p_plant_primary_heat_mw, ) def output_plant_electric_powers(self): @@ -1414,14 +1413,14 @@ def output_plant_electric_powers(self): self.outfile, "Total high grade thermal power used for electricity production [MWth]", "(p_plant_primary_heat_mw)", - heat_transport_variables.p_plant_primary_heat_mw, + self.data.heat_transport.p_plant_primary_heat_mw, ) po.ovarrf( self.outfile, "Thermal to electric conversion efficiency of the turbine", "(eta_turbine)", - heat_transport_variables.eta_turbine, + self.data.heat_transport.eta_turbine, ) po.ovarre( self.outfile, @@ -1434,7 +1433,7 @@ def output_plant_electric_powers(self): self.outfile, "Total electric power produced [MWe]", "(p_plant_electric_gross_mw)", - heat_transport_variables.p_plant_electric_gross_mw, + self.data.heat_transport.p_plant_electric_gross_mw, ) po.oblnkl(self.outfile) po.ocmmnt(self.outfile, "----------------------------") @@ -1447,13 +1446,13 @@ def output_plant_electric_powers(self): self.outfile, "Base plant electric load [We]", "(p_plant_electric_base)", - heat_transport_variables.p_plant_electric_base, + self.data.heat_transport.p_plant_electric_base, ) po.ovarre( self.outfile, "Electric power per unit area of plant floor space [We/m^2]", "(pflux_plant_floor_electric)", - heat_transport_variables.pflux_plant_floor_electric, + self.data.heat_transport.pflux_plant_floor_electric, ) po.ovarre( self.outfile, @@ -1466,32 +1465,32 @@ def output_plant_electric_powers(self): self.outfile, "Total base plant electric load [MWe]", "(p_plant_electric_base_total_mw)", - heat_transport_variables.p_plant_electric_base_total_mw, + self.data.heat_transport.p_plant_electric_base_total_mw, ) po.oblnkl(self.outfile) po.ovarre( self.outfile, "Electric power demand for cryo plant [MWe]", "(p_cryo_plant_electric_mw)", - heat_transport_variables.p_cryo_plant_electric_mw, + self.data.heat_transport.p_cryo_plant_electric_mw, ) po.ovarre( self.outfile, "Electric power demand for tritium plant [MWe]", "(p_tritium_plant_electric_mw)", - heat_transport_variables.p_tritium_plant_electric_mw, + self.data.heat_transport.p_tritium_plant_electric_mw, ) po.ovarre( self.outfile, "Electric power demand for vacuum pumps [MWe]", "(vachtmw)", - heat_transport_variables.vachtmw, + self.data.heat_transport.vachtmw, ) po.ovarre( self.outfile, "Electric power demand for TF coil system [MWe]", "(p_tf_electric_supplies_mw)", - heat_transport_variables.p_tf_electric_supplies_mw, + self.data.heat_transport.p_tf_electric_supplies_mw, ) po.ovarre( self.outfile, @@ -1555,14 +1554,14 @@ def output_plant_electric_powers(self): self.outfile, "Total electric demand of all coolant pumps [MWe]", "(p_coolant_pump_elec_total_mw)", - heat_transport_variables.p_coolant_pump_elec_total_mw, + self.data.heat_transport.p_coolant_pump_elec_total_mw, ) po.oblnkl(self.outfile) po.ovarre( self.outfile, "Total electric demand of all H&CD systems [MWe]", "(p_hcd_electric_total_mw)", - heat_transport_variables.p_hcd_electric_total_mw, + self.data.heat_transport.p_hcd_electric_total_mw, ) po.oblnkl(self.outfile) @@ -1571,13 +1570,13 @@ def output_plant_electric_powers(self): self.outfile, "Total re-circulated electric power of the plant [MWe]", "(p_plant_electric_recirc_mw)", - heat_transport_variables.p_plant_electric_recirc_mw, + self.data.heat_transport.p_plant_electric_recirc_mw, ) po.ovarre( self.outfile, "Fraction of gross electricity re-circulated", "(f_p_plant_electric_recirc)", - heat_transport_variables.f_p_plant_electric_recirc, + self.data.heat_transport.f_p_plant_electric_recirc, ) po.oblnkl(self.outfile) @@ -1586,7 +1585,7 @@ def output_plant_electric_powers(self): self.outfile, "Total net-electric power of the plant [MWe]", "(p_plant_electric_net_mw)", - heat_transport_variables.p_plant_electric_net_mw, + self.data.heat_transport.p_plant_electric_net_mw, ) po.oblnkl(self.outfile) @@ -1621,42 +1620,42 @@ def plant_electric_production(self): power_variables.p_cp_coolant_pump_elec_mw = 0.0e0 # Total baseline power to facility loads, MW - heat_transport_variables.p_plant_electric_base_total_mw = ( - heat_transport_variables.p_plant_electric_base * 1.0e-6 + self.data.heat_transport.p_plant_electric_base_total_mw = ( + self.data.heat_transport.p_plant_electric_base * 1.0e-6 + self.data.buildings.a_plant_floor_effective - * (heat_transport_variables.pflux_plant_floor_electric * 1.0e-3) + * (self.data.heat_transport.pflux_plant_floor_electric * 1.0e-3) / 1000.0e0 ) # Facility heat removal - # (heat_transport_variables.p_plant_electric_base_total_mw calculated in ACPOW) - heat_transport_variables.fachtmw = ( - heat_transport_variables.p_plant_electric_base_total_mw + # (self.data.heat_transport.p_plant_electric_base_total_mw calculated in ACPOW) + self.data.heat_transport.fachtmw = ( + self.data.heat_transport.p_plant_electric_base_total_mw ) # Electrical power consumed by fusion power core systems # (excluding heat transport pumps and auxiliary injection power system) power_variables.p_plant_core_systems_elec_mw = ( - heat_transport_variables.p_cryo_plant_electric_mw - + heat_transport_variables.fachtmw + self.data.heat_transport.p_cryo_plant_electric_mw + + self.data.heat_transport.fachtmw + power_variables.p_cp_coolant_pump_elec_mw - + heat_transport_variables.p_tf_electric_supplies_mw - + heat_transport_variables.p_tritium_plant_electric_mw - + heat_transport_variables.vachtmw + + self.data.heat_transport.p_tf_electric_supplies_mw + + self.data.heat_transport.p_tritium_plant_electric_mw + + self.data.heat_transport.vachtmw + pfcoil_variables.p_pf_electric_supplies_mw ) # Total secondary heat not used for electricity production, but which # contributes to the plant heat load and must be removed # by the cooling system (MW) - heat_transport_variables.p_plant_secondary_heat_mw = ( + self.data.heat_transport.p_plant_secondary_heat_mw = ( power_variables.p_plant_core_systems_elec_mw - + heat_transport_variables.p_hcd_electric_loss_mw - + heat_transport_variables.p_coolant_pump_loss_total_mw - + heat_transport_variables.p_div_secondary_heat_mw - + heat_transport_variables.p_shld_secondary_heat_mw - + heat_transport_variables.p_hcd_secondary_heat_mw + + self.data.heat_transport.p_hcd_electric_loss_mw + + self.data.heat_transport.p_coolant_pump_loss_total_mw + + self.data.heat_transport.p_div_secondary_heat_mw + + self.data.heat_transport.p_shld_secondary_heat_mw + + self.data.heat_transport.p_hcd_secondary_heat_mw + self.data.fwbs.p_tf_nuclear_heat_mw ) @@ -1670,45 +1669,45 @@ def plant_electric_production(self): self.data.fwbs.i_blkt_dual_coolant > 0 and i_p_coolant_pumping == PumpingPowerModelTypes.MECHANICAL ): - heat_transport_variables.p_plant_electric_gross_mw = ( + self.data.heat_transport.p_plant_electric_gross_mw = ( ( - heat_transport_variables.p_plant_primary_heat_mw + self.data.heat_transport.p_plant_primary_heat_mw - power_variables.p_blkt_liquid_breeder_heat_deposited_mw ) - * heat_transport_variables.eta_turbine + * self.data.heat_transport.eta_turbine + power_variables.p_blkt_liquid_breeder_heat_deposited_mw - * heat_transport_variables.etath_liq + * self.data.heat_transport.etath_liq ) else: - heat_transport_variables.p_plant_electric_gross_mw = ( - heat_transport_variables.p_plant_primary_heat_mw - * heat_transport_variables.eta_turbine + self.data.heat_transport.p_plant_electric_gross_mw = ( + self.data.heat_transport.p_plant_primary_heat_mw + * self.data.heat_transport.eta_turbine ) # Total lost thermal power in the turbine power_variables.p_turbine_loss_mw = ( - heat_transport_variables.p_plant_primary_heat_mw - * (1 - heat_transport_variables.eta_turbine) + self.data.heat_transport.p_plant_primary_heat_mw + * (1 - self.data.heat_transport.eta_turbine) ) # Total recirculating power - heat_transport_variables.p_plant_electric_recirc_mw = ( + self.data.heat_transport.p_plant_electric_recirc_mw = ( power_variables.p_plant_core_systems_elec_mw - + heat_transport_variables.p_hcd_electric_total_mw - + heat_transport_variables.p_coolant_pump_elec_total_mw + + self.data.heat_transport.p_hcd_electric_total_mw + + self.data.heat_transport.p_coolant_pump_elec_total_mw ) # Net electric power - heat_transport_variables.p_plant_electric_net_mw = ( - heat_transport_variables.p_plant_electric_gross_mw - - heat_transport_variables.p_plant_electric_recirc_mw + self.data.heat_transport.p_plant_electric_net_mw = ( + self.data.heat_transport.p_plant_electric_gross_mw + - self.data.heat_transport.p_plant_electric_recirc_mw ) # Recirculating power fraction - heat_transport_variables.f_p_plant_electric_recirc = ( - heat_transport_variables.p_plant_electric_gross_mw - - heat_transport_variables.p_plant_electric_net_mw - ) / heat_transport_variables.p_plant_electric_gross_mw + self.data.heat_transport.f_p_plant_electric_recirc = ( + self.data.heat_transport.p_plant_electric_gross_mw + - self.data.heat_transport.p_plant_electric_net_mw + ) / self.data.heat_transport.p_plant_electric_gross_mw ( power_variables.e_plant_net_electric_pulse_kwh, @@ -1731,17 +1730,17 @@ def plant_electric_production(self): t_burn=self.data.times.t_plant_pulse_burn, t_ramp_down=self.data.times.t_plant_pulse_plasma_current_ramp_down, t_between_pulse=self.data.times.t_plant_pulse_dwell, - p_plant_electric_base_total_mw=heat_transport_variables.p_plant_electric_base_total_mw, - p_cryo_plant_electric_mw=heat_transport_variables.p_cryo_plant_electric_mw, - p_tritium_plant_electric_mw=heat_transport_variables.p_tritium_plant_electric_mw, - vachtmw=heat_transport_variables.vachtmw, - p_tf_electric_supplies_mw=heat_transport_variables.p_tf_electric_supplies_mw, + p_plant_electric_base_total_mw=self.data.heat_transport.p_plant_electric_base_total_mw, + p_cryo_plant_electric_mw=self.data.heat_transport.p_cryo_plant_electric_mw, + p_tritium_plant_electric_mw=self.data.heat_transport.p_tritium_plant_electric_mw, + vachtmw=self.data.heat_transport.vachtmw, + p_tf_electric_supplies_mw=self.data.heat_transport.p_tf_electric_supplies_mw, p_pf_electric_supplies_mw=pfcoil_variables.p_pf_electric_supplies_mw, - p_coolant_pump_elec_total_mw=heat_transport_variables.p_coolant_pump_elec_total_mw, - p_hcd_electric_total_mw=heat_transport_variables.p_hcd_electric_total_mw, + p_coolant_pump_elec_total_mw=self.data.heat_transport.p_coolant_pump_elec_total_mw, + p_hcd_electric_total_mw=self.data.heat_transport.p_hcd_electric_total_mw, p_fusion_total_mw=physics_variables.p_fusion_total_mw, - p_plant_electric_gross_mw=heat_transport_variables.p_plant_electric_gross_mw, - p_plant_electric_net_mw=heat_transport_variables.p_plant_electric_net_mw, + p_plant_electric_gross_mw=self.data.heat_transport.p_plant_electric_gross_mw, + p_plant_electric_net_mw=self.data.heat_transport.p_plant_electric_net_mw, ) def cryo( @@ -1882,7 +1881,7 @@ def output_cryogenics(self): "Sum = Total heat removal at cryogenic temperatures " "(temp_tf_cryo & temp_cp_coolant_inlet) (MW)", "(helpow + helpow_cryal/1.0d6)", - (heat_transport_variables.helpow + heat_transport_variables.helpow_cryal) + (self.data.heat_transport.helpow + self.data.heat_transport.helpow_cryal) * 1.0e-6, "OP ", ) @@ -1902,7 +1901,7 @@ def output_cryogenics(self): self.outfile, "Electric power for cryogenic plant (MW)", "(p_cryo_plant_electric_mw)", - heat_transport_variables.p_cryo_plant_electric_mw, + self.data.heat_transport.p_cryo_plant_electric_mw, "OP ", ) @@ -1983,21 +1982,21 @@ def plant_thermal_efficiency(self, eta_turbine: float) -> float: # Superheated steam Rankine cycle correlation (C. Harrington) # Range of validity: 657 K - # < heat_transport_variables.temp_turbine_coolant_in < 915 K - heat_transport_variables.temp_turbine_coolant_in = ( + # < self.data.heat_transport.temp_turbine_coolant_in < 915 K + self.data.heat_transport.temp_turbine_coolant_in = ( self.data.fwbs.temp_blkt_coolant_out - 20.0e0 ) - if (heat_transport_variables.temp_turbine_coolant_in < 657.0e0) or ( - heat_transport_variables.temp_turbine_coolant_in > 915.0e0 + if (self.data.heat_transport.temp_turbine_coolant_in < 657.0e0) or ( + self.data.heat_transport.temp_turbine_coolant_in > 915.0e0 ): logger.warning( "Turbine temperature temp_turbine_coolant_in out of range " f"of validity: " - f"{heat_transport_variables.temp_turbine_coolant_in=}" + f"{self.data.heat_transport.temp_turbine_coolant_in=}" ) eta_turbine = ( - 0.1802e0 * np.log(heat_transport_variables.temp_turbine_coolant_in) + 0.1802e0 * np.log(self.data.heat_transport.temp_turbine_coolant_in) - 0.7823 - power_variables.delta_eta ) @@ -2019,20 +2018,20 @@ def plant_thermal_efficiency(self, eta_turbine: float) -> float: # Supercritical CO2 cycle correlation (C. Harrington) # Range of validity: 408 K - # < heat_transport_variables.temp_turbine_coolant_in < 1023 K - heat_transport_variables.temp_turbine_coolant_in = ( + # < self.data.heat_transport.temp_turbine_coolant_in < 1023 K + self.data.heat_transport.temp_turbine_coolant_in = ( self.data.fwbs.temp_blkt_coolant_out - 20.0e0 ) - if (heat_transport_variables.temp_turbine_coolant_in < 408.0e0) or ( - heat_transport_variables.temp_turbine_coolant_in > 1023.0e0 + if (self.data.heat_transport.temp_turbine_coolant_in < 408.0e0) or ( + self.data.heat_transport.temp_turbine_coolant_in > 1023.0e0 ): logger.warning( "Turbine temperature temp_turbine_coolant_in out of range " - f"of validity: {heat_transport_variables.temp_turbine_coolant_in=}" + f"of validity: {self.data.heat_transport.temp_turbine_coolant_in=}" ) eta_turbine = ( - 0.4347e0 * np.log(heat_transport_variables.temp_turbine_coolant_in) + 0.4347e0 * np.log(self.data.heat_transport.temp_turbine_coolant_in) - 2.5043e0 ) @@ -2065,20 +2064,20 @@ def plant_thermal_efficiency_2(self, etath_liq: float) -> float: # Supercritical CO2 cycle to be used # Supercritical CO2 cycle correlation (C. Harrington) # Range of validity: 408 K - # < heat_transport_variables.temp_turbine_coolant_in < 1023 K - heat_transport_variables.temp_turbine_coolant_in = ( + # < self.data.heat_transport.temp_turbine_coolant_in < 1023 K + self.data.heat_transport.temp_turbine_coolant_in = ( self.data.fwbs.outlet_temp_liq - 20.0e0 ) - if (heat_transport_variables.temp_turbine_coolant_in < 408.0e0) or ( - heat_transport_variables.temp_turbine_coolant_in > 1023.0e0 + if (self.data.heat_transport.temp_turbine_coolant_in < 408.0e0) or ( + self.data.heat_transport.temp_turbine_coolant_in > 1023.0e0 ): logger.warning( "Turbine temperature temp_turbine_coolant_in out of range of " - f"validity: {heat_transport_variables.temp_turbine_coolant_in=}" + f"validity: {self.data.heat_transport.temp_turbine_coolant_in=}" ) return ( - 0.4347e0 * np.log(heat_transport_variables.temp_turbine_coolant_in) + 0.4347e0 * np.log(self.data.heat_transport.temp_turbine_coolant_in) - 2.5043e0 ) @@ -2171,8 +2170,8 @@ def tfpwr(self, output: bool): ) # Total steady state AC power demand (MW) - heat_transport_variables.p_tf_electric_supplies_mw = ( - tfcoil_variables.tfcmw / heat_transport_variables.etatf + self.data.heat_transport.p_tf_electric_supplies_mw = ( + tfcoil_variables.tfcmw / self.data.heat_transport.etatf ) else: # Superconducting TF coil option @@ -2291,7 +2290,7 @@ def tfpwcall(self, output: bool): tfcoil_variables.len_tf_bus, tfcoil_variables.drarea, self.data.buildings.tfcbv, - heat_transport_variables.p_tf_electric_supplies_mw, + self.data.heat_transport.p_tf_electric_supplies_mw, ) = self.tfcpwr( output, itfka, @@ -2456,7 +2455,7 @@ def tfcpwr( xpwrmw = xpower / 0.9e0 # Total steady state AC power demand, MW - p_tf_electric_supplies_mw += rpower / heat_transport_variables.etatf + p_tf_electric_supplies_mw += rpower / self.data.heat_transport.etatf # Total TF coil power conversion building floor area, m2 # tftsp = tfcfsp diff --git a/process/models/stellarator/build.py b/process/models/stellarator/build.py index 0c5f8de0e..3a8bfd81d 100644 --- a/process/models/stellarator/build.py +++ b/process/models/stellarator/build.py @@ -1,7 +1,6 @@ from process.core import process_output as po from process.core.model import DataStructure from process.data_structure import ( - heat_transport_variables, physics_variables, stellarator_configuration, ) @@ -171,7 +170,7 @@ def st_build(stellarator, f_output: bool, data: DataStructure): physics_variables.a_plasma_surface * awall / physics_variables.rminor ) - if heat_transport_variables.ipowerflow == 0: + if data.heat_transport.ipowerflow == 0: data.first_wall.a_fw_total = ( 1.0e0 - data.fwbs.fhole ) * data.first_wall.a_fw_total diff --git a/process/models/stellarator/heating.py b/process/models/stellarator/heating.py index 2f181264b..c19a9b0eb 100644 --- a/process/models/stellarator/heating.py +++ b/process/models/stellarator/heating.py @@ -4,7 +4,6 @@ from process.core.exceptions import ProcessValueError from process.core.model import DataStructure from process.data_structure import ( - heat_transport_variables, physics_variables, stellarator_variables, ) @@ -57,7 +56,7 @@ def st_heat(stellarator, f_output: bool, data: DataStructure): data.current_drive.eta_hcd_primary_injector_wall_plug = ( data.current_drive.eta_lowhyb_injector_wall_plug ) - heat_transport_variables.p_hcd_electric_total_mw = ( + data.heat_transport.p_hcd_electric_total_mw = ( data.current_drive.p_hcd_injected_ions_mw + data.current_drive.p_hcd_injected_electrons_mw ) / data.current_drive.eta_hcd_primary_injector_wall_plug diff --git a/process/models/stellarator/stellarator.py b/process/models/stellarator/stellarator.py index d99f5c9d4..87b7f72d1 100644 --- a/process/models/stellarator/stellarator.py +++ b/process/models/stellarator/stellarator.py @@ -16,7 +16,6 @@ from process.data_structure import ( divertor_variables, global_variables, - heat_transport_variables, numerics, physics_variables, stellarator_configuration, @@ -517,7 +516,7 @@ def st_fwbs(self, output: bool): + self.data.build.dr_fw_plasma_gap_outboard + self.data.build.dr_fw_outboard ) - if heat_transport_variables.ipowerflow == 0: + if self.data.heat_transport.ipowerflow == 0: self.data.build.a_blkt_total_surface = ( physics_variables.a_plasma_surface * r1 @@ -594,7 +593,7 @@ def st_fwbs(self, output: bool): if self.data.fwbs.blktmodel == 1: self.blanket_neutronics() - if heat_transport_variables.ipowerflow == 1: + if self.data.heat_transport.ipowerflow == 1: self.data.fwbs.p_div_nuclear_heat_total_mw = ( physics_variables.p_neutron_total_mw * self.data.fwbs.f_ster_div_single @@ -627,24 +626,24 @@ def st_fwbs(self, output: bool): - self.data.fwbs.p_fw_hcd_rad_total_mw ) - heat_transport_variables.p_fw_coolant_pump_mw = ( - heat_transport_variables.f_p_fw_coolant_pump_total_heat + self.data.heat_transport.p_fw_coolant_pump_mw = ( + self.data.heat_transport.f_p_fw_coolant_pump_total_heat * ( self.data.fwbs.p_fw_nuclear_heat_total_mw + self.data.fwbs.p_fw_rad_total_mw + self.data.current_drive.p_beam_orbit_loss_mw ) ) - heat_transport_variables.p_blkt_coolant_pump_mw = ( - heat_transport_variables.f_p_blkt_coolant_pump_total_heat + self.data.heat_transport.p_blkt_coolant_pump_mw = ( + self.data.heat_transport.f_p_blkt_coolant_pump_total_heat * self.data.fwbs.p_blkt_nuclear_heat_total_mw ) - heat_transport_variables.p_shld_coolant_pump_mw = ( - heat_transport_variables.f_p_shld_coolant_pump_total_heat + self.data.heat_transport.p_shld_coolant_pump_mw = ( + self.data.heat_transport.f_p_shld_coolant_pump_total_heat * self.data.fwbs.p_shld_nuclear_heat_mw ) - heat_transport_variables.p_div_coolant_pump_mw = ( - heat_transport_variables.f_p_div_coolant_pump_total_heat + self.data.heat_transport.p_div_coolant_pump_mw = ( + self.data.heat_transport.f_p_div_coolant_pump_total_heat * ( physics_variables.p_plasma_separatrix_mw + self.data.fwbs.p_div_nuclear_heat_total_mw @@ -666,7 +665,7 @@ def st_fwbs(self, output: bool): else: self.data.fwbs.pnuc_cp = 0.0e0 - if heat_transport_variables.ipowerflow == 0: + if self.data.heat_transport.ipowerflow == 0: # Energy-multiplied neutron power pneut2 = ( @@ -713,7 +712,7 @@ def st_fwbs(self, output: bool): self.data.fwbs.p_tf_nuclear_heat_mw, ) = self.sc_tf_coil_nuclear_heating_iter90() - else: # heat_transport_variables.ipowerflow == 1 + else: # self.data.heat_transport.ipowerflow == 1 # Neutron power incident on divertor (MW) self.data.fwbs.p_div_nuclear_heat_total_mw = ( @@ -889,8 +888,8 @@ def st_fwbs(self, output: bool): # Use input pass elif i_p_coolant_pumping == PumpingPowerModelTypes.FRACTION_OF_HEAT: - heat_transport_variables.p_fw_coolant_pump_mw = ( - heat_transport_variables.f_p_fw_coolant_pump_total_heat + self.data.heat_transport.p_fw_coolant_pump_mw = ( + self.data.heat_transport.f_p_fw_coolant_pump_total_heat * ( p_fw_inboard_nuclear_heat_mw + p_fw_outboard_nuclear_heat_mw @@ -899,8 +898,8 @@ def st_fwbs(self, output: bool): + self.data.current_drive.p_beam_orbit_loss_mw ) ) - heat_transport_variables.p_blkt_coolant_pump_mw = ( - heat_transport_variables.f_p_blkt_coolant_pump_total_heat + self.data.heat_transport.p_blkt_coolant_pump_mw = ( + self.data.heat_transport.f_p_blkt_coolant_pump_total_heat * ( pnucbzi * self.data.fwbs.f_p_blkt_multiplication + pnucbzo * self.data.fwbs.f_p_blkt_multiplication @@ -912,7 +911,7 @@ def st_fwbs(self, output: bool): ) self.data.fwbs.p_blkt_multiplication_mw = ( - heat_transport_variables.f_p_blkt_coolant_pump_total_heat + self.data.heat_transport.f_p_blkt_coolant_pump_total_heat * (pnucbzi * self.data.fwbs.f_p_blkt_multiplication + pnucbzo) * (self.data.fwbs.f_p_blkt_multiplication - 1.0e0) ) @@ -981,14 +980,14 @@ def st_fwbs(self, output: bool): if i_p_coolant_pumping == PumpingPowerModelTypes.FRACTION_OF_HEAT: # Shield pumping power (MW) - heat_transport_variables.p_shld_coolant_pump_mw = ( - heat_transport_variables.f_p_shld_coolant_pump_total_heat + self.data.heat_transport.p_shld_coolant_pump_mw = ( + self.data.heat_transport.f_p_shld_coolant_pump_total_heat * (pnucshldi + pnucshldo) ) # Divertor pumping power (MW) - heat_transport_variables.p_div_coolant_pump_mw = ( - heat_transport_variables.f_p_div_coolant_pump_total_heat + self.data.heat_transport.p_div_coolant_pump_mw = ( + self.data.heat_transport.f_p_div_coolant_pump_total_heat * ( physics_variables.p_plasma_separatrix_mw + self.data.fwbs.p_div_nuclear_heat_total_mw @@ -1186,7 +1185,7 @@ def st_fwbs(self, output: bool): self.data.fwbs.wpenshld = self.data.fwbs.whtshld - if heat_transport_variables.ipowerflow == 0: + if self.data.heat_transport.ipowerflow == 0: # First wall mass # (first wall area is calculated else:where) @@ -1412,7 +1411,7 @@ def st_fwbs(self, output: bool): self.data.build.dz_blkt_upper, ) - if (heat_transport_variables.ipowerflow == 0) and ( + if (self.data.heat_transport.ipowerflow == 0) and ( self.data.fwbs.blktmodel == 0 ): po.osubhd(self.outfile, "Coil nuclear parameters :") @@ -1617,7 +1616,7 @@ def st_fwbs(self, output: bool): self.data.fwbs.t_bl_y, ) - if (heat_transport_variables.ipowerflow == 1) and ( + if (self.data.heat_transport.ipowerflow == 1) and ( self.data.fwbs.blktmodel == 0 ): po.oblnkl(self.outfile) @@ -2116,7 +2115,7 @@ def st_phys(self, output): * physics_variables.p_neutron_total_mw / physics_variables.a_plasma_surface ) - elif heat_transport_variables.ipowerflow == 0: + elif self.data.heat_transport.ipowerflow == 0: physics_variables.pflux_fw_neutron_mw = ( (1.0e0 - self.data.fwbs.fhole) * physics_variables.p_neutron_total_mw @@ -2237,7 +2236,7 @@ def st_phys(self, output): * physics_variables.p_plasma_rad_mw / physics_variables.a_plasma_surface ) - elif heat_transport_variables.ipowerflow == 0: + elif self.data.heat_transport.ipowerflow == 0: physics_variables.pflux_fw_rad_mw = ( (1.0e0 - self.data.fwbs.fhole) * physics_variables.p_plasma_rad_mw diff --git a/process/models/water_use.py b/process/models/water_use.py index 991296c1c..cd20df58a 100644 --- a/process/models/water_use.py +++ b/process/models/water_use.py @@ -5,7 +5,6 @@ from process.core import constants from process.core import process_output as po from process.core.model import Model -from process.data_structure import heat_transport_variables SECDAY = 86400e0 @@ -42,8 +41,8 @@ def run(self, output: bool = False): output : indicate whether output should be written to the output file, or not """ - rejected_heat = heat_transport_variables.p_plant_primary_heat_mw * ( - 1 - heat_transport_variables.eta_turbine + rejected_heat = self.data.heat_transport.p_plant_primary_heat_mw * ( + 1 - self.data.heat_transport.eta_turbine ) wastethermeng = rejected_heat * SECDAY diff --git a/tests/unit/models/blankets/test_ccfe_hcpb.py b/tests/unit/models/blankets/test_ccfe_hcpb.py index 6df8d4867..9da50d57c 100644 --- a/tests/unit/models/blankets/test_ccfe_hcpb.py +++ b/tests/unit/models/blankets/test_ccfe_hcpb.py @@ -5,7 +5,6 @@ from process.data_structure import ( divertor_variables, global_variables, - heat_transport_variables, physics_variables, tfcoil_variables, ) @@ -969,49 +968,49 @@ def test_powerflow_calc(powerflowcalcparam, monkeypatch, ccfe_hcpb): monkeypatch.setattr(ccfe_hcpb.data.fwbs, "psurffwo", powerflowcalcparam.psurffwo) monkeypatch.setattr( - heat_transport_variables, + ccfe_hcpb.data.heat_transport, "p_fw_coolant_pump_mw", powerflowcalcparam.p_fw_coolant_pump_mw, ) monkeypatch.setattr( - heat_transport_variables, + ccfe_hcpb.data.heat_transport, "f_p_fw_coolant_pump_total_heat", powerflowcalcparam.f_p_fw_coolant_pump_total_heat, ) monkeypatch.setattr( - heat_transport_variables, + ccfe_hcpb.data.heat_transport, "p_blkt_coolant_pump_mw", powerflowcalcparam.p_blkt_coolant_pump_mw, ) monkeypatch.setattr( - heat_transport_variables, + ccfe_hcpb.data.heat_transport, "f_p_blkt_coolant_pump_total_heat", powerflowcalcparam.f_p_blkt_coolant_pump_total_heat, ) monkeypatch.setattr( - heat_transport_variables, + ccfe_hcpb.data.heat_transport, "p_shld_coolant_pump_mw", powerflowcalcparam.p_shld_coolant_pump_mw, ) monkeypatch.setattr( - heat_transport_variables, + ccfe_hcpb.data.heat_transport, "f_p_shld_coolant_pump_total_heat", powerflowcalcparam.f_p_shld_coolant_pump_total_heat, ) monkeypatch.setattr( - heat_transport_variables, + ccfe_hcpb.data.heat_transport, "p_div_coolant_pump_mw", powerflowcalcparam.p_div_coolant_pump_mw, ) monkeypatch.setattr( - heat_transport_variables, + ccfe_hcpb.data.heat_transport, "f_p_div_coolant_pump_total_heat", powerflowcalcparam.f_p_div_coolant_pump_total_heat, ) @@ -1072,11 +1071,11 @@ def test_powerflow_calc(powerflowcalcparam, monkeypatch, ccfe_hcpb): powerflowcalcparam.expected_psurffwo ) - assert heat_transport_variables.p_shld_coolant_pump_mw == pytest.approx( + assert ccfe_hcpb.data.heat_transport.p_shld_coolant_pump_mw == pytest.approx( powerflowcalcparam.expected_p_shld_coolant_pump_mw ) - assert heat_transport_variables.p_div_coolant_pump_mw == pytest.approx( + assert ccfe_hcpb.data.heat_transport.p_div_coolant_pump_mw == pytest.approx( powerflowcalcparam.expected_p_div_coolant_pump_mw ) diff --git a/tests/unit/models/physics/test_current_drive.py b/tests/unit/models/physics/test_current_drive.py index 7544feff6..20a85b17b 100644 --- a/tests/unit/models/physics/test_current_drive.py +++ b/tests/unit/models/physics/test_current_drive.py @@ -2,7 +2,6 @@ from process.core import constants from process.data_structure import ( - heat_transport_variables, physics_variables, ) @@ -49,11 +48,12 @@ def test_current_drive_primary_lower_hybrid(current_drive): assert current_drive.data.current_drive.f_c_plasma_hcd_primary == pytest.approx( 0.2, rel=1e-6 ) - assert heat_transport_variables.p_hcd_primary_electric_mw == pytest.approx( + assert current_drive.data.heat_transport.p_hcd_primary_electric_mw == pytest.approx( 96.00232726, rel=1e-6 ) - assert heat_transport_variables.p_hcd_secondary_electric_mw == pytest.approx( - 0.0, rel=1e-6 + assert ( + current_drive.data.heat_transport.p_hcd_secondary_electric_mw + == pytest.approx(0.0, rel=1e-6) ) assert current_drive.data.current_drive.p_hcd_injected_total_mw == pytest.approx( 38.4009309, rel=1e-6 @@ -97,11 +97,12 @@ def test_current_drive_primary_lower_hybrid_with_heat(current_drive): assert current_drive.data.current_drive.f_c_plasma_hcd_primary == pytest.approx( 0.2, rel=1e-6 ) - assert heat_transport_variables.p_hcd_primary_electric_mw == pytest.approx( + assert current_drive.data.heat_transport.p_hcd_primary_electric_mw == pytest.approx( 108.50232725752629, rel=1e-6 ) # Adjusted for extra heat - assert heat_transport_variables.p_hcd_secondary_electric_mw == pytest.approx( - 0.0, rel=1e-6 + assert ( + current_drive.data.heat_transport.p_hcd_secondary_electric_mw + == pytest.approx(0.0, rel=1e-6) ) assert current_drive.data.current_drive.p_hcd_injected_total_mw == pytest.approx( 43.4009309, rel=1e-6 @@ -157,11 +158,12 @@ def test_current_drive_primary_neutral_beam(current_drive): assert current_drive.data.current_drive.f_c_plasma_hcd_primary == pytest.approx( 0.2, rel=1e-6 ) - assert heat_transport_variables.p_hcd_primary_electric_mw == pytest.approx( + assert current_drive.data.heat_transport.p_hcd_primary_electric_mw == pytest.approx( 197.74124248723396, rel=1e-6 ) - assert heat_transport_variables.p_hcd_secondary_electric_mw == pytest.approx( - 0.0, rel=1e-6 + assert ( + current_drive.data.heat_transport.p_hcd_secondary_electric_mw + == pytest.approx(0.0, rel=1e-6) ) assert current_drive.data.current_drive.p_hcd_injected_total_mw == pytest.approx( 59.32237274617019, rel=1e-6 @@ -202,11 +204,12 @@ def test_current_drive_primary_electron_cyclotron(current_drive): assert current_drive.data.current_drive.f_c_plasma_hcd_primary == pytest.approx( 0.2, rel=1e-6 ) - assert heat_transport_variables.p_hcd_primary_electric_mw == pytest.approx( + assert current_drive.data.heat_transport.p_hcd_primary_electric_mw == pytest.approx( 17.71428571428571, rel=1e-6 ) - assert heat_transport_variables.p_hcd_secondary_electric_mw == pytest.approx( - 0.0, rel=1e-6 + assert ( + current_drive.data.heat_transport.p_hcd_secondary_electric_mw + == pytest.approx(0.0, rel=1e-6) ) assert current_drive.data.current_drive.p_hcd_injected_total_mw == pytest.approx( 8.857142857142856, rel=1e-6 @@ -250,11 +253,12 @@ def test_current_drive_primary_ion_cyclotron(current_drive): assert current_drive.data.current_drive.f_c_plasma_hcd_primary == pytest.approx( 0.2, rel=1e-6 ) - assert heat_transport_variables.p_hcd_primary_electric_mw == pytest.approx( + assert current_drive.data.heat_transport.p_hcd_primary_electric_mw == pytest.approx( 337.4149659863946, rel=1e-6 ) - assert heat_transport_variables.p_hcd_secondary_electric_mw == pytest.approx( - 0.0, rel=1e-6 + assert ( + current_drive.data.heat_transport.p_hcd_secondary_electric_mw + == pytest.approx(0.0, rel=1e-6) ) assert current_drive.data.current_drive.p_hcd_injected_total_mw == pytest.approx( 118.0952380952381, rel=1e-6 @@ -300,11 +304,12 @@ def test_current_drive_primary_electron_bernstein(current_drive): assert current_drive.data.current_drive.f_c_plasma_hcd_primary == pytest.approx( 0.2, rel=1e-6 ) - assert heat_transport_variables.p_hcd_primary_electric_mw == pytest.approx( + assert current_drive.data.heat_transport.p_hcd_primary_electric_mw == pytest.approx( 572.7156734979227, rel=1e-6 ) - assert heat_transport_variables.p_hcd_secondary_electric_mw == pytest.approx( - 0.0, rel=1e-6 + assert ( + current_drive.data.heat_transport.p_hcd_secondary_electric_mw + == pytest.approx(0.0, rel=1e-6) ) assert current_drive.data.current_drive.p_hcd_injected_total_mw == pytest.approx( 257.72205307406523, rel=1e-6 diff --git a/tests/unit/models/stellarator/test_stellarator.py b/tests/unit/models/stellarator/test_stellarator.py index 80736494a..c6e9af300 100644 --- a/tests/unit/models/stellarator/test_stellarator.py +++ b/tests/unit/models/stellarator/test_stellarator.py @@ -4,7 +4,6 @@ import pytest from process.data_structure import ( - heat_transport_variables, impurity_radiation_module, physics_variables, stellarator_configuration, @@ -622,7 +621,9 @@ def test_stbild(stbildparam, monkeypatch, stellarator): monkeypatch.setattr(stellarator.data.fwbs, "dr_fw_wall", stbildparam.dr_fw_wall) - monkeypatch.setattr(heat_transport_variables, "ipowerflow", stbildparam.ipowerflow) + monkeypatch.setattr( + stellarator.data.heat_transport, "ipowerflow", stbildparam.ipowerflow + ) monkeypatch.setattr(physics_variables, "rmajor", stbildparam.rmajor) diff --git a/tests/unit/models/test_costs_1990.py b/tests/unit/models/test_costs_1990.py index 5ff979ed4..5b21e4de4 100644 --- a/tests/unit/models/test_costs_1990.py +++ b/tests/unit/models/test_costs_1990.py @@ -8,7 +8,6 @@ from process import data_structure from process.data_structure import ( divertor_variables, - heat_transport_variables, ife_variables, pf_power_variables, pfcoil_variables, @@ -71,11 +70,11 @@ def acc2261_fix(costs, request, monkeypatch): # Mock variables used by acc2261() monkeypatch.setattr(costs.data.costs, "fkind", 1) monkeypatch.setattr(costs.data.costs, "lsa", 1) - monkeypatch.setattr(heat_transport_variables, "p_fw_div_heat_deposited_mw", 0.0) + monkeypatch.setattr(costs.data.heat_transport, "p_fw_div_heat_deposited_mw", 0.0) monkeypatch.setattr(costs.data.fwbs, "p_blkt_nuclear_heat_total_mw", 1558.0) monkeypatch.setattr(costs.data.fwbs, "p_shld_nuclear_heat_mw", 1.478) - monkeypatch.setattr(heat_transport_variables, "p_plant_primary_heat_mw", 2647.0) - monkeypatch.setattr(heat_transport_variables, "n_primary_heat_exchangers", 3) + monkeypatch.setattr(costs.data.heat_transport, "p_plant_primary_heat_mw", 2647.0) + monkeypatch.setattr(costs.data.heat_transport, "n_primary_heat_exchangers", 3) monkeypatch.setattr(costs.data.costs, "c2261", 0) # Parameterised mocks @@ -104,11 +103,11 @@ def test_acc2262(monkeypatch, costs): # Mock module variables monkeypatch.setattr(costs.data.costs, "fkind", 1) monkeypatch.setattr(costs.data.costs, "lsa", 4) - monkeypatch.setattr(heat_transport_variables, "p_hcd_electric_loss_mw", 76.5) - monkeypatch.setattr(heat_transport_variables, "p_cryo_plant_electric_mw", 39.936) - monkeypatch.setattr(heat_transport_variables, "vachtmw", 0.5) - monkeypatch.setattr(heat_transport_variables, "p_tritium_plant_electric_mw", 15.0) - monkeypatch.setattr(heat_transport_variables, "fachtmw", 64.835) + monkeypatch.setattr(costs.data.heat_transport, "p_hcd_electric_loss_mw", 76.5) + monkeypatch.setattr(costs.data.heat_transport, "p_cryo_plant_electric_mw", 39.936) + monkeypatch.setattr(costs.data.heat_transport, "vachtmw", 0.5) + monkeypatch.setattr(costs.data.heat_transport, "p_tritium_plant_electric_mw", 15.0) + monkeypatch.setattr(costs.data.heat_transport, "fachtmw", 64.835) monkeypatch.setattr(costs.data.costs, "c2262", 0) costs.acc2262() @@ -125,7 +124,7 @@ def test_acc2263(monkeypatch, costs): monkeypatch.setattr(costs.data.costs, "lsa", 4) monkeypatch.setattr(costs.data.costs, "uccry", 9.3e4) monkeypatch.setattr(data_structure.tfcoil_variables, "tftmp", 4.5) - monkeypatch.setattr(heat_transport_variables, "helpow", 80.980e3) + monkeypatch.setattr(costs.data.heat_transport, "helpow", 80.980e3) monkeypatch.setattr(costs.data.costs, "c2263", 0) costs.acc2263() @@ -425,7 +424,7 @@ def acc23_fix(request, monkeypatch, costs): monkeypatch.setattr( costs.data.fwbs, "i_blkt_coolant_type", param["i_blkt_coolant_type"] ) - monkeypatch.setattr(heat_transport_variables, "p_plant_electric_gross_mw", 1200.0) + monkeypatch.setattr(costs.data.heat_transport, "p_plant_electric_gross_mw", 1200.0) monkeypatch.setattr(costs.data.costs, "c23", 0) # Return the expected result for the given parameter list @@ -464,8 +463,10 @@ def test_acc242(monkeypatch, costs): :type monkeypatch: object """ monkeypatch.setattr(costs.data.costs, "lsa", 4) - monkeypatch.setattr(heat_transport_variables, "pacpmw", 630.0) - monkeypatch.setattr(heat_transport_variables, "p_plant_electric_base_total_mw", 65.0) + monkeypatch.setattr(costs.data.heat_transport, "pacpmw", 630.0) + monkeypatch.setattr( + costs.data.heat_transport, "p_plant_electric_base_total_mw", 65.0 + ) monkeypatch.setattr(costs.data.costs, "c242", 0) costs.acc242() @@ -479,7 +480,7 @@ def test_acc243(monkeypatch, costs): :type monkeypatch: object """ monkeypatch.setattr(costs.data.costs, "lsa", 4) - monkeypatch.setattr(heat_transport_variables, "tlvpmw", 403.8) + monkeypatch.setattr(costs.data.heat_transport, "tlvpmw", 403.8) monkeypatch.setattr(costs.data.costs, "c243", 0) costs.acc243() @@ -584,8 +585,8 @@ def acc26_param(**kwargs): "p_fusion_total_mw": 2000.0, "p_hcd_electric_total_mw": 250.0, "tfcmw": 50.0, - "p_plant_primary_heat_mw": heat_transport_variables.p_plant_primary_heat_mw, - "p_plant_electric_gross_mw": heat_transport_variables.p_plant_electric_gross_mw, + "p_plant_primary_heat_mw": 0.0, + "p_plant_electric_gross_mw": 0.0, "expected": pytest.approx(87.9, abs=0.01), } @@ -607,7 +608,7 @@ def acc26_params(): acc26_param( ireactor=1, p_fusion_total_mw=physics_variables.p_fusion_total_mw, - p_hcd_electric_total_mw=heat_transport_variables.p_hcd_electric_total_mw, + p_hcd_electric_total_mw=0.0, tfcmw=data_structure.tfcoil_variables.tfcmw, p_plant_primary_heat_mw=3000.0, p_plant_electric_gross_mw=700.0, @@ -638,18 +639,18 @@ def acc26_fix(request, monkeypatch, costs): param["p_fusion_total_mw"], ) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_hcd_electric_total_mw", param["p_hcd_electric_total_mw"], ) monkeypatch.setattr(data_structure.tfcoil_variables, "tfcmw", param["tfcmw"]) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_primary_heat_mw", param["p_plant_primary_heat_mw"], ) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_electric_gross_mw", param["p_plant_electric_gross_mw"], ) @@ -3647,7 +3648,7 @@ def test_acc2252(acc2252param, monkeypatch, costs): monkeypatch.setattr(costs.data.costs, "ucpfps", acc2252param.ucpfps) - monkeypatch.setattr(heat_transport_variables, "peakmva", acc2252param.peakmva) + monkeypatch.setattr(costs.data.heat_transport, "peakmva", acc2252param.peakmva) monkeypatch.setattr(pf_power_variables, "ensxpfm", acc2252param.ensxpfm) @@ -3769,13 +3770,13 @@ def test_acc2253(acc2253param, monkeypatch, costs): monkeypatch.setattr(costs.data.costs, "fkind", acc2253param.fkind) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_primary_heat_mw", acc2253param.p_plant_primary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_electric_net_mw", acc2253param.p_plant_electric_net_mw, ) @@ -3983,19 +3984,19 @@ def test_acc2261_rut(acc2261param, monkeypatch, costs): ) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_primary_heat_mw", acc2261param.p_plant_primary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_fw_div_heat_deposited_mw", acc2261param.p_fw_div_heat_deposited_mw, ) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "n_primary_heat_exchangers", acc2261param.n_primary_heat_exchangers, ) @@ -4122,23 +4123,23 @@ def test_acc2262_rut(acc2262param, monkeypatch, costs): monkeypatch.setattr(ife_variables, "tdspmw", acc2262param.tdspmw) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_hcd_electric_loss_mw", acc2262param.p_hcd_electric_loss_mw, ) - monkeypatch.setattr(heat_transport_variables, "vachtmw", acc2262param.vachtmw) + monkeypatch.setattr(costs.data.heat_transport, "vachtmw", acc2262param.vachtmw) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_tritium_plant_electric_mw", acc2262param.p_tritium_plant_electric_mw, ) - monkeypatch.setattr(heat_transport_variables, "fachtmw", acc2262param.fachtmw) + monkeypatch.setattr(costs.data.heat_transport, "fachtmw", acc2262param.fachtmw) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_cryo_plant_electric_mw", acc2262param.p_cryo_plant_electric_mw, ) @@ -4226,7 +4227,7 @@ def test_acc2263_rut(acc2263param, monkeypatch, costs): monkeypatch.setattr(costs.data.costs, "fkind", acc2263param.fkind) - monkeypatch.setattr(heat_transport_variables, "helpow", acc2263param.helpow) + monkeypatch.setattr(costs.data.heat_transport, "helpow", acc2263param.helpow) monkeypatch.setattr(tfcoil_variables, "temp_tf_cryo", acc2263param.temp_tf_cryo) @@ -4805,7 +4806,7 @@ def test_acc23_rut(acc23param, monkeypatch, costs): ) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_electric_gross_mw", acc23param.p_plant_electric_gross_mw, ) @@ -4991,10 +4992,10 @@ def test_acc242_rut(acc242param, monkeypatch, costs): monkeypatch.setattr(costs.data.costs, "lsa", acc242param.lsa) - monkeypatch.setattr(heat_transport_variables, "pacpmw", acc242param.pacpmw) + monkeypatch.setattr(costs.data.heat_transport, "pacpmw", acc242param.pacpmw) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_electric_base_total_mw", acc242param.p_plant_electric_base_total_mw, ) @@ -5056,7 +5057,7 @@ def test_acc243_rut(acc243param, monkeypatch, costs): monkeypatch.setattr(costs.data.costs, "lsa", acc243param.lsa) - monkeypatch.setattr(heat_transport_variables, "tlvpmw", acc243param.tlvpmw) + monkeypatch.setattr(costs.data.heat_transport, "tlvpmw", acc243param.tlvpmw) monkeypatch.setattr(costs.data.costs, "c24", acc243param.c24) @@ -5291,19 +5292,19 @@ def test_acc26_rut(acc26param, monkeypatch, costs): monkeypatch.setattr(costs.data.costs, "lsa", acc26param.lsa) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_primary_heat_mw", acc26param.p_plant_primary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_hcd_electric_total_mw", acc26param.p_hcd_electric_total_mw, ) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_electric_gross_mw", acc26param.p_plant_electric_gross_mw, ) @@ -5503,13 +5504,13 @@ def test_acc2253_urt(acc2253param, monkeypatch, costs): monkeypatch.setattr(costs.data.costs, "fkind", acc2253param.fkind) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_primary_heat_mw", acc2253param.p_plant_primary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_electric_net_mw", acc2253param.p_plant_electric_net_mw, ) @@ -5916,7 +5917,7 @@ def test_coelc(coelcparam, monkeypatch, costs): monkeypatch.setattr(ife_variables, "reprat", coelcparam.reprat) monkeypatch.setattr( - heat_transport_variables, + costs.data.heat_transport, "p_plant_electric_net_mw", coelcparam.p_plant_electric_net_mw, ) diff --git a/tests/unit/models/test_costs_2015.py b/tests/unit/models/test_costs_2015.py index 244c72873..b0701a051 100644 --- a/tests/unit/models/test_costs_2015.py +++ b/tests/unit/models/test_costs_2015.py @@ -6,7 +6,6 @@ import pytest from process.data_structure import ( - heat_transport_variables, pf_power_variables, pfcoil_variables, physics_variables, @@ -2275,19 +2274,19 @@ def test_calc_building_costs(calcbuildingcostsparam, monkeypatch, costs2015): ) monkeypatch.setattr( - heat_transport_variables, + costs2015.data.heat_transport, "p_plant_primary_heat_mw", calcbuildingcostsparam.p_plant_primary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + costs2015.data.heat_transport, "p_plant_secondary_heat_mw", calcbuildingcostsparam.p_plant_secondary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, "helpow", calcbuildingcostsparam.helpow + costs2015.data.heat_transport, "helpow", calcbuildingcostsparam.helpow ) monkeypatch.setattr( @@ -11382,7 +11381,7 @@ def test_calc_n_plant_and_vv_costs(calcnplantandvvcostsparam, monkeypatch, costs ) monkeypatch.setattr( - heat_transport_variables, "helpow", calcnplantandvvcostsparam.helpow + costs2015.data.heat_transport, "helpow", calcnplantandvvcostsparam.helpow ) monkeypatch.setattr( @@ -13633,7 +13632,7 @@ def test_calc_energy_conversion_system( """ monkeypatch.setattr( - heat_transport_variables, + costs2015.data.heat_transport, "p_plant_electric_gross_mw", calcenergyconversionsystemparam.p_plant_electric_gross_mw, ) @@ -15952,19 +15951,19 @@ def test_calc_remaining_subsystems(calcremainingsubsystemsparam, monkeypatch, co ) monkeypatch.setattr( - heat_transport_variables, + costs2015.data.heat_transport, "p_plant_primary_heat_mw", calcremainingsubsystemsparam.p_plant_primary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + costs2015.data.heat_transport, "p_plant_secondary_heat_mw", calcremainingsubsystemsparam.p_plant_secondary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, "helpow", calcremainingsubsystemsparam.helpow + costs2015.data.heat_transport, "helpow", calcremainingsubsystemsparam.helpow ) monkeypatch.setattr(costs2015.data.fwbs, "m_vv", calcremainingsubsystemsparam.m_vv) diff --git a/tests/unit/models/test_ife.py b/tests/unit/models/test_ife.py index 9be9722d1..64c2e5bf6 100644 --- a/tests/unit/models/test_ife.py +++ b/tests/unit/models/test_ife.py @@ -6,7 +6,6 @@ import pytest from process.data_structure import ( - heat_transport_variables, ife_variables, physics_variables, ) @@ -2204,38 +2203,38 @@ def test_ifepw1(ifepw1param, monkeypatch, ife): ife.data.fwbs, "p_shld_nuclear_heat_mw", ifepw1param.p_shld_nuclear_heat_mw ) monkeypatch.setattr(ife.data.fwbs, "pnucloss", ifepw1param.pnucloss) - monkeypatch.setattr(heat_transport_variables, "priheat", ifepw1param.priheat) + monkeypatch.setattr(ife.data.heat_transport, "priheat", ifepw1param.priheat) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_plant_primary_heat_mw", ifepw1param.p_plant_primary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_fw_div_heat_deposited_mw", ifepw1param.p_fw_div_heat_deposited_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "n_primary_heat_exchangers", ifepw1param.n_primary_heat_exchangers, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_hcd_electric_total_mw", ifepw1param.p_hcd_electric_total_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_hcd_electric_loss_mw", ifepw1param.p_hcd_electric_loss_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_cryo_plant_electric_mw", ifepw1param.p_cryo_plant_electric_mw, ) - monkeypatch.setattr(heat_transport_variables, "helpow", ifepw1param.helpow) + monkeypatch.setattr(ife.data.heat_transport, "helpow", ifepw1param.helpow) monkeypatch.setattr(ife_variables, "pdrive", ifepw1param.pdrive) monkeypatch.setattr(ife_variables, "ifetyp", ifepw1param.ifetyp) monkeypatch.setattr(ife_variables, "etadrv", ifepw1param.etadrv) @@ -2249,28 +2248,26 @@ def test_ifepw1(ifepw1param, monkeypatch, ife): assert ife.data.fwbs.p_blkt_nuclear_heat_total_mw == pytest.approx( ifepw1param.expected_p_blkt_nuclear_heat_total_mw ) - assert heat_transport_variables.priheat == pytest.approx( - ifepw1param.expected_priheat - ) - assert heat_transport_variables.p_plant_primary_heat_mw == pytest.approx( + assert ife.data.heat_transport.priheat == pytest.approx(ifepw1param.expected_priheat) + assert ife.data.heat_transport.p_plant_primary_heat_mw == pytest.approx( ifepw1param.expected_p_plant_primary_heat_mw ) - assert heat_transport_variables.p_fw_div_heat_deposited_mw == pytest.approx( + assert ife.data.heat_transport.p_fw_div_heat_deposited_mw == pytest.approx( ifepw1param.expected_p_fw_div_heat_deposited_mw ) - assert heat_transport_variables.n_primary_heat_exchangers == pytest.approx( + assert ife.data.heat_transport.n_primary_heat_exchangers == pytest.approx( ifepw1param.expected_nphx ) - assert heat_transport_variables.p_hcd_electric_total_mw == pytest.approx( + assert ife.data.heat_transport.p_hcd_electric_total_mw == pytest.approx( ifepw1param.expected_p_hcd_electric_total_mw ) - assert heat_transport_variables.p_hcd_electric_loss_mw == pytest.approx( + assert ife.data.heat_transport.p_hcd_electric_loss_mw == pytest.approx( ifepw1param.expected_p_hcd_electric_loss_mw ) - assert heat_transport_variables.p_cryo_plant_electric_mw == pytest.approx( + assert ife.data.heat_transport.p_cryo_plant_electric_mw == pytest.approx( ifepw1param.expected_p_cryo_plant_electric_mw ) - assert heat_transport_variables.helpow == pytest.approx(ifepw1param.expected_helpow) + assert ife.data.heat_transport.helpow == pytest.approx(ifepw1param.expected_helpow) class Bld2019Param(NamedTuple): @@ -2813,38 +2810,38 @@ def test_ifeacp(ifeacpparam, monkeypatch, ife): ifeacpparam.a_plant_floor_effective, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_plant_electric_base", ifeacpparam.p_plant_electric_base, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "pflux_plant_floor_electric", ifeacpparam.pflux_plant_floor_electric, ) - monkeypatch.setattr(heat_transport_variables, "pacpmw", ifeacpparam.pacpmw) + monkeypatch.setattr(ife.data.heat_transport, "pacpmw", ifeacpparam.pacpmw) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_cryo_plant_electric_mw", ifeacpparam.p_cryo_plant_electric_mw, ) - monkeypatch.setattr(heat_transport_variables, "vachtmw", ifeacpparam.vachtmw) + monkeypatch.setattr(ife.data.heat_transport, "vachtmw", ifeacpparam.vachtmw) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_tritium_plant_electric_mw", ifeacpparam.p_tritium_plant_electric_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_hcd_electric_total_mw", ifeacpparam.p_hcd_electric_total_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_plant_electric_base_total_mw", ifeacpparam.p_plant_electric_base_total_mw, ) - monkeypatch.setattr(heat_transport_variables, "tlvpmw", ifeacpparam.tlvpmw) + monkeypatch.setattr(ife.data.heat_transport, "tlvpmw", ifeacpparam.tlvpmw) monkeypatch.setattr(ife_variables, "tdspmw", ifeacpparam.tdspmw) monkeypatch.setattr(ife_variables, "tfacmw", ifeacpparam.tfacmw) monkeypatch.setattr(ife_variables, "htpmw_ife", ifeacpparam.htpmw_ife) @@ -2854,11 +2851,11 @@ def test_ifeacp(ifeacpparam, monkeypatch, ife): ife.ifeacp() - assert heat_transport_variables.pacpmw == pytest.approx(ifeacpparam.expected_pacpmw) - assert heat_transport_variables.p_plant_electric_base_total_mw == pytest.approx( + assert ife.data.heat_transport.pacpmw == pytest.approx(ifeacpparam.expected_pacpmw) + assert ife.data.heat_transport.p_plant_electric_base_total_mw == pytest.approx( ifeacpparam.expected_fcsht ) - assert heat_transport_variables.tlvpmw == pytest.approx(ifeacpparam.expected_tlvpmw) + assert ife.data.heat_transport.tlvpmw == pytest.approx(ifeacpparam.expected_tlvpmw) class IfebdgParam(NamedTuple): @@ -2998,7 +2995,7 @@ def test_ifebdg(ifebdgparam, monkeypatch, ife): monkeypatch.setattr(ife.data.buildings, "wsvol", ifebdgparam.wsvol) monkeypatch.setattr(ife.data.buildings, "volnucb", ifebdgparam.volnucb) monkeypatch.setattr(ife.data.fwbs, "whtshld", ifebdgparam.whtshld) - monkeypatch.setattr(heat_transport_variables, "helpow", ifebdgparam.helpow) + monkeypatch.setattr(ife.data.heat_transport, "helpow", ifebdgparam.helpow) monkeypatch.setattr(ife_variables, "zl7", ifebdgparam.zl7) monkeypatch.setattr(ife_variables, "zu7", ifebdgparam.zu7) monkeypatch.setattr(ife_variables, "r7", ifebdgparam.r7) @@ -3122,68 +3119,68 @@ def test_ifepw2(ifepw2param, monkeypatch, ife): "p_blkt_nuclear_heat_total_mw", ifepw2param.p_blkt_nuclear_heat_total_mw, ) - monkeypatch.setattr(heat_transport_variables, "fachtmw", ifepw2param.fachtmw) + monkeypatch.setattr(ife.data.heat_transport, "fachtmw", ifepw2param.fachtmw) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_plant_electric_base_total_mw", ifepw2param.p_plant_electric_base_total_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_plant_secondary_heat_mw", ifepw2param.p_plant_secondary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_hcd_electric_loss_mw", ifepw2param.p_hcd_electric_loss_mw, ) - monkeypatch.setattr(heat_transport_variables, "vachtmw", ifepw2param.vachtmw) + monkeypatch.setattr(ife.data.heat_transport, "vachtmw", ifepw2param.vachtmw) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_tritium_plant_electric_mw", ifepw2param.p_tritium_plant_electric_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_cryo_plant_electric_mw", ifepw2param.p_cryo_plant_electric_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_plant_electric_gross_mw", ifepw2param.p_plant_electric_gross_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_plant_primary_heat_mw", ifepw2param.p_plant_primary_heat_mw, ) - monkeypatch.setattr(heat_transport_variables, "eta_turbine", ifepw2param.eta_turbine) - monkeypatch.setattr(heat_transport_variables, "fgrosbop", ifepw2param.fgrosbop) + monkeypatch.setattr(ife.data.heat_transport, "eta_turbine", ifepw2param.eta_turbine) + monkeypatch.setattr(ife.data.heat_transport, "fgrosbop", ifepw2param.fgrosbop) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_plant_electric_recirc_mw", ifepw2param.p_plant_electric_recirc_mw, ) - monkeypatch.setattr(heat_transport_variables, "pacpmw", ifepw2param.pacpmw) + monkeypatch.setattr(ife.data.heat_transport, "pacpmw", ifepw2param.pacpmw) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_plant_electric_net_mw", ifepw2param.p_plant_electric_net_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_hcd_electric_total_mw", ifepw2param.p_hcd_electric_total_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "p_fw_div_heat_deposited_mw", ifepw2param.p_fw_div_heat_deposited_mw, ) monkeypatch.setattr( - heat_transport_variables, + ife.data.heat_transport, "n_primary_heat_exchangers", ifepw2param.n_primary_heat_exchangers, ) @@ -3196,18 +3193,16 @@ def test_ifepw2(ifepw2param, monkeypatch, ife): ife.ifepw2() - assert heat_transport_variables.fachtmw == pytest.approx( - ifepw2param.expected_fachtmw - ) - assert heat_transport_variables.p_plant_secondary_heat_mw == pytest.approx( + assert ife.data.heat_transport.fachtmw == pytest.approx(ifepw2param.expected_fachtmw) + assert ife.data.heat_transport.p_plant_secondary_heat_mw == pytest.approx( ifepw2param.expected_p_plant_secondary_heat_mw ) - assert heat_transport_variables.p_plant_electric_gross_mw == pytest.approx( + assert ife.data.heat_transport.p_plant_electric_gross_mw == pytest.approx( ifepw2param.expected_p_plant_electric_gross_mw ) - assert heat_transport_variables.p_plant_electric_recirc_mw == pytest.approx( + assert ife.data.heat_transport.p_plant_electric_recirc_mw == pytest.approx( ifepw2param.expected_precircmw ) - assert heat_transport_variables.p_plant_electric_net_mw == pytest.approx( + assert ife.data.heat_transport.p_plant_electric_net_mw == pytest.approx( ifepw2param.expected_p_plant_electric_net_mw ) diff --git a/tests/unit/models/test_power.py b/tests/unit/models/test_power.py index 2a8164f93..adbfd997c 100644 --- a/tests/unit/models/test_power.py +++ b/tests/unit/models/test_power.py @@ -5,7 +5,6 @@ from process.data_structure import ( divertor_variables, - heat_transport_variables, numerics, pf_power_variables, pfcoil_variables, @@ -1763,7 +1762,7 @@ def test_pfpwr(pfpwrparam, monkeypatch, power): monkeypatch.setattr(power.data.build, "iohcl", pfpwrparam.iohcl) - monkeypatch.setattr(heat_transport_variables, "peakmva", pfpwrparam.peakmva) + monkeypatch.setattr(power.data.heat_transport, "peakmva", pfpwrparam.peakmva) monkeypatch.setattr(pf_power_variables, "pfckts", pfpwrparam.pfckts) @@ -1869,7 +1868,9 @@ def test_pfpwr(pfpwrparam, monkeypatch, power): power.pfpwr(output=False) - assert heat_transport_variables.peakmva == pytest.approx(pfpwrparam.expected_peakmva) + assert power.data.heat_transport.peakmva == pytest.approx( + pfpwrparam.expected_peakmva + ) assert pf_power_variables.pfckts == pytest.approx(pfpwrparam.expected_pfckts) @@ -2001,62 +2002,62 @@ def test_acpow(acpowparam, monkeypatch, power): ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_plant_electric_base", acpowparam.p_plant_electric_base, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_cryo_plant_electric_mw", acpowparam.p_cryo_plant_electric_mw, ) - monkeypatch.setattr(heat_transport_variables, "vachtmw", acpowparam.vachtmw) + monkeypatch.setattr(power.data.heat_transport, "vachtmw", acpowparam.vachtmw) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_tf_electric_supplies_mw", acpowparam.p_tf_electric_supplies_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_tritium_plant_electric_mw", acpowparam.p_tritium_plant_electric_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_hcd_electric_total_mw", acpowparam.p_hcd_electric_total_mw, ) - monkeypatch.setattr(heat_transport_variables, "tlvpmw", acpowparam.tlvpmw) + monkeypatch.setattr(power.data.heat_transport, "tlvpmw", acpowparam.tlvpmw) - monkeypatch.setattr(heat_transport_variables, "peakmva", acpowparam.peakmva) + monkeypatch.setattr(power.data.heat_transport, "peakmva", acpowparam.peakmva) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_plant_electric_base_total_mw", acpowparam.p_plant_electric_base_total_mw, ) - monkeypatch.setattr(heat_transport_variables, "fmgdmw", acpowparam.fmgdmw) + monkeypatch.setattr(power.data.heat_transport, "fmgdmw", acpowparam.fmgdmw) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "pflux_plant_floor_electric", acpowparam.pflux_plant_floor_electric, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_coolant_pump_elec_total_mw", acpowparam.p_coolant_pump_elec_total_mw, ) - monkeypatch.setattr(heat_transport_variables, "pacpmw", acpowparam.pacpmw) + monkeypatch.setattr(power.data.heat_transport, "pacpmw", acpowparam.pacpmw) monkeypatch.setattr( pf_power_variables, @@ -2068,7 +2069,7 @@ def test_acpow(acpowparam, monkeypatch, power): power.acpow(output=False) - assert heat_transport_variables.pacpmw == pytest.approx(acpowparam.expected_pacpmw) + assert power.data.heat_transport.pacpmw == pytest.approx(acpowparam.expected_pacpmw) class Power2Param(NamedTuple): @@ -2592,175 +2593,177 @@ def test_power2(power2param, monkeypatch, power): ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_shld_coolant_pump_mw", power2param.p_shld_coolant_pump_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_blkt_coolant_pump_mw", power2param.p_blkt_coolant_pump_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_shld_secondary_heat_mw", power2param.p_shld_secondary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "f_p_shld_coolant_pump_total_heat", power2param.f_p_shld_coolant_pump_total_heat, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "temp_turbine_coolant_in", power2param.temp_turbine_coolant_in, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_plant_electric_net_mw", power2param.p_plant_electric_net_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "f_p_div_coolant_pump_total_heat", power2param.f_p_div_coolant_pump_total_heat, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "f_p_blkt_coolant_pump_total_heat", power2param.f_p_blkt_coolant_pump_total_heat, ) - monkeypatch.setattr(heat_transport_variables, "vachtmw", power2param.vachtmw) + monkeypatch.setattr(power.data.heat_transport, "vachtmw", power2param.vachtmw) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_div_coolant_pump_mw", power2param.p_div_coolant_pump_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "n_primary_heat_exchangers", power2param.n_primary_heat_exchangers, ) - monkeypatch.setattr(heat_transport_variables, "helpow", power2param.helpow) + monkeypatch.setattr(power.data.heat_transport, "helpow", power2param.helpow) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_fw_coolant_pump_mw", power2param.p_fw_coolant_pump_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_plant_electric_recirc_mw", power2param.p_plant_electric_recirc_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_plant_primary_heat_mw", power2param.p_plant_primary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "f_p_fw_coolant_pump_total_heat", power2param.f_p_fw_coolant_pump_total_heat, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_plant_electric_base_total_mw", power2param.p_plant_electric_base_total_mw, ) monkeypatch.setattr( - heat_transport_variables, "i_shld_primary_heat", power2param.i_shld_primary_heat + power.data.heat_transport, "i_shld_primary_heat", power2param.i_shld_primary_heat ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_hcd_electric_total_mw", power2param.p_hcd_electric_total_mw, ) - monkeypatch.setattr(heat_transport_variables, "fachtmw", power2param.fachtmw) + monkeypatch.setattr(power.data.heat_transport, "fachtmw", power2param.fachtmw) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_plant_electric_gross_mw", power2param.p_plant_electric_gross_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_plant_secondary_heat_mw", power2param.p_plant_secondary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_tritium_plant_electric_mw", power2param.p_tritium_plant_electric_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_hcd_secondary_heat_mw", power2param.p_hcd_secondary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_tf_electric_supplies_mw", power2param.p_tf_electric_supplies_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_coolant_pump_elec_total_mw", power2param.p_coolant_pump_elec_total_mw, ) - monkeypatch.setattr(heat_transport_variables, "eta_turbine", power2param.eta_turbine) + monkeypatch.setattr( + power.data.heat_transport, "eta_turbine", power2param.eta_turbine + ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_cryo_plant_electric_mw", power2param.p_cryo_plant_electric_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_div_secondary_heat_mw", power2param.p_div_secondary_heat_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_hcd_electric_loss_mw", power2param.p_hcd_electric_loss_mw, ) monkeypatch.setattr( - heat_transport_variables, + power.data.heat_transport, "p_coolant_pump_loss_total_mw", power2param.p_coolant_pump_loss_total_mw, ) monkeypatch.setattr( - heat_transport_variables, "helpow_cryal", power2param.helpow_cryal + power.data.heat_transport, "helpow_cryal", power2param.helpow_cryal ) monkeypatch.setattr( @@ -2909,23 +2912,23 @@ def test_power2(power2param, monkeypatch, power): power.plant_electric_production() - assert heat_transport_variables.p_plant_electric_net_mw == pytest.approx( + assert power.data.heat_transport.p_plant_electric_net_mw == pytest.approx( power2param.expected_p_plant_electric_net_mw ) - assert heat_transport_variables.p_plant_electric_recirc_mw == pytest.approx( + assert power.data.heat_transport.p_plant_electric_recirc_mw == pytest.approx( power2param.expected_precircmw ) - assert heat_transport_variables.fachtmw == pytest.approx( + assert power.data.heat_transport.fachtmw == pytest.approx( power2param.expected_fachtmw ) - assert heat_transport_variables.p_plant_electric_gross_mw == pytest.approx( + assert power.data.heat_transport.p_plant_electric_gross_mw == pytest.approx( power2param.expected_p_plant_electric_gross_mw ) - assert heat_transport_variables.p_plant_secondary_heat_mw == pytest.approx( + assert power.data.heat_transport.p_plant_secondary_heat_mw == pytest.approx( power2param.expected_p_plant_secondary_heat_mw )