From c8023bd62fabede0111a38acadc0683cb8ceed24 Mon Sep 17 00:00:00 2001 From: Clair Mould <86794332+clmould@users.noreply.github.com> Date: Tue, 14 Apr 2026 13:38:44 +0100 Subject: [PATCH 1/2] Costs dataclass --- examples/introduction.ex.py | 5 +- process/core/caller.py | 2 +- process/core/final.py | 2 +- process/core/init.py | 2 - process/core/input.py | 328 ++- process/core/model.py | 2 + process/core/scan.py | 9 +- process/core/solver/constraints.py | 31 +- process/core/solver/evaluators.py | 4 +- process/core/solver/objectives.py | 19 +- process/data_structure/cost_variables.py | 1830 +++++------------ process/main.py | 38 +- process/models/availability.py | 398 ++-- process/models/blankets/hcpb.py | 3 +- process/models/buildings.py | 15 +- process/models/costs/costs.py | 1444 ++++++------- process/models/costs/costs_2015.py | 133 +- process/models/ife.py | 13 +- process/models/power.py | 3 +- process/models/stellarator/stellarator.py | 7 +- .../models/stellarator/test_stellarator.py | 85 +- tests/unit/models/test_availability.py | 127 +- tests/unit/models/test_buildings.py | 16 +- tests/unit/models/test_costs_1990.py | 911 ++++---- tests/unit/models/test_costs_2015.py | 73 +- tests/unit/models/test_ife.py | 24 +- tests/unit/models/test_power.py | 14 +- 27 files changed, 2359 insertions(+), 3179 deletions(-) diff --git a/examples/introduction.ex.py b/examples/introduction.ex.py index d4ed27e356..e180c56648 100644 --- a/examples/introduction.ex.py +++ b/examples/introduction.ex.py @@ -79,11 +79,10 @@ # we have set some values on the `CostModel` instance and can print them. # %% -import process.data_structure # Print some values on the CostModel instance -print(f"Heat transport system: {process.data_structure.cost_variables.c226:.3e} M$") -print(f"Electrical plant equipment: {process.data_structure.cost_variables.c24:.3e} M$") +print(f"Heat transport system: {single_run.data.costs.c226:.3e} M$") +print(f"Electrical plant equipment: {single_run.data.costs.c24:.3e} M$") # %% # Clean up diff --git a/process/core/caller.py b/process/core/caller.py index 953add544d..8830ea1e35 100644 --- a/process/core/caller.py +++ b/process/core/caller.py @@ -97,7 +97,7 @@ def call_models(self, xc: np.ndarray, m: int) -> tuple[float, np.ndarray]: for _ in range(10): self._call_models_once(xc) # Evaluate objective function and constraints - objf = objective_function(data_structure.numerics.minmax) + objf = objective_function(data_structure.numerics.minmax, self.data) conf, _, _, _, _ = constraints.constraint_eqns(m, -1, self.data) if objf_prev is None and conf_prev is None: diff --git a/process/core/final.py b/process/core/final.py index 03bb034020..d2c777190f 100644 --- a/process/core/final.py +++ b/process/core/final.py @@ -57,7 +57,7 @@ def output_evaluation(data): po.oblnkl(constants.NOUT) # Evaluate objective function - norm_objf = objective_function(numerics.minmax) + norm_objf = objective_function(numerics.minmax, data) po.ovarre(constants.MFILE, "Normalised objective function", "(norm_objf)", norm_objf) # Print the residuals of the constraint equations diff --git a/process/core/init.py b/process/core/init.py index 0fa2e9ecb0..9a63a841f9 100644 --- a/process/core/init.py +++ b/process/core/init.py @@ -21,7 +21,6 @@ from process.data_structure.buildings_variables import init_buildings_variables from process.data_structure.ccfe_hcpb_module import init_ccfe_hcpb_module from process.data_structure.constraint_variables import init_constraint_variables -from process.data_structure.cost_variables import init_cost_variables from process.data_structure.current_drive_variables import init_current_drive_variables from process.data_structure.dcll_variables import init_dcll_module from process.data_structure.divertor_variables import init_divertor_variables @@ -270,7 +269,6 @@ def init_all_module_vars(): logging_model_handler.clear_logs() data_structure.numerics.init_numerics() init_buildings_variables() - init_cost_variables() init_divertor_variables() init_fwbs_variables() data_structure.global_variables.init_global_variables() diff --git a/process/core/input.py b/process/core/input.py index 825efef1df..b5d520961b 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -185,8 +185,8 @@ def __post_init__(self): data_structure.impurity_radiation_module, float, array=True ), "fkzohm": InputVariable(data_structure.physics_variables, float, range=(0.5, 2.0)), - "abktflnc": InputVariable(data_structure.cost_variables, float, range=(0.1, 100.0)), - "adivflnc": InputVariable(data_structure.cost_variables, float, range=(0.1, 100.0)), + "abktflnc": InputVariable("costs", float, range=(0.1, 100.0)), + "adivflnc": InputVariable("costs", float, range=(0.1, 100.0)), "admv": InputVariable( data_structure.buildings_variables, float, range=(1.0e4, 1.0e6) ), @@ -195,9 +195,7 @@ def __post_init__(self): "alstroh": InputVariable( data_structure.pfcoil_variables, float, range=(1000000.0, 100000000000.0) ), - "amortization": InputVariable( - data_structure.cost_variables, float, range=(1.0, 50.0) - ), + "amortization": InputVariable("costs", float, range=(1.0, 50.0)), "anginc": InputVariable( data_structure.divertor_variables, float, range=(0.0, 1.5707) ), @@ -223,7 +221,7 @@ def __post_init__(self): "p_hcd_injected_min_mw": InputVariable( data_structure.constraint_variables, float, range=(0.01, 100.0) ), - "avail_min": InputVariable(data_structure.cost_variables, float, range=(0.0, 1.0)), + "avail_min": InputVariable("costs", float, range=(0.0, 1.0)), "b_crit_upper_nbti": InputVariable( data_structure.tfcoil_variables, float, range=(0.0, 30.0) ), @@ -310,15 +308,13 @@ def __post_init__(self): "cboot": InputVariable( data_structure.current_drive_variables, float, range=(0.0, 10.0) ), - "cconfix": InputVariable(data_structure.cost_variables, float, range=(50.0, 200.0)), - "cconshpf": InputVariable(data_structure.cost_variables, float, range=(50.0, 200.0)), - "cconshtf": InputVariable(data_structure.cost_variables, float, range=(50.0, 200.0)), + "cconfix": InputVariable("costs", float, range=(50.0, 200.0)), + "cconshpf": InputVariable("costs", float, range=(50.0, 200.0)), + "cconshtf": InputVariable("costs", float, range=(50.0, 200.0)), "cdriv0": InputVariable(data_structure.ife_variables, float, range=(50.0, 500.0)), "cdriv1": InputVariable(data_structure.ife_variables, float, range=(50.0, 500.0)), "cdriv2": InputVariable(data_structure.ife_variables, float, range=(50.0, 500.0)), - "f_t_plant_available": InputVariable( - data_structure.cost_variables, float, range=(0.0, 1.0) - ), + "f_t_plant_available": InputVariable("costs", float, range=(0.0, 1.0)), "chdzl": InputVariable(data_structure.ife_variables, float, range=(0.0, 10.0)), "chdzu": InputVariable(data_structure.ife_variables, float, range=(0.0, 10.0)), "chemlab_h": InputVariable( @@ -331,12 +327,12 @@ def __post_init__(self): data_structure.buildings_variables, float, range=(10.0, 1000.0) ), "chrad": InputVariable(data_structure.ife_variables, float, range=(0.1, 20.0)), - "cland": InputVariable(data_structure.cost_variables, float, range=(10.0, 100.0)), + "cland": InputVariable("costs", float, range=(10.0, 100.0)), "clh2": InputVariable(data_structure.buildings_variables, float, range=(0.0, 30.0)), "j_cs_flat_top_end": InputVariable( data_structure.pfcoil_variables, float, range=(10000.0, 500000000.0) ), - "conf_mag": InputVariable(data_structure.cost_variables, float, range=(0.9, 1.0)), + "conf_mag": InputVariable("costs", float, range=(0.9, 1.0)), "control_buildings_h": InputVariable( data_structure.buildings_variables, float, range=(1.0, 100.0) ), @@ -364,39 +360,19 @@ def __post_init__(self): "copperaoh_m2_max": InputVariable( data_structure.rebco_variables, float, range=(10000.0, 10000000000.0) ), - "cost_factor_bop": InputVariable( - data_structure.cost_variables, float, range=(0.1, 10.0) - ), - "cost_factor_buildings": InputVariable( - data_structure.cost_variables, float, range=(0.1, 10.0) - ), - "cost_factor_fwbs": InputVariable( - data_structure.cost_variables, float, range=(0.1, 10.0) - ), - "cost_factor_land": InputVariable( - data_structure.cost_variables, float, range=(0.1, 10.0) - ), - "cost_factor_misc": InputVariable( - data_structure.cost_variables, float, range=(0.1, 10.0) - ), - "cost_factor_rh": InputVariable( - data_structure.cost_variables, float, range=(0.1, 10.0) - ), - "cost_factor_tf_coils": InputVariable( - data_structure.cost_variables, float, range=(0.1, 10.0) - ), - "cost_factor_vv": InputVariable( - data_structure.cost_variables, float, range=(0.1, 10.0) - ), - "costexp": InputVariable(data_structure.cost_variables, float, range=(0.01, 5.0)), - "costexp_pebbles": InputVariable( - data_structure.cost_variables, float, range=(0.01, 5.0) - ), - "cowner": InputVariable(data_structure.cost_variables, float, range=(0.0, 1.0)), - "cplife_input": InputVariable( - data_structure.cost_variables, float, range=(0.001, 50.0) - ), - "cpstflnc": InputVariable(data_structure.cost_variables, float, range=(0.01, 30.0)), + "cost_factor_bop": InputVariable("costs", float, range=(0.1, 10.0)), + "cost_factor_buildings": InputVariable("costs", float, range=(0.1, 10.0)), + "cost_factor_fwbs": InputVariable("costs", float, range=(0.1, 10.0)), + "cost_factor_land": InputVariable("costs", float, range=(0.1, 10.0)), + "cost_factor_misc": InputVariable("costs", float, range=(0.1, 10.0)), + "cost_factor_rh": InputVariable("costs", float, range=(0.1, 10.0)), + "cost_factor_tf_coils": InputVariable("costs", float, range=(0.1, 10.0)), + "cost_factor_vv": InputVariable("costs", float, range=(0.1, 10.0)), + "costexp": InputVariable("costs", float, range=(0.01, 5.0)), + "costexp_pebbles": InputVariable("costs", float, range=(0.01, 5.0)), + "cowner": InputVariable("costs", float, range=(0.0, 1.0)), + "cplife_input": InputVariable("costs", float, range=(0.001, 50.0)), + "cpstflnc": InputVariable("costs", float, range=(0.01, 30.0)), "c_tf_turn": InputVariable( data_structure.tfcoil_variables, float, range=(0.001, 1000000.0) ), @@ -439,8 +415,8 @@ def __post_init__(self): "p_cryo_plant_electric_max_mw": InputVariable( data_structure.heat_transport_variables, float, range=(0.01, 200.0) ), - "csi": InputVariable(data_structure.cost_variables, float, range=(1.0, 100.0)), - "cturbb": InputVariable(data_structure.cost_variables, float, range=(100.0, 1000.0)), + "csi": InputVariable("costs", float, range=(1.0, 100.0)), + "cturbb": InputVariable("costs", float, range=(100.0, 1000.0)), "dz_vv_lower": InputVariable( data_structure.build_variables, float, range=(0.0, 10.0) ), @@ -463,7 +439,7 @@ def __post_init__(self): "declblkt": InputVariable(data_structure.fwbs_variables, float, range=(0.01, 0.2)), "declfw": InputVariable(data_structure.fwbs_variables, float, range=(0.01, 0.2)), "declshld": InputVariable(data_structure.fwbs_variables, float, range=(0.01, 0.2)), - "decomf": InputVariable(data_structure.cost_variables, float, range=(0.0, 1.0)), + "decomf": InputVariable("costs", float, range=(0.0, 1.0)), "den_steel": InputVariable( data_structure.fwbs_variables, float, range=(5000.0, 10000.0) ), @@ -473,13 +449,9 @@ def __post_init__(self): "dia_tf_turn_superconducting_cable": InputVariable( data_structure.superconducting_tf_coil_variables, float, range=(0.0001, 0.01) ), - "dintrt": InputVariable(data_structure.cost_variables, float, range=(0.0, 0.1)), - "discount_rate": InputVariable( - data_structure.cost_variables, float, range=(0.0, 0.5) - ), - "div_nref": InputVariable( - data_structure.cost_variables, float, range=(1000.0, 100000000.0) - ), + "dintrt": InputVariable("costs", float, range=(0.0, 0.1)), + "discount_rate": InputVariable("costs", float, range=(0.0, 0.5)), + "div_nref": InputVariable("costs", float, range=(1000.0, 100000000.0)), "f_vol_div_coolant": InputVariable( data_structure.divertor_variables, float, range=(0.0, 1.0) ), @@ -571,7 +543,7 @@ def __post_init__(self): ), "drtop": InputVariable(data_structure.tfcoil_variables, float, range=(-1.5, 1.5)), "drveff": InputVariable(data_structure.ife_variables, float, range=(0.01, 1.0)), - "dtlife": InputVariable(data_structure.cost_variables, float, range=(0.0, 15.0)), + "dtlife": InputVariable("costs", float, range=(0.0, 15.0)), "dtstor": InputVariable(data_structure.pulse_variables, float, range=(50.0, 500.0)), "dx_fw_module": InputVariable( data_structure.fwbs_variables, float, range=(0.0005, 0.1) @@ -737,15 +709,15 @@ def __post_init__(self): "fc_building_w": InputVariable( data_structure.buildings_variables, float, range=(10.0, 1000.0) ), - "fcap0": InputVariable(data_structure.cost_variables, float, range=(1.0, 1.5)), - "fcap0cp": InputVariable(data_structure.cost_variables, float, range=(1.0, 1.5)), - "fcdfuel": InputVariable(data_structure.cost_variables, float, range=(0.0, 1.0)), + "fcap0": InputVariable("costs", float, range=(1.0, 1.5)), + "fcap0cp": InputVariable("costs", float, range=(1.0, 1.5)), + "fcdfuel": InputVariable("costs", float, range=(0.0, 1.0)), "f_j_cs_start_pulse_end_flat_top": InputVariable( data_structure.pfcoil_variables, float, range=(0.0, 1.0) ), - "fcontng": InputVariable(data_structure.cost_variables, float, range=(0.0, 1.0)), + "fcontng": InputVariable("costs", float, range=(0.0, 1.0)), "fcoolcp": InputVariable(data_structure.tfcoil_variables, float, range=(0.0, 1.0)), - "fcr0": InputVariable(data_structure.cost_variables, float, range=(0.0, 1.0)), + "fcr0": InputVariable("costs", float, range=(0.0, 1.0)), "fcspc": InputVariable(data_structure.build_variables, float, range=(0.0, 1.0)), "fcuohsu": InputVariable(data_structure.pfcoil_variables, float, range=(0.0, 1.0)), "fcupfsu": InputVariable(data_structure.pfcoil_variables, float, range=(0.0, 1.0)), @@ -779,7 +751,7 @@ def __post_init__(self): ), "fhole": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 1.0)), "fhts": InputVariable(data_structure.tfcoil_variables, float, range=(0.01, 1.0)), - "fkind": InputVariable(data_structure.cost_variables, float, range=(0.5, 1.0)), + "fkind": InputVariable("costs", float, range=(0.5, 1.0)), "f_h_mode_margin": InputVariable( data_structure.constraint_variables, float, range=(0.001, 1000000.0) ), @@ -836,18 +808,10 @@ def __post_init__(self): "fw_th_conductivity": InputVariable( data_structure.fwbs_variables, float, range=(1.0, 100.0) ), - "fwbs_nref": InputVariable( - data_structure.cost_variables, float, range=(1000.0, 100000000.0) - ), - "fwbs_nu": InputVariable( - data_structure.cost_variables, float, range=(1000.0, 100000000.0) - ), - "fwbs_prob_fail": InputVariable( - data_structure.cost_variables, float, range=(0.0, 1.0) - ), - "fwbs_umain_time": InputVariable( - data_structure.cost_variables, float, range=(0.1, 2.0) - ), + "fwbs_nref": InputVariable("costs", float, range=(1000.0, 100000000.0)), + "fwbs_nu": InputVariable("costs", float, range=(1000.0, 100000000.0)), + "fwbs_prob_fail": InputVariable("costs", float, range=(0.0, 1.0)), + "fwbs_umain_time": InputVariable("costs", float, range=(0.1, 2.0)), "fwclfr": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 1.0)), "fwdr": InputVariable(data_structure.ife_variables, float, range=(0.0, 10.0)), "fwdzl": InputVariable(data_structure.ife_variables, float, range=(0.0, 10.0)), @@ -988,7 +952,7 @@ def __post_init__(self): "f_blkt_li6_enrichment": InputVariable( data_structure.fwbs_variables, float, range=(7.4, 100.0) ), - "life_dpa": InputVariable(data_structure.cost_variables, float, range=(10.0, 100.0)), + "life_dpa": InputVariable("costs", float, range=(10.0, 100.0)), "llw_storage_h": InputVariable( data_structure.buildings_variables, float, range=(1.0, 100.0) ), @@ -1028,12 +992,8 @@ def __post_init__(self): "maint_cont_w": InputVariable( data_structure.buildings_variables, float, range=(10.0, 1000.0) ), - "maintenance_fwbs": InputVariable( - data_structure.cost_variables, float, range=(0.0, 1.0) - ), - "maintenance_gen": InputVariable( - data_structure.cost_variables, float, range=(0.0, 1.0) - ), + "maintenance_fwbs": InputVariable("costs", float, range=(0.0, 1.0)), + "maintenance_gen": InputVariable("costs", float, range=(0.0, 1.0)), "max_gyrotron_frequency": InputVariable( data_structure.stellarator_variables, float, @@ -1253,9 +1213,7 @@ def __post_init__(self): ) ), ), - "redun_vacp": InputVariable( - data_structure.cost_variables, float, range=(0.0, 100.0) - ), + "redun_vacp": InputVariable("costs", float, range=(0.0, 100.0)), "residual_sig_hoop": InputVariable("cs_fatigue", float, range=(0.0, 1000000000.0)), "rho_tf_bus": InputVariable( data_structure.tfcoil_variables, float, range=(0.0, 1e-05) @@ -1352,9 +1310,7 @@ def __post_init__(self): "staff_buildings_h": InputVariable( data_structure.buildings_variables, float, range=(1.0, 100.0) ), - "startupratio": InputVariable( - data_structure.cost_variables, float, range=(0.0, 10.0) - ), + "startupratio": InputVariable("costs", float, range=(0.0, 10.0)), "stcl": InputVariable(data_structure.buildings_variables, float, range=(0.0, 10.0)), "str_cs_con_res": InputVariable( data_structure.tfcoil_variables, float, range=(-0.02, 0.02) @@ -1433,13 +1389,11 @@ def __post_init__(self): data_structure.current_drive_variables, float, range=(0.0, 10.0) ), "tbeta": InputVariable(data_structure.physics_variables, float, range=(0.0, 4.0)), - "t_blkt_replace_yrs": InputVariable( - data_structure.cost_variables, float, range=(0.01, 2.0) - ), + "t_blkt_replace_yrs": InputVariable("costs", float, range=(0.01, 2.0)), "tbrmin": InputVariable( data_structure.constraint_variables, float, range=(0.001, 2.0) ), - "tcomrepl": InputVariable(data_structure.cost_variables, float, range=(0.01, 2.0)), + "tcomrepl": InputVariable("costs", float, range=(0.01, 2.0)), "temp_cp_coolant_inlet": InputVariable( data_structure.tfcoil_variables, float, range=(4.0, 373.15) ), @@ -1448,9 +1402,7 @@ def __post_init__(self): data_structure.constraint_variables, float, range=(0.001, 2000000.0) ), "tdiv": InputVariable(data_structure.divertor_variables, float, range=(0.1, 100.0)), - "t_div_replace_yrs": InputVariable( - data_structure.cost_variables, float, range=(0.01, 2.0) - ), + "t_div_replace_yrs": InputVariable("costs", float, range=(0.01, 2.0)), "t_tf_superconductor_quench": InputVariable( data_structure.tfcoil_variables, float, range=(0.1, 100.0) ), @@ -1516,10 +1468,8 @@ def __post_init__(self): "dx_tf_wp_insulation": InputVariable( data_structure.tfcoil_variables, float, range=(0.0, 0.1) ), - "life_plant": InputVariable( - data_structure.cost_variables, float, range=(1.0, 100.0) - ), - "tmain": InputVariable(data_structure.cost_variables, float, range=(0.0, 100.0)), + "life_plant": InputVariable("costs", float, range=(1.0, 100.0)), + "tmain": InputVariable("costs", float, range=(0.0, 100.0)), "tmargmin": InputVariable(data_structure.tfcoil_variables, float, range=(0.0, 20.0)), "temp_cs_superconductor_margin_min": InputVariable( data_structure.tfcoil_variables, float, range=(0.0, 20.0) @@ -1573,99 +1523,61 @@ def __post_init__(self): "tw_storage_w": InputVariable( data_structure.buildings_variables, float, range=(10.0, 1000.0) ), - "u_unplanned_cp": InputVariable( - data_structure.cost_variables, float, range=(0.0, 1.0) - ), - "ucblbe": InputVariable(data_structure.cost_variables, float, range=(1.0, 1000.0)), - "ucblbreed": InputVariable( - data_structure.cost_variables, float, range=(1.0, 1000.0) - ), - "ucblli": InputVariable(data_structure.cost_variables, float, range=(10.0, 10000.0)), - "ucblli2o": InputVariable( - data_structure.cost_variables, float, range=(100.0, 10000.0) - ), - "ucbllipb": InputVariable( - data_structure.cost_variables, float, range=(100.0, 10000.0) - ), - "ucblss": InputVariable(data_structure.cost_variables, float, range=(10.0, 1000.0)), - "ucblvd": InputVariable(data_structure.cost_variables, float, range=(100.0, 1000.0)), - "ucbus": InputVariable(data_structure.cost_variables, float, range=(0.01, 10.0)), + "u_unplanned_cp": InputVariable("costs", float, range=(0.0, 1.0)), + "ucblbe": InputVariable("costs", float, range=(1.0, 1000.0)), + "ucblbreed": InputVariable("costs", float, range=(1.0, 1000.0)), + "ucblli": InputVariable("costs", float, range=(10.0, 10000.0)), + "ucblli2o": InputVariable("costs", float, range=(100.0, 10000.0)), + "ucbllipb": InputVariable("costs", float, range=(100.0, 10000.0)), + "ucblss": InputVariable("costs", float, range=(10.0, 1000.0)), + "ucblvd": InputVariable("costs", float, range=(100.0, 1000.0)), + "ucbus": InputVariable("costs", float, range=(0.01, 10.0)), "uccarb": InputVariable(data_structure.ife_variables, float, range=(10.0, 1000.0)), - "uccase": InputVariable(data_structure.cost_variables, float, range=(1.0, 1000.0)), + "uccase": InputVariable("costs", float, range=(1.0, 1000.0)), "ucconc": InputVariable(data_structure.ife_variables, float, range=(0.1, 1000.0)), - "uccpcl1": InputVariable(data_structure.cost_variables, float, range=(1.0, 1000.0)), - "uccpclb": InputVariable(data_structure.cost_variables, float, range=(1.0, 1000.0)), - "uccry": InputVariable( - data_structure.cost_variables, float, range=(10000.0, 1000000.0) - ), - "uccryo": InputVariable(data_structure.cost_variables, float, range=(1.0, 1000.0)), - "uccu": InputVariable(data_structure.cost_variables, float, range=(10.0, 100.0)), - "ucdiv": InputVariable( - data_structure.cost_variables, float, range=(1000.0, 10000000.0) - ), - "ucech": InputVariable(data_structure.cost_variables, float, range=(1.0, 10.0)), - "ucf1": InputVariable( - data_structure.cost_variables, float, range=(1000000.0, 50000000.0) - ), + "uccpcl1": InputVariable("costs", float, range=(1.0, 1000.0)), + "uccpclb": InputVariable("costs", float, range=(1.0, 1000.0)), + "uccry": InputVariable("costs", float, range=(10000.0, 1000000.0)), + "uccryo": InputVariable("costs", float, range=(1.0, 1000.0)), + "uccu": InputVariable("costs", float, range=(10.0, 100.0)), + "ucdiv": InputVariable("costs", float, range=(1000.0, 10000000.0)), + "ucech": InputVariable("costs", float, range=(1.0, 10.0)), + "ucf1": InputVariable("costs", float, range=(1000000.0, 50000000.0)), "ucflib": InputVariable(data_structure.ife_variables, float, range=(10.0, 1000.0)), - "ucfnc": InputVariable(data_structure.cost_variables, float, range=(10.0, 100.0)), - "ucfuel": InputVariable(data_structure.cost_variables, float, range=(1.0, 10.0)), - "uche3": InputVariable( - data_structure.cost_variables, float, range=(100000.0, 10000000.0) - ), - "uchrs": InputVariable( - data_structure.cost_variables, float, range=(10000000.0, 500000000.0) - ), - "uciac": InputVariable( - data_structure.cost_variables, float, range=(10000000.0, 1000000000.0) - ), - "ucich": InputVariable(data_structure.cost_variables, float, range=(1.0, 10.0)), - "uclh": InputVariable(data_structure.cost_variables, float, range=(1.0, 10.0)), - "ucme": InputVariable( - data_structure.cost_variables, float, range=(10000000.0, 1000000000.0) - ), - "ucmisc": InputVariable( - data_structure.cost_variables, float, range=(10000000.0, 50000000.0) - ), - "ucnbi": InputVariable(data_structure.cost_variables, float, range=(1.0, 10.0)), - "ucpens": InputVariable(data_structure.cost_variables, float, range=(1.0, 100.0)), - "ucpfb": InputVariable(data_structure.cost_variables, float, range=(1.0, 1000.0)), - "ucpfbk": InputVariable( - data_structure.cost_variables, float, range=(1000.0, 100000.0) - ), - "ucpfbs": InputVariable( - data_structure.cost_variables, float, range=(1000.0, 10000.0) - ), - "ucpfcb": InputVariable( - data_structure.cost_variables, float, range=(1000.0, 100000.0) - ), - "ucpfdr1": InputVariable(data_structure.cost_variables, float, range=(1.0, 1000.0)), - "ucpfic": InputVariable( - data_structure.cost_variables, float, range=(1000.0, 100000.0) - ), - "ucpfps": InputVariable( - data_structure.cost_variables, float, range=(1000.0, 100000.0) - ), - "ucrb": InputVariable(data_structure.cost_variables, float, range=(100.0, 1000.0)), - "ucshld": InputVariable(data_structure.cost_variables, float, range=(1.0, 100.0)), + "ucfnc": InputVariable("costs", float, range=(10.0, 100.0)), + "ucfuel": InputVariable("costs", float, range=(1.0, 10.0)), + "uche3": InputVariable("costs", float, range=(100000.0, 10000000.0)), + "uchrs": InputVariable("costs", float, range=(10000000.0, 500000000.0)), + "uciac": InputVariable("costs", float, range=(10000000.0, 1000000000.0)), + "ucich": InputVariable("costs", float, range=(1.0, 10.0)), + "uclh": InputVariable("costs", float, range=(1.0, 10.0)), + "ucme": InputVariable("costs", float, range=(10000000.0, 1000000000.0)), + "ucmisc": InputVariable("costs", float, range=(10000000.0, 50000000.0)), + "ucnbi": InputVariable("costs", float, range=(1.0, 10.0)), + "ucpens": InputVariable("costs", float, range=(1.0, 100.0)), + "ucpfb": InputVariable("costs", float, range=(1.0, 1000.0)), + "ucpfbk": InputVariable("costs", float, range=(1000.0, 100000.0)), + "ucpfbs": InputVariable("costs", float, range=(1000.0, 10000.0)), + "ucpfcb": InputVariable("costs", float, range=(1000.0, 100000.0)), + "ucpfdr1": InputVariable("costs", float, range=(1.0, 1000.0)), + "ucpfic": InputVariable("costs", float, range=(1000.0, 100000.0)), + "ucpfps": InputVariable("costs", float, range=(1000.0, 100000.0)), + "ucrb": InputVariable("costs", float, range=(100.0, 1000.0)), + "ucshld": InputVariable("costs", float, range=(1.0, 100.0)), "uctarg": InputVariable(data_structure.ife_variables, float, range=(0.1, 1000.0)), - "uctfbr": InputVariable(data_structure.cost_variables, float, range=(1.0, 10.0)), - "uctfbus": InputVariable(data_structure.cost_variables, float, range=(1.0, 1000.0)), - "uctfps": InputVariable(data_structure.cost_variables, float, range=(1.0, 1000.0)), - "uctfsw": InputVariable(data_structure.cost_variables, float, range=(0.1, 10.0)), - "ucwindpf": InputVariable( - data_structure.cost_variables, float, range=(100.0, 1000.0) - ), - "ucwindtf": InputVariable( - data_structure.cost_variables, float, range=(100.0, 1000.0) - ), - "uubop": InputVariable(data_structure.cost_variables, float, range=(0.005, 0.1)), - "uucd": InputVariable(data_structure.cost_variables, float, range=(0.005, 0.1)), - "uudiv": InputVariable(data_structure.cost_variables, float, range=(0.005, 0.1)), - "uufuel": InputVariable(data_structure.cost_variables, float, range=(0.005, 0.1)), - "uufw": InputVariable(data_structure.cost_variables, float, range=(0.005, 0.1)), - "uumag": InputVariable(data_structure.cost_variables, float, range=(0.005, 0.1)), - "uuves": InputVariable(data_structure.cost_variables, float, range=(0.005, 0.1)), + "uctfbr": InputVariable("costs", float, range=(1.0, 10.0)), + "uctfbus": InputVariable("costs", float, range=(1.0, 1000.0)), + "uctfps": InputVariable("costs", float, range=(1.0, 1000.0)), + "uctfsw": InputVariable("costs", float, range=(0.1, 10.0)), + "ucwindpf": InputVariable("costs", float, range=(100.0, 1000.0)), + "ucwindtf": InputVariable("costs", float, range=(100.0, 1000.0)), + "uubop": InputVariable("costs", float, range=(0.005, 0.1)), + "uucd": InputVariable("costs", float, range=(0.005, 0.1)), + "uudiv": InputVariable("costs", float, range=(0.005, 0.1)), + "uufuel": InputVariable("costs", float, range=(0.005, 0.1)), + "uufw": InputVariable("costs", float, range=(0.005, 0.1)), + "uumag": InputVariable("costs", float, range=(0.005, 0.1)), + "uuves": InputVariable("costs", float, range=(0.005, 0.1)), "v1dr": InputVariable(data_structure.ife_variables, float, range=(0.0, 10.0)), "v1dzl": InputVariable(data_structure.ife_variables, float, range=(0.0, 10.0)), "v1dzu": InputVariable(data_structure.ife_variables, float, range=(0.0, 10.0)), @@ -1760,14 +1672,14 @@ def __post_init__(self): "breedmat": InputVariable(data_structure.fwbs_variables, int, choices=[1, 2, 3]), "ccl0_ma": InputVariable(data_structure.pfcoil_variables, float, array=True), "ccls_ma": InputVariable(data_structure.pfcoil_variables, float, array=True), - "cfind": InputVariable(data_structure.cost_variables, float, array=True), + "cfind": InputVariable("costs", float, array=True), "i_blkt_coolant_type": InputVariable( data_structure.fwbs_variables, int, choices=[1, 2] ), "coppera_m2_max": InputVariable( data_structure.rebco_variables, float, range=(1.0e6, 1.0e10) ), - "cost_model": InputVariable(data_structure.cost_variables, int, choices=[0, 1, 2]), + "cost_model": InputVariable("costs", int, choices=[0, 1, 2]), "i_vac_pump_dwell": InputVariable("vacuum", int, choices=[0, 1, 2]), "i_fw_blkt_vv_shape": InputVariable( data_structure.fwbs_variables, int, range=(1, 2) @@ -1792,7 +1704,7 @@ def __post_init__(self): data_structure.physics_variables, int, range=(0, 13) ), "i_cp_joints": InputVariable(data_structure.tfcoil_variables, int, choices=[0, 1]), - "i_cp_lifetime": InputVariable(data_structure.cost_variables, int, range=(0, 3)), + "i_cp_lifetime": InputVariable("costs", int, range=(0, 3)), "i_cs_precomp": InputVariable(data_structure.build_variables, int, choices=[0, 1]), "i_cs_stress": InputVariable(data_structure.pfcoil_variables, int, choices=[0, 1]), "i_density_limit": InputVariable( @@ -1864,10 +1776,8 @@ def __post_init__(self): "i_tf_wp_geom": InputVariable( data_structure.tfcoil_variables, int, choices=[0, 1, 2] ), - "i_plant_availability": InputVariable( - data_structure.cost_variables, int, range=(0, 3) - ), - "ibkt_life": InputVariable(data_structure.cost_variables, int, choices=[0, 1, 2]), + "i_plant_availability": InputVariable("costs", int, range=(0, 3)), + "ibkt_life": InputVariable("costs", int, choices=[0, 1, 2]), "i_blkt_dual_coolant": InputVariable( data_structure.fwbs_variables, int, choices=[0, 1, 2] ), @@ -1883,7 +1793,7 @@ def __post_init__(self): "ife": InputVariable(data_structure.ife_variables, int, choices=[0, 1]), "ifedrv": InputVariable(data_structure.ife_variables, int, range=(-1, 3)), "ifetyp": InputVariable(data_structure.ife_variables, int, range=(0, 4)), - "ifueltyp": InputVariable(data_structure.cost_variables, int, choices=[0, 1, 2]), + "ifueltyp": InputVariable("costs", int, choices=[0, 1, 2]), "i_plasma_ignited": InputVariable( data_structure.physics_variables, int, choices=[0, 1] ), @@ -1898,7 +1808,7 @@ def __post_init__(self): "i_pf_conductor": InputVariable( data_structure.pfcoil_variables, int, choices=[0, 1] ), - "ipnet": InputVariable(data_structure.cost_variables, int, choices=[0, 1]), + "ipnet": InputVariable("costs", int, choices=[0, 1]), "ipowerflow": InputVariable( data_structure.heat_transport_variables, int, choices=[0, 1] ), @@ -1915,7 +1825,7 @@ def __post_init__(self): "i_fw_blkt_shared_coolant": InputVariable( data_structure.fwbs_variables, int, choices=[0, 1, 2] ), - "ireactor": InputVariable(data_structure.cost_variables, int, choices=[0, 1]), + "ireactor": InputVariable("costs", int, choices=[0, 1]), "irefprop": InputVariable(data_structure.fwbs_variables, int, choices=[0, 1]), "i_hcd_calculations": InputVariable( data_structure.current_drive_variables, int, choices=[0, 1] @@ -1938,7 +1848,7 @@ def __post_init__(self): "i_pflux_fw_neutron": InputVariable( data_structure.physics_variables, int, range=(1, 2) ), - "lsa": InputVariable(data_structure.cost_variables, int, range=(1, 4)), + "lsa": InputVariable("costs", int, range=(1, 4)), "m_res": InputVariable(data_structure.stellarator_variables, int, range=(1, 10)), "n_tf_wp_layers": InputVariable( data_structure.tfcoil_variables, int, range=(1, 100) @@ -1977,8 +1887,8 @@ def __post_init__(self): "nphcdin": InputVariable(data_structure.fwbs_variables, int, range=(0, 4)), "nphcdout": InputVariable(data_structure.fwbs_variables, int, range=(0, 4)), "i_vacuum_pump_type": InputVariable("vacuum", int, choices=[0, 1]), - "num_rh_systems": InputVariable(data_structure.cost_variables, int, range=(1, 10)), - "output_costs": InputVariable(data_structure.cost_variables, int, choices=[0, 1]), + "num_rh_systems": InputVariable("costs", int, range=(1, 10)), + "output_costs": InputVariable("costs", int, choices=[0, 1]), "i_p_coolant_pumping": InputVariable( data_structure.fwbs_variables, int, range=(0, 3) ), @@ -1990,9 +1900,7 @@ def __post_init__(self): "secondary_cycle_liq": InputVariable( data_structure.fwbs_variables, int, range=(2, 4) ), - "supercond_cost_model": InputVariable( - data_structure.cost_variables, int, choices=[0, 1] - ), + "supercond_cost_model": InputVariable("costs", int, choices=[0, 1]), "i_tf_inside_cs": InputVariable(data_structure.build_variables, int, choices=[0, 1]), "i_ecrh_wave_mode": InputVariable( data_structure.current_drive_variables, int, choices=[0, 1] @@ -2030,11 +1938,11 @@ def __post_init__(self): data_structure.pfcoil_variables, float, array=True ), "zref": InputVariable(data_structure.pfcoil_variables, float, array=True), - "uchts": InputVariable(data_structure.cost_variables, float, array=True), - "ucoam": InputVariable(data_structure.cost_variables, float, array=True), - "ucsc": InputVariable(data_structure.cost_variables, float, array=True), - "ucturb": InputVariable(data_structure.cost_variables, float, array=True), - "ucwst": InputVariable(data_structure.cost_variables, float, array=True), + "uchts": InputVariable("costs", float, array=True), + "ucoam": InputVariable("costs", float, array=True), + "ucsc": InputVariable("costs", float, array=True), + "ucturb": InputVariable("costs", float, array=True), + "ucwst": InputVariable("costs", float, array=True), "blmatf": InputVariable(data_structure.ife_variables, float, array=True), "chmatf": InputVariable(data_structure.ife_variables, float, array=True), "etave": InputVariable(data_structure.ife_variables, float, array=True), diff --git a/process/core/model.py b/process/core/model.py index bad11bc262..d4a69cda28 100644 --- a/process/core/model.py +++ b/process/core/model.py @@ -2,6 +2,7 @@ from dataclasses import dataclass, fields from process.data_structure.cost_2015_variables import Cost2015Data +from process.data_structure.cost_variables import CostData from process.data_structure.cs_fatigue_variables import CSFatigueData from process.data_structure.vacuum_variables import VacuumData from process.data_structure.water_usage_variables import WaterUseData @@ -15,6 +16,7 @@ class DataStructure: costs_2015: Cost2015Data = initialise_later cs_fatigue: CSFatigueData = initialise_later vacuum: VacuumData = initialise_later + costs: CostData = initialise_later def __post_init__(self): for f in fields(self): diff --git a/process/core/scan.py b/process/core/scan.py index e8273f18e0..4f6885bf0a 100644 --- a/process/core/scan.py +++ b/process/core/scan.py @@ -15,7 +15,6 @@ from process.data_structure import ( build_variables, constraint_variables, - cost_variables, current_drive_variables, divertor_variables, fwbs_variables, @@ -1103,11 +1102,11 @@ def scan_select(self, nwp, swp, iscn): case 20: constraint_variables.t_burn_min = swp[iscn - 1] case 22: - if cost_variables.i_plant_availability == 1: + if self.data.costs.i_plant_availability == 1: raise ProcessValueError( "Do not scan f_t_plant_available if i_plant_availability=1" ) - cost_variables.f_t_plant_available = swp[iscn - 1] + self.data.costs.f_t_plant_available = swp[iscn - 1] case 24: constraint_variables.p_fusion_total_max_mw = swp[iscn - 1] case 25: @@ -1205,9 +1204,9 @@ def scan_select(self, nwp, swp, iscn): case 76: heat_transport_variables.eta_turbine = swp[iscn - 1] case 77: - cost_variables.startupratio = swp[iscn - 1] + self.data.costs.startupratio = swp[iscn - 1] case 78: - cost_variables.fkind = swp[iscn - 1] + self.data.costs.fkind = swp[iscn - 1] case 79: current_drive_variables.eta_ecrh_injector_wall_plug = swp[iscn - 1] case 80: diff --git a/process/core/solver/constraints.py b/process/core/solver/constraints.py index d383fd4eea..cff9ab9a8a 100644 --- a/process/core/solver/constraints.py +++ b/process/core/solver/constraints.py @@ -1315,15 +1315,15 @@ def constraint_equation_60(constraint_registration, _data): @ConstraintManager.register_constraint(61, "", ">=") -def constraint_equation_61(constraint_registration, _data): +def constraint_equation_61(constraint_registration, data): """Equation for availability lower limit f_t_plant_available: Total plant availability fraction avail_min: Minimum availability """ return geq( - data_structure.cost_variables.f_t_plant_available, - data_structure.cost_variables.avail_min, + data.costs.f_t_plant_available, + data.costs.avail_min, constraint_registration, ) @@ -1715,7 +1715,7 @@ def constraint_equation_84(constraint_registration, _data): @ConstraintManager.register_constraint(85, "years", "=") -def constraint_equation_85(constraint_registration, _data): +def constraint_equation_85(constraint_registration, data): """Equality constraint for the centerpost (CP) lifetime Depending on the chosen option i_cp_lifetime: @@ -1731,20 +1731,20 @@ def constraint_equation_85(constraint_registration, _data): the CP lifetime must equate """ # The CP lifetime is equal to the the divertor one - if data_structure.cost_variables.i_cp_lifetime == 0: - bound = data_structure.cost_variables.cplife_input + if data.costs.i_cp_lifetime == 0: + bound = data.costs.cplife_input - elif data_structure.cost_variables.i_cp_lifetime == 1: - bound = data_structure.cost_variables.life_div_fpy + elif data.costs.i_cp_lifetime == 1: + bound = data.costs.life_div_fpy # The CP lifetime is equal to the tritium breeding blankets / FW one - elif data_structure.cost_variables.i_cp_lifetime == 2: + elif data.costs.i_cp_lifetime == 2: bound = data_structure.fwbs_variables.life_blkt_fpy - elif data_structure.cost_variables.i_cp_lifetime == 3: - bound = data_structure.cost_variables.life_plant + elif data.costs.i_cp_lifetime == 3: + bound = data.costs.life_plant - return eq(data_structure.cost_variables.cplife, bound, constraint_registration) + return eq(data.costs.cplife, bound, constraint_registration) @ConstraintManager.register_constraint(86, "m", "<=") @@ -1810,11 +1810,8 @@ def constraint_equation_90(constraint_registration, data): n_cycle: Allowable number of cycles for CS n_cycle_min: Minimum required cycles for CS """ - if ( - data_structure.cost_variables.ibkt_life == 1 - and data.cs_fatigue.bkt_life_csf == 1 - ): - data.cs_fatigue.n_cycle_min = data_structure.cost_variables.bktcycles + if data.costs.ibkt_life == 1 and data.cs_fatigue.bkt_life_csf == 1: + data.cs_fatigue.n_cycle_min = data.costs.bktcycles return geq( data.cs_fatigue.n_cycle, diff --git a/process/core/solver/evaluators.py b/process/core/solver/evaluators.py index 3b65f8325f..7e162dd028 100644 --- a/process/core/solver/evaluators.py +++ b/process/core/solver/evaluators.py @@ -4,7 +4,6 @@ import numpy as np from process.core.caller import Caller -from process.data_structure import cost_variables as cv from process.data_structure import global_variables as gv from process.data_structure import numerics from process.data_structure import physics_variables as pv @@ -28,6 +27,7 @@ def __init__(self, models, data, _x): :type x: np.ndarray """ self.caller = Caller(models, data) + self.data = data def fcnvmc1(self, _n, m, xv, ifail): """Function evaluator for VMCON. @@ -75,7 +75,7 @@ def fcnvmc1(self, _n, m, xv, ifail): logger.debug(f"{(1 - (ifail % 7)) - 1 = }") logger.debug(f"{(numerics.nviter % 2) - 1 = }") logger.debug(f"{pv.temp_plasma_electron_vol_avg_kev = }") - logger.debug(f"{cv.coe = }") + logger.debug(f"{self.data.costs.coe = }") logger.debug(f"{pv.rmajor = }") logger.debug(f"{pv.p_fusion_total_mw = }") logger.debug(f"{pv.b_plasma_toroidal_on_axis = }") diff --git a/process/core/solver/objectives.py b/process/core/solver/objectives.py index de362eef39..b6e013bc11 100644 --- a/process/core/solver/objectives.py +++ b/process/core/solver/objectives.py @@ -1,8 +1,8 @@ import numpy as np from process.core.exceptions import ProcessValueError +from process.core.model import DataStructure from process.data_structure import ( - cost_variables, current_drive_variables, divertor_variables, heat_transport_variables, @@ -32,7 +32,7 @@ } -def objective_function(minmax: int) -> float: +def objective_function(minmax: int, data: DataStructure) -> float: """Calculate the specified objective function Parameters @@ -57,6 +57,9 @@ def objective_function(minmax: int) -> float: * 17: Net electrical output * 18: NULL, f(x) = 1 * 19: Major radius/burn time + data: DataStructure + data structure object for providing data to the + objective function """ figure_of_merit = abs(minmax) @@ -80,12 +83,12 @@ def objective_function(minmax: int) -> float: + physics_variables.p_plasma_ohmic_mw ) case 6: - objective_metric = cost_variables.coe / 100.0 + objective_metric = data.costs.coe / 100.0 case 7: objective_metric = ( - cost_variables.cdirt / 1.0e3 - if cost_variables.ireactor == 0 - else cost_variables.concost / 1.0e4 + data.costs.cdirt / 1.0e3 + if data.costs.ireactor == 0 + else data.costs.concost / 1.0e4 ) case 8: objective_metric = physics_variables.aspect @@ -98,9 +101,9 @@ def objective_function(minmax: int) -> float: case 14: objective_metric = times_variables.t_plant_pulse_burn / 2.0e4 case 15: - if cost_variables.i_plant_availability != 1: + if data.costs.i_plant_availability != 1: raise ProcessValueError("minmax=15 requires i_plant_availability=1") - objective_metric = cost_variables.f_t_plant_available + objective_metric = data.costs.f_t_plant_available case 16: objective_metric = 0.95 * (physics_variables.rmajor / 9.0) - 0.05 * ( times_variables.t_plant_pulse_burn / 7200.0 diff --git a/process/data_structure/cost_variables.py b/process/data_structure/cost_variables.py index a1857c241d..5c2070e566 100644 --- a/process/data_structure/cost_variables.py +++ b/process/data_structure/cost_variables.py @@ -1,1582 +1,818 @@ -c228: float = None -"""c228 account cost""" +from dataclasses import dataclass, field -c229: float = None -"""c229 account cost""" -c23: float = None -"""c23 account cost""" +@dataclass +class CostData: + c228: float = 0.0 + """c228 account cost""" -c25: float = None -"""c25 account cost""" + c229: float = 0.0 + """c229 account cost""" -c26: float = None -"""c26 account cost""" + c23: float = 0.0 + """c23 account cost""" -cindrt: float = None -"""cindrt account cost""" + c25: float = 0.0 + """c25 account cost""" -ccont: float = None -"""ccont account cost""" + c26: float = 0.0 + """c26 account cost""" -c226: float = None + cindrt: float = 0.0 + """cindrt account cost""" -c2261: float = None + ccont: float = 0.0 + """ccont account cost""" -c2262: float = None + c226: float = 0.0 -c2263: float = None + c2261: float = 0.0 -c227: float = None + c2262: float = 0.0 -c2271: float = None + c2263: float = 0.0 -c2272: float = None + c227: float = 0.0 -c2273: float = None + c2271: float = 0.0 -c2274: float = None + c2272: float = 0.0 -c24: float = None + c2273: float = 0.0 -c241: float = None + c2274: float = 0.0 -c242: float = None + c24: float = 0.0 -c243: float = None + c241: float = 0.0 -c244: float = None + c242: float = 0.0 -c245: float = None + c243: float = 0.0 -c21: float = None + c244: float = 0.0 -c211: float = None + c245: float = 0.0 -c212: float = None + c21: float = 0.0 -c213: float = None + c211: float = 0.0 -c214: float = None + c212: float = 0.0 -c2141: float = None + c213: float = 0.0 -c2142: float = None + c214: float = 0.0 -c215: float = None + c2141: float = 0.0 -c216: float = None + c2142: float = 0.0 -c217: float = None + c215: float = 0.0 -c2171: float = None + c216: float = 0.0 -c2172: float = None + c217: float = 0.0 -c2173: float = None + c2171: float = 0.0 -c2174: float = None + c2172: float = 0.0 -c22: float = None + c2173: float = 0.0 -c2211: float = None + c2174: float = 0.0 -c2212: float = None + c22: float = 0.0 -c22121: float = None + c2211: float = 0.0 -c22122: float = None + c2212: float = 0.0 -c22123: float = None + c22121: float = 0.0 -c22124: float = None + c22122: float = 0.0 -c22125: float = None + c22123: float = 0.0 -c22126: float = None + c22124: float = 0.0 -c22127: float = None + c22125: float = 0.0 -c2213: float = None + c22126: float = 0.0 -c22131: float = None + c22127: float = 0.0 -c22132: float = None + c2213: float = 0.0 -c2214: float = None + c22131: float = 0.0 -c2215: float = None + c22132: float = 0.0 -c2221: float = None + c2214: float = 0.0 -c22211: float = None + c2215: float = 0.0 -c22212: float = None + c2221: float = 0.0 -c22213: float = None + c22211: float = 0.0 -c22214: float = None + c22212: float = 0.0 -c22215: float = None + c22213: float = 0.0 -c2222: float = None + c22214: float = 0.0 -c22221: float = None + c22215: float = 0.0 -c22222: float = None + c2222: float = 0.0 -c22223: float = None + c22221: float = 0.0 -c22224: float = None + c22222: float = 0.0 -c2223: float = None + c22223: float = 0.0 -c223: float = None + c22224: float = 0.0 -c2231: float = None + c2223: float = 0.0 -c2232: float = None + c223: float = 0.0 -c2233: float = None + c2231: float = 0.0 -c2234: float = None + c2232: float = 0.0 -c224: float = None + c2233: float = 0.0 -c2241: float = None + c2234: float = 0.0 -c2242: float = None + c224: float = 0.0 -c2243: float = None + c2241: float = 0.0 -c2244: float = None + c2242: float = 0.0 -c2245: float = None + c2243: float = 0.0 -c2246: float = None + c2244: float = 0.0 -c225: float = None + c2245: float = 0.0 -c2251: float = None + c2246: float = 0.0 -c22511: float = None + c225: float = 0.0 -c22512: float = None + c2251: float = 0.0 -c22513: float = None + c22511: float = 0.0 -c22514: float = None + c22512: float = 0.0 -c22515: float = None + c22513: float = 0.0 -c2252: float = None + c22514: float = 0.0 -c22521: float = None + c22515: float = 0.0 -c22522: float = None + c2252: float = 0.0 -c22523: float = None + c22521: float = 0.0 -c22524: float = None + c22522: float = 0.0 -c22525: float = None + c22523: float = 0.0 -c22526: float = None + c22524: float = 0.0 -c22527: float = None + c22525: float = 0.0 -c2253: float = None + c22526: float = 0.0 -chx: float = None + c22527: float = 0.0 -cpp: float = None + c2253: float = 0.0 -cppa: float = None + chx: float = 0.0 -c22128: float = None + cpp: float = 0.0 -abktflnc: float = None -"""allowable first wall/blanket neutron fluence (MW-yr/m2) (`blktmodel=0`)""" + cppa: float = 0.0 + c22128: float = 0.0 -adivflnc: float = None -"""allowable divertor heat fluence (MW-yr/m2)""" + abktflnc: float = 5.0 + """allowable first wall/blanket neutron fluence (MW-yr/m2) (`blktmodel=0`)""" + adivflnc: float = 7.0 + """allowable divertor heat fluence (MW-yr/m2)""" -blkcst: float = None -"""blanket direct cost (M$)""" + blkcst: float = 0.0 + """blanket direct cost (M$)""" + c221: float = 0.0 + """total account 221 cost (M$) - first wall, blanket, shield, support structure and div plates""" -c221: float = None -"""total account 221 cost (M$) - first wall, blanket, shield, support structure and div plates""" + c222: float = 0.0 + """total account 222 cost (M$) - TF coils + PF coils""" + capcost: float = 0.0 + """total capital cost including interest (M$)""" -c222: float = None -"""total account 222 cost (M$) - TF coils + PF coils""" + cconfix: float = 80.0 + """fixed cost of superconducting cable ($/m)""" + cconshpf: float = 70.0 + """cost of PF coil steel conduit/sheath ($/m)""" -capcost: float = None -"""total capital cost including interest (M$)""" + cconshtf: float = 75.0 + """cost of TF coil steel conduit/sheath ($/m)""" + cdcost: float = 0.0 + """current drive direct costs (M$)""" -cconfix: float = None -"""fixed cost of superconducting cable ($/m)""" + cdirt: float = 0.0 + """total plant direct cost (M$)""" + life_hcd_fpy: float = 0.0 + """Full power year lifetime of heating/current drive system (y)""" -cconshpf: float = None -"""cost of PF coil steel conduit/sheath ($/m)""" + cdrlife_cal: float = 0.0 + """Calendar year lifetime of heating/current drive system (y)""" + f_t_plant_available: float = 0.75 + """Total plant availability fraction; input if `i_plant_availability=0`""" -cconshtf: float = None -"""cost of TF coil steel conduit/sheath ($/m)""" + cpfact: float = 0.0 + """Total plant capacity factor""" + cfind: list[float] = field(default_factory=lambda: [0.244, 0.244, 0.244, 0.29]) + """indirect cost factor (func of lsa) (cost model = 0)""" -cdcost: float = None -"""current drive direct costs (M$)""" + cland: float = 19.2 + """cost of land (M$)""" + coe: float = 0.0 + """cost of electricity ($/MW-hr)""" -cdirt: float = None -"""total plant direct cost (M$)""" + coecap: float = 0.0 + """capital cost of electricity (m$/kW-hr)""" + coefuelt: float = 0.0 + """'fuel' (including replaceable components) contribution to cost of electricity (m$/kW-hr)""" -life_hcd_fpy: float = None -"""Full power year lifetime of heating/current drive system (y)""" + coeoam: float = 0.0 + """operation and maintenance contribution to cost of electricity (m$/kW-hr)""" + concost: float = 0.0 + """plant construction cost (M$)""" -cdrlife_cal: float = None -"""Calendar year lifetime of heating/current drive system (y)""" + costexp: float = 0.8 + """cost exponent for scaling in 2015 costs model""" + costexp_pebbles: float = 0.6 + """cost exponent for pebbles in 2015 costs model""" -f_t_plant_available: float = None -"""Total plant availability fraction; input if `i_plant_availability=0`""" + cost_factor_buildings: float = 1.0 + """cost scaling factor for buildings""" + cost_factor_land: float = 1.0 + """cost scaling factor for land""" -cpfact: float = None -"""Total plant capacity factor""" + cost_factor_tf_coils: float = 1.0 + """cost scaling factor for TF coils""" + cost_factor_fwbs: float = 1.0 + """cost scaling factor for fwbs""" -cfind: list[float] = None -"""indirect cost factor (func of lsa) (cost model = 0)""" + cost_factor_rh: float = 1.0 + """cost scaling factor for remote handling""" + cost_factor_vv: float = 1.0 + """cost scaling factor for vacuum vessel""" -cland: float = None -"""cost of land (M$)""" + cost_factor_bop: float = 1.0 + """cost scaling factor for energy conversion system""" + cost_factor_misc: float = 1.0 + """cost scaling factor for remaining subsystems""" -coe: float = None -"""cost of electricity ($/MW-hr)""" + maintenance_fwbs: float = 0.2 + """Maintenance cost factor: first wall, blanket, shield, divertor""" + maintenance_gen: float = 0.05 + """Maintenance cost factor: All other components except coils, vacuum vessel, + thermal shield, cryostat, land""" -coecap: float = None -"""capital cost of electricity (m$/kW-hr)""" + amortization: float = 13.6 + """amortization factor (fixed charge factor) "A" (years)""" + cost_model: int = 1 + """Switch for cost model: + - =0 use $ 1990 PROCESS model + - =1 use $ 2014 Kovari model + - =2 use user-provided model + """ -coefuelt: float = None -"""'fuel' (including replaceable components) contribution to cost of electricity (m$/kW-hr)""" + i_cp_lifetime: int = 0 + """Switch for the centrepost lifetime constraint + 0 : The CP full power year lifetime is set by the user via cplife_input + 1 : The CP lifetime is equal to the divertor lifetime + 2 : The CP lifetime is equal to the breeding blankets lifetime + 3 : The CP lifetime is equal to the plant lifetime + """ + cowner: float = 0.15 + """owner cost factor""" -coeoam: float = None -"""operation and maintenance contribution to cost of electricity (m$/kW-hr)""" + cplife_input: float = 2.0 + """User input full power year lifetime of the centrepost (years) (i_cp_lifetime = 0)""" + cplife: float = 0.0 + """Calculated full power year lifetime of centrepost (years)""" -concost: float = None -"""plant construction cost (M$)""" + cplife_cal: float = 0.0 + """Calculated calendar year lifetime of centrepost (years)""" + cpstcst: float = 0.0 + """ST centrepost direct cost (M$)""" -costexp: float = None -"""cost exponent for scaling in 2015 costs model""" + cpstflnc: float = 10.0 + """allowable ST centrepost neutron fluence (MW-yr/m2)""" + crctcore: float = 0.0 + """reactor core costs (categories 221, 222 and 223)""" -costexp_pebbles: float = None -"""cost exponent for pebbles in 2015 costs model""" + csi: float = 16.0 + """allowance for site costs (M$)""" + cturbb: float = 38.0 + """cost of turbine building (M$)""" -cost_factor_buildings: float = None -"""cost scaling factor for buildings""" + decomf: float = 0.1 + """proportion of constructed cost required for decommissioning fund""" + dintrt: float = 0.0 + """diff between borrowing and saving interest rates""" -cost_factor_land: float = None -"""cost scaling factor for land""" + divcst: float = 0.0 + """divertor direct cost (M$)""" + life_div_fpy: float = 0.0 + """Full power year lifetime of divertor (fpy)""" -cost_factor_tf_coils: float = None -"""cost scaling factor for TF coils""" + life_div: float = 0.0 + """Calendar year lifetime of divertor (y)""" + dtlife: float = 0.0 + """period prior to the end of the plant life that the decommissioning fund is used (years)""" -cost_factor_fwbs: float = None -"""cost scaling factor for fwbs""" + fcap0: float = 1.165 + """average cost of money for construction of plant assuming design/construction time of six years""" + fcap0cp: float = 1.08 + """average cost of money for replaceable components assuming lead time for these of two years""" -cost_factor_rh: float = None -"""cost scaling factor for remote handling""" + fcdfuel: float = 0.1 + """fraction of current drive cost treated as fuel (if `ifueltyp = 1`)""" + fcontng: float = 0.195 + """project contingency factor""" -cost_factor_vv: float = None -"""cost scaling factor for vacuum vessel""" + fcr0: float = 0.0966 + """fixed charge rate during construction""" + fkind: float = 1.0 + """multiplier for Nth of a kind costs""" -cost_factor_bop: float = None -"""cost scaling factor for energy conversion system""" + fwallcst: float = 0.0 + """first wall cost (M$)""" + i_plant_availability: int = 2 + """Switch for plant availability model: + - =0 use input value for f_t_plant_available + - =1 calculate f_t_plant_available using Taylor and Ward 1999 model + - =2 calculate f_t_plant_available using new (2015) model + - =3 calculate f_t_plant_available using ST model + """ -cost_factor_misc: float = None -"""cost scaling factor for remaining subsystems""" + ibkt_life: int = 0 + """Switch for fw/blanket lifetime calculation in availability module: + - =0 use neutron fluence model + - =1 use fusion power model (DEMO only)""" + life_dpa: float = 50 + """Allowable DPA from DEMO fw/blanket lifetime calculation in availability module""" -maintenance_fwbs: float = None -"""Maintenance cost factor: first wall, blanket, shield, divertor""" + bktcycles: float = 1.0e3 + """Number of fusion cycles to reach allowable DPA from DEMO fw/blanket lifetime calculation""" + avail_min: float = 0.75 + """Minimum availability (`constraint equation 61`)""" -maintenance_gen: float = None -"""Maintenance cost factor: All other components except coils, vacuum vessel, -thermal shield, cryostat, land""" + tok_build_cost_per_vol: float = 1283.0 + """Unit cost for tokamak complex buildings, including building and site services ($/m3)""" + light_build_cost_per_vol: float = 270.0 + """Unit cost for unshielded non-active buildings ($/m3)""" -amortization: float = None -"""amortization factor (fixed charge factor) "A" (years)""" + num_rh_systems: int = 4 + """Number of remote handling systems (1-10)""" + conf_mag: float = 0.99 + """c parameter, which determines the temperature margin at which magnet lifetime starts to decline""" -cost_model: int = None -"""Switch for cost model: -- =0 use $ 1990 PROCESS model -- =1 use $ 2014 Kovari model -- =2 use user-provided model -""" + div_prob_fail: float = 0.0002 + """Divertor probability of failure (per op day)""" + div_umain_time: float = 0.25 + """Divertor unplanned maintenance time (years)""" -i_cp_lifetime: int = None -"""Switch for the centrepost lifetime constraint -0 : The CP full power year lifetime is set by the user via cplife_input -1 : The CP lifetime is equal to the divertor lifetime -2 : The CP lifetime is equal to the breeding blankets lifetime -3 : The CP lifetime is equal to the plant lifetime -""" + div_nref: float = 7000.0 + """Reference value for cycle cycle life of divertor""" + div_nu: float = 14000.0 + """The cycle when the divertor fails with 100% probability""" -cowner: float = None -"""owner cost factor""" + fwbs_nref: float = 20000.0 + """Reference value for cycle life of blanket""" + fwbs_nu: float = 40000.0 + """The cycle when the blanket fails with 100% probability""" -cplife_input: float = None -"""User input full power year lifetime of the centrepost (years) (i_cp_lifetime = 0)""" + fwbs_prob_fail: float = 0.0002 + """Fwbs probability of failure (per op day)""" + fwbs_umain_time: float = 0.25 + """Fwbs unplanned maintenance time (years)""" -cplife: float = None -"""Calculated full power year lifetime of centrepost (years)""" + redun_vacp: float = 25.0 + """Vacuum system pump redundancy level (%)""" + redun_vac: int = 0 + """Number of redundant vacuum pumps""" -cplife_cal: float = None -"""Calculated calendar year lifetime of centrepost (years)""" + t_plant_operational_total_yrs: float = 0.0 + """Operational time (yrs)""" + t_blkt_replace_yrs: float = 0.5 + """time taken to replace blanket (y) (`i_plant_availability=1`)""" -cpstcst: float = None -"""ST centrepost direct cost (M$)""" + tcomrepl: float = 0.5 + """time taken to replace both blanket and divertor (y) (`i_plant_availability=1`)""" + t_div_replace_yrs: float = 0.25 + """Time taken to replace divertor (y) (`i_plant_availability=1`)""" -cpstflnc: float = None -"""allowable ST centrepost neutron fluence (MW-yr/m2)""" + uubop: float = 0.02 + """unplanned unavailability factor for balance of plant (`i_plant_availability=1`)""" + uucd: float = 0.02 + """unplanned unavailability factor for current drive (`i_plant_availability=1`)""" -crctcore: float = None -"""reactor core costs (categories 221, 222 and 223)""" + uudiv: float = 0.04 + """unplanned unavailability factor for divertor (`i_plant_availability=1`)""" + uufuel: float = 0.02 + """unplanned unavailability factor for fuel system (`i_plant_availability=1`)""" -csi: float = None -"""allowance for site costs (M$)""" + uufw: float = 0.04 + """unplanned unavailability factor for first wall (`i_plant_availability=1`)""" + uumag: float = 0.02 + """unplanned unavailability factor for magnets (`i_plant_availability=1`)""" -cturbb: float = None -"""cost of turbine building (M$)""" + uuves: float = 0.04 + """unplanned unavailability factor for vessel (`i_plant_availability=1`)""" + ifueltyp: int = 0 + """Switch for fuel type: + - =2 treat initial blanket, divertor, first wall + as capital costs. Treat all later items and + fraction fcdfuel of CD equipment as fuel costs + - =1 treat blanket divertor, first wall and + fraction fcdfuel of CD equipment as fuel cost + - =0 treat these as capital cost + """ -decomf: float = None -"""proportion of constructed cost required for decommissioning fund""" + ipnet: int = 0 + """Switch for net electric power calculation: + - =0 scale so that always > 0 + - =1 let go < 0 (no c-o-e) + """ + ireactor: int = 1 + """Switch for net electric power and cost of electricity calculations: + - =0 do not calculate MW(electric) or c-o-e + - =1 calculate MW(electric) and c-o-e + """ -dintrt: float = None -"""diff between borrowing and saving interest rates""" + lsa: int = 4 + """Level of safety assurance switch (generally, use 3 or 4): + - =1 truly passively safe plant + - =2,3 in-between + - =4 like current fission plant + """ + moneyint: float = 0.0 + """interest portion of capital cost (M$)""" -divcst: float = None -"""divertor direct cost (M$)""" + output_costs: int = 1 + """Switch for costs output: + - =0 do not write cost-related outputs to file + - =1 write cost-related outputs to file + """ + discount_rate: float = 0.0435 + """effective cost of money in constant dollars""" -life_div_fpy: float = None -"""Full power year lifetime of divertor (fpy)""" + startupratio: float = 1.0 + """ratio of additional HCD power for start-up to flat-top operational requirements""" + startuppwr: float = 0.0 + """cost associated with additional HCD system power required on start-up ($)""" -life_div: float = None -"""Calendar year lifetime of divertor (y)""" + supercond_cost_model: int = 0 + """Switch for superconductor cost model: + - =0 use $/kg + - =1 use $/kAm""" + life_plant: float = 30.0 + """Full power year plant lifetime (years)""" -dtlife: float = None -"""period prior to the end of the plant life that the decommissioning fund is used (years)""" + tmain: float = None + """Maintenance time for replacing CP (years) (i_plant_availability = 3)""" + u_unplanned_cp: float = 0.0 + """User-input CP unplanned unavailability (i_plant_availability = 3)""" -fcap0: float = None -"""average cost of money for construction of plant assuming design/construction time of six years""" + UCAD: float = 180.0 + """unit cost for administration buildings (M$/m3)""" + UCAF: float = 1.5e6 + """unit cost for aux facility power equipment ($)""" -fcap0cp: float = None -"""average cost of money for replaceable components assuming lead time for these of two years""" + UCAHTS: float = 31.0 + """unit cost for aux heat transport equipment ($/W**exphts)""" + UCAP: float = 17.0 + """unit cost of auxiliary transformer ($/kVA)""" -fcdfuel: float = None -"""fraction of current drive cost treated as fuel (if `ifueltyp = 1`)""" + ucblbe: float = 260.0 + """unit cost for blanket beryllium ($/kg)""" + ucblbreed: float = 875.0 + """unit cost for breeder material ($/kg) (`blktmodel>0`)""" -fcontng: float = None -"""project contingency factor""" + ucblli: float = 875.0 + """unit cost for blanket lithium ($/kg) (30% Li6)""" + ucblli2o: float = 600.0 + """unit cost for blanket Li_2O ($/kg)""" -fcr0: float = None -"""fixed charge rate during construction""" + ucbllipb: float = 10.3 + """unit cost for blanket Li-Pb ($/kg) (30% Li6)""" + ucblss: float = 90.0 + """unit cost for blanket stainless steel ($/kg)""" -fkind: float = None -"""multiplier for Nth of a kind costs""" + ucblvd: float = 200.0 + """unit cost for blanket vanadium ($/kg)""" + UCBPMP: float = 2.925e5 + """vacuum system backing pump cost ($)""" -fwallcst: float = None -"""first wall cost (M$)""" + ucbus: float = 0.123 + """cost of aluminium bus for TF coil ($/A-m)""" + uccase: float = 50.0 + """cost of superconductor case ($/kg)""" -i_plant_availability: int = None -"""Switch for plant availability model: -- =0 use input value for f_t_plant_available -- =1 calculate f_t_plant_available using Taylor and Ward 1999 model -- =2 calculate f_t_plant_available using new (2015) model -- =3 calculate f_t_plant_available using ST model -""" + UCCO: float = 350.0 + """unit cost for control buildings (M$/m3)""" + uccpcl1: float = 250.0 + """cost of high strength tapered copper ($/kg)""" -ibkt_life: int = None -"""Switch for fw/blanket lifetime calculation in availability module: -- =0 use neutron fluence model -- =1 use fusion power model (DEMO only)""" + uccpclb: float = 150.0 + """cost of TF outboard leg plate coils ($/kg)""" + UCCPMP: float = 3.9e5 + """vacuum system cryopump cost ($)""" -life_dpa: float = None -"""Allowable DPA from DEMO fw/blanket lifetime calculation in availability module""" + UCCR: float = 460.0 + """unit cost for cryogenic building (M$/vol)""" + uccry: float = 9.3e4 + """heat transport system cryoplant costs ($/W**expcry)""" -bktcycles: float = None -"""Number of fusion cycles to reach allowable DPA from DEMO fw/blanket lifetime calculation""" + uccryo: float = 32.0 + """unit cost for vacuum vessel ($/kg)""" + uccu: float = 75.0 + """unit cost for copper in superconducting cable ($/kg)""" -avail_min: float = None -"""Minimum availability (`constraint equation 61`)""" + UCDGEN: float = 1.7e6 + """cost per 8 MW diesel generator ($)""" + ucdiv: float = 2.8e5 + """cost of divertor blade ($)""" -tok_build_cost_per_vol: float = None -"""Unit cost for tokamak complex buildings, including building and site services ($/m3)""" + UCDTC: float = 13.0 + """detritiation, air cleanup cost ($/10000m3/hr)""" + UCDUCT: float = 4.225e4 + """vacuum system duct cost ($/m)""" -light_build_cost_per_vol: float = None -"""Unit cost for unshielded non-active buildings ($/m3)""" + ucech: float = 3.0 + """ECH system cost ($/W)""" + UCEL: float = 380.0 + """unit cost for electrical equipment building (M$/m3)""" -num_rh_systems: int = None -"""Number of remote handling systems (1-10)""" + UCES1: float = 3.2e4 + """MGF (motor-generator flywheel) cost factor ($/MVA**0.8)""" + UCES2: float = 8.8e3 + """MGF (motor-generator flywheel) cost factor ($/MJ**0.8)""" -conf_mag: float = None -"""c parameter, which determines the temperature margin at which magnet lifetime starts to decline""" + ucf1: float = 2.23e7 + """cost of fuelling system ($)""" + ucfnc: float = 35.0 + """outer PF coil fence support cost ($/kg)""" -div_prob_fail: float = None -"""Divertor probability of failure (per op day)""" + UCFPR: float = 4.4e7 + """cost of 60g/day tritium processing unit ($)""" + ucfuel: float = 3.45 + """unit cost of D-T fuel (M$/year/1200MW)""" -div_umain_time: float = None -"""Divertor unplanned maintenance time (years)""" + UCFWA: float = 6.0e4 + """first wall armour cost ($/m2)""" + UCFWPS: float = 1.0e7 + """first wall passive stabiliser cost ($)""" -div_nref: float = None -"""Reference value for cycle cycle life of divertor""" + UCFWS: float = 5.3e4 + """first wall structure cost ($/m2)""" + UCGSS: float = 35.0 + """cost of reactor structure ($/kg)""" -div_nu: float = None -"""The cycle when the divertor fails with 100% probability""" + uche3: float = 1.0e6 + """cost of helium-3 ($/kg)""" + uchrs: float = 87.9e6 + """cost of heat rejection system ($)""" -fwbs_nref: float = None -"""Reference value for cycle life of blanket""" + uchts: list[float] = field(default_factory=lambda: [15.3, 19.1]) + """cost of heat transport system equipment per loop ($/W); dependent on coolant type (i_blkt_coolant_type)""" + uciac: float = 1.5e8 + """cost of instrumentation, control & diagnostics ($)""" -fwbs_nu: float = None -"""The cycle when the blanket fails with 100% probability""" + ucich: float = 3.0 + """ICH system cost ($/W)""" + UCINT: float = 35.0 + """superconductor intercoil structure cost ($/kg)""" -fwbs_prob_fail: float = None -"""Fwbs probability of failure (per op day)""" + uclh: float = 3.3 + """lower hybrid system cost ($/W)""" + UCLV: float = 16.0 + """low voltage system cost ($/kVA)""" -fwbs_umain_time: float = None -"""Fwbs unplanned maintenance time (years)""" + UCMB: float = 260.0 + """unit cost for reactor maintenance building (M$/m3)""" + ucme: float = 1.25e8 + """cost of maintenance equipment ($)""" -redun_vacp: float = None -"""Vacuum system pump redundancy level (%)""" + ucmisc: float = 2.5e7 + """miscellaneous plant allowance ($)""" + ucnbi: float = 3.3 + """NBI system cost ($/W)""" -redun_vac: int = None -"""Number of redundant vacuum pumps""" + UCNBV: float = 1000.0 + """cost of nuclear building ventilation ($/m3)""" + ucoam: list[float] = field(default_factory=lambda: [68.8, 68.8, 68.8, 74.4]) + """annual cost of operation and maintenance (M$/year/1200MW**0.5)""" -t_plant_operational_total_yrs: float = None -"""Operational time (yrs)""" + ucpens: float = 32.0 + """penetration shield cost ($/kg)""" + ucpfb: float = 210.0 + """cost of PF coil buses ($/kA-m)""" -t_blkt_replace_yrs: float = None -"""time taken to replace blanket (y) (`i_plant_availability=1`)""" + ucpfbk: float = 1.66e4 + """cost of PF coil DC breakers ($/MVA**0.7)""" + ucpfbs: float = 4.9e3 + """cost of PF burn power supplies ($/kW**0.7)""" -tcomrepl: float = None -"""time taken to replace both blanket and divertor (y) (`i_plant_availability=1`)""" + ucpfcb: float = 7.5e4 + """cost of PF coil AC breakers ($/circuit)""" + ucpfdr1: float = 150.0 + """cost factor for dump resistors ($/MJ)""" -t_div_replace_yrs: float = None -"""Time taken to replace divertor (y) (`i_plant_availability=1`)""" + ucpfic: float = 1.0e4 + """cost of PF instrumentation and control ($/channel)""" + ucpfps: float = 3.5e4 + """cost of PF coil pulsed power supplies ($/MVA)""" -uubop: float = None -"""unplanned unavailability factor for balance of plant (`i_plant_availability=1`)""" + UCPHX: float = 15.0 + """primary heat transport cost ($/W**exphts)""" + UCPP: float = 48.0 + """cost of primary power transformers ($/kVA**0.9)""" -uucd: float = None -"""unplanned unavailability factor for current drive (`i_plant_availability=1`)""" + ucrb: float = 400.0 + """cost of reactor building (M$/m3)""" + ucsc: list[float] = field( + default_factory=lambda: [ + 600.0, + 600.0, + 300.0, + 600.0, + 600.0, + 600.0, + 300.0, + 1200.0, + 1200.0, + ] + ) + """cost of superconductor ($/kg)""" -uudiv: float = None -"""unplanned unavailability factor for divertor (`i_plant_availability=1`)""" + sc_mat_cost_0: list[float] = field( + default_factory=lambda: [4.8, 2.0, 1.0, 4.8, 4.8, 47.4, 1.0, 47.4, 47.4] + ) + """cost of superconductor ($/kA m) at 6.4 T, 4.2 K""" + UCSH: float = 115.0 + """cost of shops and warehouses (M$/m3)""" -uufuel: float = None -"""unplanned unavailability factor for fuel system (`i_plant_availability=1`)""" + ucshld: float = 32.0 + """cost of shield structural steel ($/kg)""" + UCSWYD: float = 1.84e7 + """switchyard equipment costs ($)""" -uufw: float = None -"""unplanned unavailability factor for first wall (`i_plant_availability=1`)""" + uctfbr: float = 1.22 + """cost of TF coil breakers ($/W**0.7)""" + uctfbus: float = 100.0 + """cost of TF coil bus ($/kg)""" -uumag: float = None -"""unplanned unavailability factor for magnets (`i_plant_availability=1`)""" + UCTFDR: float = 1.75e-4 + """cost of TF coil dump resistors ($/J)""" + UCTFGR: float = 5000.0 + """additional cost of TF coil dump resistors ($/coil)""" -uuves: float = None -"""unplanned unavailability factor for vessel (`i_plant_availability=1`)""" + UCTFIC: float = 1.0e4 + """cost of TF coil instrumentation and control ($/coil/30)""" + uctfps: float = 24.0 + """cost of TF coil power supplies ($/W**0.7)""" -ifueltyp: int = None -"""Switch for fuel type: -- =2 treat initial blanket, divertor, first wall -as capital costs. Treat all later items and -fraction fcdfuel of CD equipment as fuel costs -- =1 treat blanket divertor, first wall and -fraction fcdfuel of CD equipment as fuel cost -- =0 treat these as capital cost -""" + uctfsw: float = 1.0 + """cost of TF coil slow dump switches ($/A)""" + UCTPMP: float = 1.105e5 + """cost of turbomolecular pump ($)""" -ipnet: int = None -"""Switch for net electric power calculation: -- =0 scale so that always > 0 -- =1 let go < 0 (no c-o-e) -""" + UCTR: float = 370.0 + """cost of tritium building ($/m3)""" + ucturb: list[float] = field(default_factory=lambda: [230.0e6, 245.0e6]) + """cost of turbine plant equipment ($) (dependent on coolant type i_blkt_coolant_type)""" -ireactor: int = None -"""Switch for net electric power and cost of electricity calculations: -- =0 do not calculate MW(electric) or c-o-e -- =1 calculate MW(electric) and c-o-e -""" + UCVALV: float = 3.9e5 + """vacuum system valve cost ($)""" + UCVDSH: float = 26.0 + """vacuum duct shield cost ($/kg)""" -lsa: int = None -"""Level of safety assurance switch (generally, use 3 or 4): -- =1 truly passively safe plant -- =2,3 in-between -- =4 like current fission plant -""" + UCVIAC: float = 1.3e6 + """vacuum system instrumentation and control cost ($)""" + ucwindpf: float = 465.0 + """cost of PF coil superconductor windings ($/m)""" -moneyint: float = None -"""interest portion of capital cost (M$)""" + ucwindtf: float = 480.0 + """cost of TF coil superconductor windings ($/m)""" + UCWS: float = 460.0 + """cost of active assembly shop ($/m3)""" -output_costs: int = None -"""Switch for costs output: -- =0 do not write cost-related outputs to file -- =1 write cost-related outputs to file -""" + ucwst: list[float] = field(default_factory=lambda: [0.0, 3.94, 5.91, 7.88]) + """cost of waste disposal (M$/y/1200MW)""" -discount_rate: float = None -"""effective cost of money in constant dollars""" - - -startupratio: float = None -"""ratio of additional HCD power for start-up to flat-top operational requirements""" - - -startuppwr: float = None -"""cost associated with additional HCD system power required on start-up ($)""" - - -supercond_cost_model: int = None -"""Switch for superconductor cost model: -- =0 use $/kg -- =1 use $/kAm""" - - -life_plant: float = None -"""Full power year plant lifetime (years)""" - - -tmain: float = None -"""Maintenance time for replacing CP (years) (i_plant_availability = 3)""" - - -u_unplanned_cp: float = None -"""User-input CP unplanned unavailability (i_plant_availability = 3)""" - - -UCAD: float = 180.0 -"""unit cost for administration buildings (M$/m3)""" - - -UCAF: float = 1.5e6 -"""unit cost for aux facility power equipment ($)""" - - -UCAHTS: float = 31.0 -"""unit cost for aux heat transport equipment ($/W**exphts)""" - - -UCAP: float = 17.0 -"""unit cost of auxiliary transformer ($/kVA)""" - - -ucblbe: float = None -"""unit cost for blanket beryllium ($/kg)""" - - -ucblbreed: float = None -"""unit cost for breeder material ($/kg) (`blktmodel>0`)""" - - -ucblli: float = None -"""unit cost for blanket lithium ($/kg) (30% Li6)""" - - -ucblli2o: float = None -"""unit cost for blanket Li_2O ($/kg)""" - - -ucbllipb: float = None -"""unit cost for blanket Li-Pb ($/kg) (30% Li6)""" - - -ucblss: float = None -"""unit cost for blanket stainless steel ($/kg)""" - - -ucblvd: float = None -"""unit cost for blanket vanadium ($/kg)""" - - -UCBPMP: float = 2.925e5 -"""vacuum system backing pump cost ($)""" - - -ucbus: float = None -"""cost of aluminium bus for TF coil ($/A-m)""" - - -uccase: float = None -"""cost of superconductor case ($/kg)""" - - -UCCO: float = 350.0 -"""unit cost for control buildings (M$/m3)""" - - -uccpcl1: float = None -"""cost of high strength tapered copper ($/kg)""" - - -uccpclb: float = None -"""cost of TF outboard leg plate coils ($/kg)""" - - -UCCPMP: float = 3.9e5 -"""vacuum system cryopump cost ($)""" - - -UCCR: float = 460.0 -"""unit cost for cryogenic building (M$/vol)""" - - -uccry: float = None -"""heat transport system cryoplant costs ($/W**expcry)""" - - -uccryo: float = None -"""unit cost for vacuum vessel ($/kg)""" - - -uccu: float = None -"""unit cost for copper in superconducting cable ($/kg)""" - - -UCDGEN: float = 1.7e6 -"""cost per 8 MW diesel generator ($)""" - - -ucdiv: float = None -"""cost of divertor blade ($)""" - - -UCDTC: float = 13.0 -"""detritiation, air cleanup cost ($/10000m3/hr)""" - - -UCDUCT: float = 4.225e4 -"""vacuum system duct cost ($/m)""" - - -ucech: float = None -"""ECH system cost ($/W)""" - - -UCEL: float = 380.0 -"""unit cost for electrical equipment building (M$/m3)""" - - -UCES1: float = 3.2e4 -"""MGF (motor-generator flywheel) cost factor ($/MVA**0.8)""" - - -UCES2: float = 8.8e3 -"""MGF (motor-generator flywheel) cost factor ($/MJ**0.8)""" - - -ucf1: float = None -"""cost of fuelling system ($)""" - - -ucfnc: float = None -"""outer PF coil fence support cost ($/kg)""" - - -UCFPR: float = 4.4e7 -"""cost of 60g/day tritium processing unit ($)""" - - -ucfuel: float = None -"""unit cost of D-T fuel (M$/year/1200MW)""" - - -UCFWA: float = 6.0e4 -"""first wall armour cost ($/m2)""" - - -UCFWPS: float = 1.0e7 -"""first wall passive stabiliser cost ($)""" - - -UCFWS: float = 5.3e4 -"""first wall structure cost ($/m2)""" - - -UCGSS: float = 35.0 -"""cost of reactor structure ($/kg)""" - - -uche3: float = None -"""cost of helium-3 ($/kg)""" - - -uchrs: float = None -"""cost of heat rejection system ($)""" - - -uchts: list[float] = None -"""cost of heat transport system equipment per loop ($/W); dependent on coolant type (i_blkt_coolant_type)""" - - -uciac: float = None -"""cost of instrumentation, control & diagnostics ($)""" - - -ucich: float = None -"""ICH system cost ($/W)""" - - -UCINT: float = 35.0 -"""superconductor intercoil structure cost ($/kg)""" - - -uclh: float = None -"""lower hybrid system cost ($/W)""" - - -UCLV: float = 16.0 -"""low voltage system cost ($/kVA)""" - - -UCMB: float = 260.0 -"""unit cost for reactor maintenance building (M$/m3)""" - - -ucme: float = None -"""cost of maintenance equipment ($)""" - - -ucmisc: float = None -"""miscellaneous plant allowance ($)""" - - -ucnbi: float = None -"""NBI system cost ($/W)""" - - -UCNBV: float = 1000.0 -"""cost of nuclear building ventilation ($/m3)""" - - -ucoam: list[float] = None -"""annual cost of operation and maintenance (M$/year/1200MW**0.5)""" - - -ucpens: float = None -"""penetration shield cost ($/kg)""" - - -ucpfb: float = None -"""cost of PF coil buses ($/kA-m)""" - - -ucpfbk: float = None -"""cost of PF coil DC breakers ($/MVA**0.7)""" - - -ucpfbs: float = None -"""cost of PF burn power supplies ($/kW**0.7)""" - - -ucpfcb: float = None -"""cost of PF coil AC breakers ($/circuit)""" - - -ucpfdr1: float = None -"""cost factor for dump resistors ($/MJ)""" - - -ucpfic: float = None -"""cost of PF instrumentation and control ($/channel)""" - - -ucpfps: float = None -"""cost of PF coil pulsed power supplies ($/MVA)""" - - -UCPHX: float = 15.0 -"""primary heat transport cost ($/W**exphts)""" - - -UCPP: float = 48.0 -"""cost of primary power transformers ($/kVA**0.9)""" - - -ucrb: float = None -"""cost of reactor building (M$/m3)""" - - -ucsc: list[float] = None -"""cost of superconductor ($/kg)""" - - -sc_mat_cost_0: list[float] = None -"""cost of superconductor ($/kA m) at 6.4 T, 4.2 K""" - - -UCSH: float = 115.0 -"""cost of shops and warehouses (M$/m3)""" - - -ucshld: float = None -"""cost of shield structural steel ($/kg)""" - - -UCSWYD: float = 1.84e7 -"""switchyard equipment costs ($)""" - - -uctfbr: float = None -"""cost of TF coil breakers ($/W**0.7)""" - - -uctfbus: float = None -"""cost of TF coil bus ($/kg)""" - - -UCTFDR: float = 1.75e-4 -"""cost of TF coil dump resistors ($/J)""" - - -UCTFGR: float = 5000.0 -"""additional cost of TF coil dump resistors ($/coil)""" - - -UCTFIC: float = 1.0e4 -"""cost of TF coil instrumentation and control ($/coil/30)""" - - -uctfps: float = None -"""cost of TF coil power supplies ($/W**0.7)""" - - -uctfsw: float = None -"""cost of TF coil slow dump switches ($/A)""" - - -UCTPMP: float = 1.105e5 -"""cost of turbomolecular pump ($)""" - - -UCTR: float = 370.0 -"""cost of tritium building ($/m3)""" - - -ucturb: list[float] = None -"""cost of turbine plant equipment ($) (dependent on coolant type i_blkt_coolant_type)""" - - -UCVALV: float = 3.9e5 -"""vacuum system valve cost ($)""" - - -UCVDSH: float = 26.0 -"""vacuum duct shield cost ($/kg)""" - - -UCVIAC: float = 1.3e6 -"""vacuum system instrumentation and control cost ($)""" - - -ucwindpf: float = None -"""cost of PF coil superconductor windings ($/m)""" - - -ucwindtf: float = None -"""cost of TF coil superconductor windings ($/m)""" - - -UCWS: float = 460.0 -"""cost of active assembly shop ($/m3)""" - - -ucwst: list[float] = None -"""cost of waste disposal (M$/y/1200MW)""" - - -def init_cost_variables(): - global c228 - c228 = 0.0 - - global c229 - c229 = 0.0 - - global c23 - c23 = 0.0 - - global c25 - c25 = 0.0 - - global c26 - c26 = 0.0 - - global cindrt - cindrt = 0.0 - - global ccont - ccont = 0.0 - - global c226 - c226 = 0.0 - - global c2261 - c2261 = 0.0 - - global c2262 - c2262 = 0.0 - - global c2263 - c2263 = 0.0 - - global c227 - c227 = 0.0 - - global c2271 - c2271 = 0.0 - - global c2272 - c2272 = 0.0 - - global c2273 - c2273 = 0.0 - - global c2274 - c2274 = 0.0 - - global c24 - c24 = 0.0 - - global c241 - c241 = 0.0 - - global c242 - c242 = 0.0 - - global c243 - c243 = 0.0 - - global c244 - c244 = 0.0 - - global c245 - c245 = 0.0 - - global c21 - c21 = 0.0 - - global c211 - c211 = 0.0 - - global c212 - c212 = 0.0 - - global c213 - c213 = 0.0 - - global c214 - c214 = 0.0 - - global c2141 - c2141 = 0.0 - - global c2142 - c2142 = 0.0 - - global c215 - c215 = 0.0 - - global c216 - c216 = 0.0 - - global c217 - c217 = 0.0 - - global c2171 - c2171 = 0.0 - - global c2172 - c2172 = 0.0 - - global c2173 - c2173 = 0.0 - - global c2174 - c2174 = 0.0 - - global c22 - c22 = 0.0 - - global c2211 - c2211 = 0.0 - - global c2212 - c2212 = 0.0 - - global c22121 - c22121 = 0.0 - - global c22122 - c22122 = 0.0 - - global c22123 - c22123 = 0.0 - - global c22124 - c22124 = 0.0 - - global c22125 - c22125 = 0.0 - - global c22126 - c22126 = 0.0 - - global c22127 - c22127 = 0.0 - - global c2213 - c2213 = 0.0 - - global c22131 - c22131 = 0.0 - - global c22132 - c22132 = 0.0 - - global c2214 - c2214 = 0.0 - - global c2215 - c2215 = 0.0 - - global c2221 - c2221 = 0.0 - - global c22211 - c22211 = 0.0 - - global c22212 - c22212 = 0.0 - - global c22213 - c22213 = 0.0 - - global c22214 - c22214 = 0.0 - - global c22215 - c22215 = 0.0 - - global c2222 - c2222 = 0.0 - - global c22221 - c22221 = 0.0 - - global c22222 - c22222 = 0.0 - - global c22223 - c22223 = 0.0 - - global c22224 - c22224 = 0.0 - - global c2223 - c2223 = 0.0 - - global c223 - c223 = 0.0 - - global c2231 - c2231 = 0.0 - - global c2232 - c2232 = 0.0 - - global c2233 - c2233 = 0.0 - - global c2234 - c2234 = 0.0 - - global c224 - c224 = 0.0 - - global c2241 - c2241 = 0.0 - - global c2242 - c2242 = 0.0 - - global c2243 - c2243 = 0.0 - - global c2244 - c2244 = 0.0 - - global c2245 - c2245 = 0.0 - - global c2246 - c2246 = 0.0 - - global c225 - c225 = 0.0 - - global c2251 - c2251 = 0.0 - - global c22511 - c22511 = 0.0 - - global c22512 - c22512 = 0.0 - - global c22513 - c22513 = 0.0 - - global c22514 - c22514 = 0.0 - - global c22515 - c22515 = 0.0 - - global c2252 - c2252 = 0.0 - - global c22521 - c22521 = 0.0 - - global c22522 - c22522 = 0.0 - - global c22523 - c22523 = 0.0 - - global c22524 - c22524 = 0.0 - - global c22525 - c22525 = 0.0 - - global c22526 - c22526 = 0.0 - - global c22527 - c22527 = 0.0 - - global c2253 - c2253 = 0.0 - - global chx - chx = 0.0 - - global cpp - cpp = 0.0 - - global cppa - cppa = 0.0 - - global c22128 - c22128 = 0.0 - - global \ - abktflnc, \ - adivflnc, \ - blkcst, \ - c221, \ - c222, \ - capcost, \ - cconfix, \ - cconshpf, \ - cconshtf, \ - cdcost, \ - cdirt, \ - cdrlife_cal, \ - cpfact, \ - cfind, \ - cland, \ - coe, \ - coecap, \ - coefuelt, \ - coeoam, \ - concost, \ - costexp, \ - costexp_pebbles, \ - cost_factor_buildings, \ - cost_factor_land, \ - cost_factor_tf_coils, \ - cost_factor_fwbs, \ - cost_factor_rh, \ - cost_factor_vv, \ - cost_factor_bop, \ - cost_factor_misc, \ - maintenance_fwbs, \ - maintenance_gen, \ - amortization, \ - cost_model, \ - i_cp_lifetime, \ - cowner, \ - cplife_input, \ - cplife, \ - cplife_cal, \ - cpstcst, \ - cpstflnc, \ - crctcore, \ - csi, \ - cturbb, \ - decomf, \ - dintrt, \ - divcst, \ - dtlife, \ - fcap0, \ - fcap0cp, \ - fcdfuel, \ - fcontng, \ - fcr0, \ - fkind, \ - fwallcst, \ - ibkt_life, \ - life_dpa, \ - bktcycles, \ - avail_min, \ - tok_build_cost_per_vol, \ - light_build_cost_per_vol, \ - num_rh_systems, \ - conf_mag, \ - div_prob_fail, \ - div_umain_time, \ - div_nref, \ - div_nu, \ - fwbs_nref, \ - fwbs_nu, \ - fwbs_prob_fail, \ - fwbs_umain_time, \ - redun_vacp, \ - redun_vac, \ - tcomrepl, \ - uubop, \ - uucd, \ - uudiv, \ - uufuel, \ - uufw, \ - uumag, \ - uuves, \ - ifueltyp, \ - ipnet, \ - ireactor, \ - lsa, \ - moneyint, \ - output_costs, \ - discount_rate, \ - startupratio, \ - startuppwr, \ - supercond_cost_model, \ - u_unplanned_cp, \ - ucblbe, \ - ucblbreed, \ - ucblli, \ - ucblli2o, \ - ucbllipb, \ - ucblss, \ - ucblvd, \ - ucbus, \ - uccase, \ - uccpcl1, \ - uccpclb, \ - uccry, \ - uccryo, \ - uccu, \ - ucdiv, \ - ucech, \ - ucf1, \ - ucfnc, \ - ucfuel, \ - uche3, \ - uchrs, \ - uchts, \ - uciac, \ - ucich, \ - uclh, \ - ucme, \ - ucmisc, \ - ucnbi, \ - ucoam, \ - ucpens, \ - ucpfb, \ - ucpfbk, \ - ucpfbs, \ - ucpfcb, \ - ucpfdr1, \ - ucpfps, \ - ucrb, \ - ucsc, \ - sc_mat_cost_0, \ - ucshld, \ - uctfbr, \ - uctfbus, \ - uctfps, \ - uctfsw, \ - ucturb, \ - ucwindpf, \ - ucwindtf, \ - ucwst, \ - ucpfic, \ - life_hcd_fpy, \ - f_t_plant_available, \ - life_div_fpy, \ - life_div, \ - i_plant_availability, \ - t_plant_operational_total_yrs, \ - t_blkt_replace_yrs, \ - t_div_replace_yrs, \ - life_plant - - abktflnc = 5.0 - adivflnc = 7.0 - blkcst = 0.0 - c221 = 0.0 - c222 = 0.0 - capcost = 0.0 - cconfix = 80.0 - cconshpf = 70.0 - cconshtf = 75.0 - cdcost = 0.0 - cdirt = 0.0 - life_hcd_fpy = 0.0 - cdrlife_cal = 0.0 - f_t_plant_available = 0.75 - cpfact = 0.0 - cfind = [0.244, 0.244, 0.244, 0.29] - cland = 19.2 - coe = 0.0 - coecap = 0.0 - coefuelt = 0.0 - coeoam = 0.0 - concost = 0.0 - costexp = 0.8 - costexp_pebbles = 0.6 - cost_factor_buildings = 1.0 - cost_factor_land = 1.0 - cost_factor_tf_coils = 1.0 - cost_factor_fwbs = 1.0 - cost_factor_rh = 1.0 - cost_factor_vv = 1.0 - cost_factor_bop = 1.0 - cost_factor_misc = 1.0 - maintenance_fwbs = 0.2 - maintenance_gen = 0.05 - amortization = 13.6 - cost_model = 1 - cowner = 0.15 - cplife = 0.0 - cplife_cal = 0.0 - cpstcst = 0.0 - cpstflnc = 10.0 - crctcore = 0.0 - csi = 16.0 - cturbb = 38.0 - decomf = 0.1 - dintrt = 0.0 - divcst = 0.0 - life_div_fpy = 0.0 - life_div = 0.0 - dtlife = 0.0 - fcap0 = 1.165 - fcap0cp = 1.08 - fcdfuel = 0.1 - fcontng = 0.195 - fcr0 = 0.0966 - fkind = 1.0 - fwallcst = 0.0 - i_plant_availability = 2 - ibkt_life = 0 - life_dpa = 50 - bktcycles = 1.0e3 - avail_min = 0.75 - tok_build_cost_per_vol = 1283.0 - light_build_cost_per_vol = 270.0 - num_rh_systems = 4 - conf_mag = 0.99 - div_prob_fail = 0.0002 - div_umain_time = 0.25 - div_nref = 7000.0 - div_nu = 14000.0 - fwbs_nref = 20000.0 - fwbs_nu = 40000.0 - fwbs_prob_fail = 0.0002 - fwbs_umain_time = 0.25 - redun_vacp = 25.0 - redun_vac = 0 - t_plant_operational_total_yrs = 0.0 - t_blkt_replace_yrs = 0.5 - tcomrepl = 0.5 - t_div_replace_yrs = 0.25 - uubop = 0.02 - uucd = 0.02 - uudiv = 0.04 - uufuel = 0.02 - uufw = 0.04 - uumag = 0.02 - uuves = 0.04 - ifueltyp = 0 - ipnet = 0 - ireactor = 1 - lsa = 4 - moneyint = 0.0 - output_costs = 1 - discount_rate = 0.0435 - startupratio = 1.0 - startuppwr = 0.0 - life_plant = 30.0 - ucblbe = 260.0 - ucblbreed = 875.0 - ucblli = 875.0 - ucblli2o = 600.0 - ucbllipb = 10.3 - ucblss = 90.0 - ucblvd = 200.0 - ucbus = 0.123 - uccase = 50.0 - uccpcl1 = 250.0 - uccpclb = 150.0 - uccry = 9.3e4 - uccryo = 32.0 - uccu = 75.0 - ucdiv = 2.8e5 - ucech = 3.0 - ucf1 = 2.23e7 - ucfnc = 35.0 - ucfuel = 3.45 - uche3 = 1.0e6 - uchrs = 87.9e6 - uchts = [15.3, 19.1] - uciac = 1.5e8 - ucich = 3.0 - uclh = 3.3 - ucme = 1.25e8 - ucmisc = 2.5e7 - ucnbi = 3.3 - ucoam = [68.8, 68.8, 68.8, 74.4] - ucpens = 32.0 - ucpfb = 210.0 - ucpfbk = 1.66e4 - ucpfbs = 4.9e3 - ucpfcb = 7.5e4 - ucpfdr1 = 150.0 - ucpfic = 1.0e4 - ucpfps = 3.5e4 - ucrb = 400.0 - ucsc = [ - 600.0, - 600.0, - 300.0, - 600.0, - 600.0, - 600.0, - 300.0, - 1200.0, - 1200.0, - ] - sc_mat_cost_0 = [4.8, 2.0, 1.0, 4.8, 4.8, 47.4, 1.0, 47.4, 47.4] - supercond_cost_model = 0 - ucshld = 32.0 - uctfbr = 1.22 - uctfbus = 100.0 - uctfps = 24.0 - uctfsw = 1.0 - ucturb = [230.0e6, 245.0e6] - ucwindpf = 465.0 - ucwindtf = 480.0 - ucwst = [0.0, 3.94, 5.91, 7.88] - u_unplanned_cp = 0.0 - i_cp_lifetime = 0 - cplife_input = 2.0 +CREATE_DICTS_FROM_DATACLASS = CostData diff --git a/process/main.py b/process/main.py index 7d405fbccb..c74bb2dbfe 100644 --- a/process/main.py +++ b/process/main.py @@ -666,21 +666,20 @@ def __init__(self, data: DataStructure): plasma_profile=self.plasma_profile, ) self.neoclassics = Neoclassics() - if data_structure.stellarator_variables.istell != 0: - self.stellarator = Stellarator( - availability=self.availability, - buildings=self.buildings, - vacuum=self.vacuum, - costs=self.costs, - power=self.power, - plasma_profile=self.plasma_profile, - hcpb=self.ccfe_hcpb, - current_drive=self.current_drive, - physics=self.physics, - neoclassics=self.neoclassics, - plasma_beta=self.plasma_beta, - plasma_bootstrap=self.plasma_bootstrap_current, - ) + self.stellarator = Stellarator( + availability=self.availability, + buildings=self.buildings, + vacuum=self.vacuum, + costs=self.costs, + power=self.power, + plasma_profile=self.plasma_profile, + hcpb=self.ccfe_hcpb, + current_drive=self.current_drive, + physics=self.physics, + neoclassics=self.neoclassics, + plasma_beta=self.plasma_beta, + plasma_bootstrap=self.plasma_bootstrap_current, + ) self.dcll = DCLL(fw=self.fw) @@ -688,11 +687,11 @@ def __init__(self, data: DataStructure): @property def costs(self) -> CostsProtocol: - if data_structure.cost_variables.cost_model == 0: + if self.data.costs.cost_model == 0: return self._costs_1990 - if data_structure.cost_variables.cost_model == 1: + if self.data.costs.cost_model == 1: return self._costs_2015 - if data_structure.cost_variables.cost_model == 2: + if self.data.costs.cost_model == 2: if self._costs_custom is not None: return self._costs_custom raise ValueError("Custom costs model not initialised") @@ -718,6 +717,9 @@ def models(self) -> tuple[Model, ...]: self._costs_1990, self.availability, self.ife, + self.buildings, + self.power, + self.stellarator, ) def setup_data_structure(self): diff --git a/process/models/availability.py b/process/models/availability.py index a34cbba1de..3852682c65 100644 --- a/process/models/availability.py +++ b/process/models/availability.py @@ -8,7 +8,6 @@ from process.core.exceptions import ProcessValueError from process.core.model import Model from process.data_structure import constraint_variables as ctv -from process.data_structure import cost_variables as cv from process.data_structure import divertor_variables as dv from process.data_structure import fwbs_variables as fwbsv from process.data_structure import ife_variables as ifev @@ -66,13 +65,13 @@ def run(self, output: bool = False): output : indicate whether output should be written to the output file, or not (default = False) """ - if cv.i_plant_availability == 3: + if self.data.costs.i_plant_availability == 3: if pv.itart != 1: raise ProcessValueError( - f"{cv.i_plant_availability=} is for a Spherical Tokamak. Please set itart=1 to use this model." + f"{self.data.costs.i_plant_availability=} is for a Spherical Tokamak. Please set itart=1 to use this model." ) self.avail_st(output) # ST model (2023) - elif cv.i_plant_availability == 2: + elif self.data.costs.i_plant_availability == 2: self.avail_2(output) # Morris model (2015) else: self.avail(output) # Taylor and Ward model (1999) @@ -114,28 +113,30 @@ def avail(self, output: bool): if fwbsv.life_fw_fpy < 0.0001e0: # Calculate blanket lifetime using neutron fluence model (ibkt_life=0) # or DEMO fusion power model (ibkt_life=1) - if cv.ibkt_life == 0: + if self.data.costs.ibkt_life == 0: fwbsv.life_blkt_fpy = ( - cv.life_plant + self.data.costs.life_plant if pv.pflux_fw_neutron_mw == 0.0 # noqa: RUF069 else min( - (cv.abktflnc / pv.pflux_fw_neutron_mw), - cv.life_plant, + (self.data.costs.abktflnc / pv.pflux_fw_neutron_mw), + self.data.costs.life_plant, ) ) else: fwbsv.life_blkt_fpy = min( - cv.life_dpa / dpa_fpy, cv.life_plant + self.data.costs.life_dpa / dpa_fpy, self.data.costs.life_plant ) # DEMO - elif cv.ibkt_life == 0: + elif self.data.costs.ibkt_life == 0: fwbsv.life_blkt_fpy = min( fwbsv.life_fw_fpy, - cv.abktflnc / pv.pflux_fw_neutron_mw, - cv.life_plant, + self.data.costs.abktflnc / pv.pflux_fw_neutron_mw, + self.data.costs.life_plant, ) else: fwbsv.life_blkt_fpy = min( - fwbsv.life_fw_fpy, cv.life_dpa / dpa_fpy, cv.life_plant + fwbsv.life_fw_fpy, + self.data.costs.life_dpa / dpa_fpy, + self.data.costs.life_plant, ) # DEMO # TODO Issue #834 @@ -143,79 +144,88 @@ def avail(self, output: bool): dv.pflux_div_heat_load_mw = max(dv.pflux_div_heat_load_mw, 1.0e-10) # Divertor lifetime (years) - cv.life_div_fpy = self.divertor_lifetime() + self.data.costs.life_div_fpy = self.divertor_lifetime() # Centrepost lifetime (years) (ST machines only) if pv.itart == 1: - cv.cplife = self.cp_lifetime() + self.data.costs.cplife = self.cp_lifetime() # Plant Availability (i_plant_availability=0,1) # Calculate the number of fusion cycles for a given blanket lifetime pulse_fpy = tv.t_plant_pulse_total / YEAR_SECONDS - cv.bktcycles = (fwbsv.life_blkt_fpy / pulse_fpy) + 1 + self.data.costs.bktcycles = (fwbsv.life_blkt_fpy / pulse_fpy) + 1 # if i_plant_availability = 0 use input value for f_t_plant_available # Taylor and Ward 1999 model (i_plant_availability=1) - if cv.i_plant_availability == 1: + if self.data.costs.i_plant_availability == 1: # Which component has the shorter life? - if cv.life_div_fpy < fwbsv.life_blkt_fpy: - ld = cv.life_div_fpy + if self.data.costs.life_div_fpy < fwbsv.life_blkt_fpy: + ld = self.data.costs.life_div_fpy lb = fwbsv.life_blkt_fpy - td = cv.t_div_replace_yrs + td = self.data.costs.t_div_replace_yrs else: ld = fwbsv.life_blkt_fpy - lb = cv.life_div_fpy - td = cv.t_blkt_replace_yrs + lb = self.data.costs.life_div_fpy + td = self.data.costs.t_blkt_replace_yrs # Number of outages between each combined outage n = math.ceil(lb / ld) - 1 # Planned unavailability - uplanned = (n * td + cv.tcomrepl) / ((n + 1) * ld + (n * td + cv.tcomrepl)) + uplanned = (n * td + self.data.costs.tcomrepl) / ( + (n + 1) * ld + (n * td + self.data.costs.tcomrepl) + ) # Unplanned unavailability # Rather than simply summing the individual terms, the following protects # against the total availability becoming zero or negative - uutot = cv.uubop # balance of plant - uutot += (1.0e0 - uutot) * cv.uucd # current drive - uutot += (1.0e0 - uutot) * cv.uudiv # divertor - uutot += (1.0e0 - uutot) * cv.uufuel # fuel system - uutot += (1.0e0 - uutot) * cv.uufw # first wall + blanket - uutot += (1.0e0 - uutot) * cv.uumag # magnets - uutot += (1.0e0 - uutot) * cv.uuves # vacuum vessel + uutot = self.data.costs.uubop # balance of plant + uutot += (1.0e0 - uutot) * self.data.costs.uucd # current drive + uutot += (1.0e0 - uutot) * self.data.costs.uudiv # divertor + uutot += (1.0e0 - uutot) * self.data.costs.uufuel # fuel system + uutot += (1.0e0 - uutot) * self.data.costs.uufw # first wall + blanket + uutot += (1.0e0 - uutot) * self.data.costs.uumag # magnets + uutot += (1.0e0 - uutot) * self.data.costs.uuves # vacuum vessel # Total availability - cv.f_t_plant_available = 1.0e0 - (uplanned + uutot - (uplanned * uutot)) + self.data.costs.f_t_plant_available = 1.0e0 - ( + uplanned + uutot - (uplanned * uutot) + ) # Capacity factor # Using the amount of time burning for a given pulse cycle - cv.cpfact = cv.f_t_plant_available * ( + self.data.costs.cpfact = self.data.costs.f_t_plant_available * ( tv.t_plant_pulse_burn / tv.t_plant_pulse_total ) # Modify lifetimes to take account of the availability if ifev.ife != 1: # First wall / blanket - if fwbsv.life_blkt_fpy < cv.life_plant: + if fwbsv.life_blkt_fpy < self.data.costs.life_plant: fwbsv.life_blkt_fpy = min( - fwbsv.life_blkt_fpy / cv.f_t_plant_available, cv.life_plant + fwbsv.life_blkt_fpy / self.data.costs.f_t_plant_available, + self.data.costs.life_plant, ) # Divertor - if cv.life_div_fpy < cv.life_plant: - cv.life_div_fpy = min( - cv.life_div_fpy / cv.f_t_plant_available, cv.life_plant + if self.data.costs.life_div_fpy < self.data.costs.life_plant: + self.data.costs.life_div_fpy = min( + self.data.costs.life_div_fpy / self.data.costs.f_t_plant_available, + self.data.costs.life_plant, ) # Centrepost - if pv.itart == 1 and cv.cplife < cv.life_plant: - cv.cplife = min(cv.cplife / cv.f_t_plant_available, cv.life_plant) + if pv.itart == 1 and self.data.costs.cplife < self.data.costs.life_plant: + self.data.costs.cplife = min( + self.data.costs.cplife / self.data.costs.f_t_plant_available, + self.data.costs.life_plant, + ) # Current drive system lifetime (assumed equal to first wall and blanket lifetime) - cv.life_hcd_fpy = fwbsv.life_blkt_fpy + self.data.costs.life_hcd_fpy = fwbsv.life_blkt_fpy # Output section if output: @@ -225,14 +235,14 @@ def avail(self, output: bool): self.outfile, "Allowable blanket neutron fluence (MW-yr/m2)", "(abktflnc)", - cv.abktflnc, + self.data.costs.abktflnc, ) po.ovarre( self.outfile, "Allowable divertor heat fluence (MW-yr/m2)", "(adivflnc)", - cv.adivflnc, + self.data.costs.adivflnc, ) po.ovarre( self.outfile, @@ -245,7 +255,7 @@ def avail(self, output: bool): self.outfile, "Divertor lifetime (years)", "(life_div_fpy)", - cv.life_div_fpy, + self.data.costs.life_div_fpy, "OP ", ) @@ -254,7 +264,7 @@ def avail(self, output: bool): self.outfile, "Centrepost lifetime (years)", "(cplife)", - cv.cplife, + self.data.costs.cplife, "OP ", ) @@ -262,37 +272,37 @@ def avail(self, output: bool): self.outfile, "Heating/CD system lifetime (years)", "(life_hcd_fpy)", - cv.life_hcd_fpy, + self.data.costs.life_hcd_fpy, "OP ", ) po.ovarre( self.outfile, "Total plant lifetime (years)", "(life_plant)", - cv.life_plant, + self.data.costs.life_plant, ) - if cv.i_plant_availability == 1: - if cv.life_div_fpy < fwbsv.life_blkt_fpy: + if self.data.costs.i_plant_availability == 1: + if self.data.costs.life_div_fpy < fwbsv.life_blkt_fpy: po.ovarre( self.outfile, "Time needed to replace divertor (years)", "(t_div_replace_yrs)", - cv.t_div_replace_yrs, + self.data.costs.t_div_replace_yrs, ) else: po.ovarre( self.outfile, "Time needed to replace blanket (years)", "(t_blkt_replace_yrs)", - cv.t_blkt_replace_yrs, + self.data.costs.t_blkt_replace_yrs, ) po.ovarre( self.outfile, "Time needed to replace blkt + div (years)", "(tcomrepl)", - cv.tcomrepl, + self.data.costs.tcomrepl, ) po.ovarre( self.outfile, @@ -309,25 +319,25 @@ def avail(self, output: bool): "OP ", ) - if cv.i_plant_availability == 0: + if self.data.costs.i_plant_availability == 0: po.ovarre( self.outfile, "Total plant availability fraction", "(f_t_plant_available)", - cv.f_t_plant_available, + self.data.costs.f_t_plant_available, ) po.ovarre( self.outfile, "Number of fusion cycles to reach allowable fw/blanket DPA", "(bktcycles)", - cv.bktcycles, + self.data.costs.bktcycles, ) else: po.ovarre( self.outfile, "Total plant availability fraction", "(f_t_plant_available)", - cv.f_t_plant_available, + self.data.costs.f_t_plant_available, "OP ", ) @@ -352,7 +362,9 @@ def avail_2(self, output: bool): u_planned = self.calc_u_planned(output) # Operational time (years) - cv.t_plant_operational_total_yrs = cv.life_plant * (1.0e0 - u_planned) + self.data.costs.t_plant_operational_total_yrs = self.data.costs.life_plant * ( + 1.0e0 - u_planned + ) # Un-planned unavailability @@ -374,8 +386,9 @@ def avail_2(self, output: bool): # Vacuum systems # Number of redundant pumps - cv.redun_vac = math.floor( - self.data.vacuum.n_vac_pumps_high * cv.redun_vacp / 100.0 + 0.5e0 + self.data.costs.redun_vac = math.floor( + self.data.vacuum.n_vac_pumps_high * self.data.costs.redun_vacp / 100.0 + + 0.5e0 ) u_unplanned_vacuum = self.calc_u_unplanned_vacuum(output) @@ -392,32 +405,37 @@ def avail_2(self, output: bool): ) # Total availability - cv.f_t_plant_available = max( + self.data.costs.f_t_plant_available = max( 1.0e0 - (u_planned + u_unplanned + u_planned * u_unplanned), 0.0e0 ) # Modify lifetimes to take account of the availability if ifev.ife != 1: # First wall / blanket - if fwbsv.life_blkt_fpy < cv.life_plant: + if fwbsv.life_blkt_fpy < self.data.costs.life_plant: fwbsv.life_blkt_fpy = min( - fwbsv.life_blkt_fpy / cv.f_t_plant_available, cv.life_plant + fwbsv.life_blkt_fpy / self.data.costs.f_t_plant_available, + self.data.costs.life_plant, ) # Current drive system lifetime (assumed equal to first wall and blanket lifetime) - cv.life_hcd_fpy = fwbsv.life_blkt_fpy + self.data.costs.life_hcd_fpy = fwbsv.life_blkt_fpy # Divertor - if cv.life_div_fpy < cv.life_plant: - cv.life_div_fpy = min( - cv.life_div_fpy / cv.f_t_plant_available, cv.life_plant + if self.data.costs.life_div_fpy < self.data.costs.life_plant: + self.data.costs.life_div_fpy = min( + self.data.costs.life_div_fpy / self.data.costs.f_t_plant_available, + self.data.costs.life_plant, ) # Centrepost - if pv.itart == 1 and cv.cplife < cv.life_plant: - cv.cplife = min(cv.cplife / cv.f_t_plant_available, cv.life_plant) + if pv.itart == 1 and self.data.costs.cplife < self.data.costs.life_plant: + self.data.costs.cplife = min( + self.data.costs.cplife / self.data.costs.f_t_plant_available, + self.data.costs.life_plant, + ) # Capacity factor - cv.cpfact = cv.f_t_plant_available * ( + self.data.costs.cpfact = self.data.costs.f_t_plant_available * ( tv.t_plant_pulse_burn / tv.t_plant_pulse_total ) @@ -434,7 +452,7 @@ def avail_2(self, output: bool): self.outfile, "Divertor lifetime (FPY)", "(life_div_fpy)", - cv.life_div_fpy, + self.data.costs.life_div_fpy, "OP ", ) if pv.itart == 1: @@ -442,7 +460,7 @@ def avail_2(self, output: bool): self.outfile, "Centrepost lifetime (FPY)", "(cplife)", - cv.cplife, + self.data.costs.cplife, "OP ", ) po.oblnkl(self.outfile) @@ -467,27 +485,27 @@ def avail_2(self, output: bool): self.outfile, "Total plant availability fraction", "(f_t_plant_available)", - cv.f_t_plant_available, + self.data.costs.f_t_plant_available, "OP ", ) po.ovarre( self.outfile, "Total DT operational time (years)", "(t_plant_operational_total_yrs)", - cv.t_plant_operational_total_yrs, + self.data.costs.t_plant_operational_total_yrs, "OP ", ) po.ovarre( self.outfile, "Total plant lifetime (years)", "(life_plant)", - cv.life_plant, + self.data.costs.life_plant, ) po.ovarre( self.outfile, "Capacity factor: total lifetime elec. energy output / output power", "(cpfact)", - cv.cpfact, + self.data.costs.cpfact, "OP ", ) @@ -529,22 +547,25 @@ def calc_u_planned(self, output: bool) -> float: # First wall / blanket lifetime (years) # Calculate blanket lifetime using neutron fluence model (ibkt_life=0) # or DEMO fusion power model (ibkt_life=1) - if cv.ibkt_life == 0: + if self.data.costs.ibkt_life == 0: fwbsv.life_blkt_fpy = min( - cv.abktflnc / pv.pflux_fw_neutron_mw, cv.life_plant + self.data.costs.abktflnc / pv.pflux_fw_neutron_mw, + self.data.costs.life_plant, ) else: - fwbsv.life_blkt_fpy = min(cv.life_dpa / dpa_fpy, cv.life_plant) # DEMO + fwbsv.life_blkt_fpy = min( + self.data.costs.life_dpa / dpa_fpy, self.data.costs.life_plant + ) # DEMO # Divertor lifetime (years) - cv.life_div_fpy = self.divertor_lifetime() + self.data.costs.life_div_fpy = self.divertor_lifetime() # Centrepost lifetime (years) (ST only) if pv.itart == 1: - cv.cplife = self.cp_lifetime() + self.data.costs.cplife = self.cp_lifetime() # Current drive lifetime (assumed equal to first wall and blanket lifetime) - cv.life_hcd_fpy = fwbsv.life_blkt_fpy + self.data.costs.life_hcd_fpy = fwbsv.life_blkt_fpy # Calculate the blanket and divertor replacement times ! @@ -554,20 +575,22 @@ def calc_u_planned(self, output: bool) -> float: # Mean time to repair blanket is same as replacing both blanket and divertor. # The +2.0 at the end is for the 1 month cooldown and pump down at either end # of the maintenance period - mttr_blanket = (21.0e0 * cv.num_rh_systems ** (-0.9e0) + 2.0e0) / 12.0e0 + mttr_blanket = ( + 21.0e0 * self.data.costs.num_rh_systems ** (-0.9e0) + 2.0e0 + ) / 12.0e0 # Mean time to repair divertor is 70% of time taken to replace blanket # This is taken from Oliver Crofts 2014 paper mttr_divertor = 0.7e0 * mttr_blanket # Which component has the shorter life? - if cv.life_div_fpy < fwbsv.life_blkt_fpy: - lifetime_shortest = cv.life_div_fpy + if self.data.costs.life_div_fpy < fwbsv.life_blkt_fpy: + lifetime_shortest = self.data.costs.life_div_fpy lifetime_longest = fwbsv.life_blkt_fpy mttr_shortest = mttr_divertor else: lifetime_shortest = fwbsv.life_blkt_fpy - lifetime_longest = cv.life_div_fpy + lifetime_longest = self.data.costs.life_div_fpy mttr_shortest = mttr_blanket # Number of outages between each combined outage @@ -588,19 +611,19 @@ def calc_u_planned(self, output: bool) -> float: self.outfile, "Allowable blanket neutron fluence (MW-yr/m2)", "(abktflnc)", - cv.abktflnc, + self.data.costs.abktflnc, ) po.ovarre( self.outfile, "Allowable divertor heat fluence (MW-yr/m2)", "(adivflnc)", - cv.adivflnc, + self.data.costs.adivflnc, ) po.ovarin( self.outfile, "Number of remote handling systems", "(num_rh_systems)", - cv.num_rh_systems, + self.data.costs.num_rh_systems, ) po.ovarre( self.outfile, @@ -662,13 +685,13 @@ def calc_u_unplanned_magnets(self, output: bool) -> float: # Minimum unplanned unavailability mag_min_u_unplanned = mag_main_time / ( - cv.t_plant_operational_total_yrs + mag_main_time + self.data.costs.t_plant_operational_total_yrs + mag_main_time ) # Point at which risk of unplanned unavailability increases # conf_mag is the c factor, which determines the temperature margin at which # lifetime starts to decline. - start_of_risk = mag_temp_marg_limit / cv.conf_mag + start_of_risk = mag_temp_marg_limit / self.data.costs.conf_mag # Determine if temperature margin is in region with risk of unplanned unavailability if tfv.temp_margin >= start_of_risk: @@ -677,7 +700,10 @@ def calc_u_unplanned_magnets(self, output: bool) -> float: # Linear decrease in expected lifetime when approaching the limit t_life = max( 0.0e0, - (cv.t_plant_operational_total_yrs / (start_of_risk - tmargmin)) + ( + self.data.costs.t_plant_operational_total_yrs + / (start_of_risk - tmargmin) + ) * (tfv.temp_margin - tmargmin), ) u_unplanned_magnets = mag_main_time / (t_life + mag_main_time) @@ -695,7 +721,7 @@ def calc_u_unplanned_magnets(self, output: bool) -> float: self.outfile, "c parameter, determining the temp margin where lifetime declines", "(conf_mag)", - cv.conf_mag, + self.data.costs.conf_mag, ) po.ovarre( self.outfile, @@ -731,15 +757,18 @@ def calc_u_unplanned_divertor(self, output: bool) -> float: """ # Calculate cycle limit in terms of days # Number of cycles between planned blanket replacements, N - n = cv.life_div_fpy * YEAR_SECONDS / tv.t_plant_pulse_total + n = self.data.costs.life_div_fpy * YEAR_SECONDS / tv.t_plant_pulse_total # The probability of failure in one pulse cycle (before the reference cycle life) - pf = (cv.div_prob_fail / DAY_SECONDS) * tv.t_plant_pulse_total - a0 = 1.0e0 - pf * cv.div_umain_time * YEAR_SECONDS / tv.t_plant_pulse_total + pf = (self.data.costs.div_prob_fail / DAY_SECONDS) * tv.t_plant_pulse_total + a0 = ( + 1.0e0 + - pf * self.data.costs.div_umain_time * YEAR_SECONDS / tv.t_plant_pulse_total + ) # Integrating the instantaneous availability gives the mean # availability over the planned cycle life N - if cv.div_nu <= cv.div_nref: + if self.data.costs.div_nu <= self.data.costs.div_nref: logger.error( """div_nu <= div_nref The cycle when the divertor fails with 100% probability <= & Reference value for cycle life of divertor @@ -753,17 +782,19 @@ def calc_u_unplanned_divertor(self, output: bool) -> float: # Check number of cycles # Less than reference (availability is min availability) - if n <= cv.div_nref: + if n <= self.data.costs.div_nref: div_avail = a0 # Greater than cycle number with 100% failure rate - elif n >= cv.div_nu: + elif n >= self.data.costs.div_nu: div_avail = 0.0e0 # Else number of cycles is inbetween and is given by formula below else: - div_avail = (a0 / (cv.div_nu - cv.div_nref)) * ( - cv.div_nu - 0.5e0 * cv.div_nref**2.0e0 / n - 0.5e0 * n + div_avail = (a0 / (self.data.costs.div_nu - self.data.costs.div_nref)) * ( + self.data.costs.div_nu + - 0.5e0 * self.data.costs.div_nref**2.0e0 / n + - 0.5e0 * n ) # Unplanned unavailability for divertor @@ -777,25 +808,25 @@ def calc_u_unplanned_divertor(self, output: bool) -> float: self.outfile, "Probability of failure per operational day", "(div_prob_fail)", - cv.div_prob_fail, + self.data.costs.div_prob_fail, ) po.ovarre( self.outfile, "Repair time (years)", "(div_umain_time)", - cv.div_umain_time, + self.data.costs.div_umain_time, ) po.ovarre( self.outfile, "Reference value for cycle life", "(div_nref)", - cv.div_nref, + self.data.costs.div_nref, ) po.ovarre( self.outfile, "The cycle when failure is 100% certain", "(div_nu)", - cv.div_nu, + self.data.costs.div_nu, ) po.ovarre( self.outfile, "Number of cycles between planned replacements", "(n)", n @@ -834,10 +865,16 @@ def calc_u_unplanned_fwbs(self, output: bool) -> float: # The probability of failure in one pulse cycle # (before the reference cycle life) - pf = (cv.fwbs_prob_fail / DAY_SECONDS) * tv.t_plant_pulse_total - a0 = 1.0e0 - pf * cv.fwbs_umain_time * YEAR_SECONDS / tv.t_plant_pulse_total + pf = (self.data.costs.fwbs_prob_fail / DAY_SECONDS) * tv.t_plant_pulse_total + a0 = ( + 1.0e0 + - pf + * self.data.costs.fwbs_umain_time + * YEAR_SECONDS + / tv.t_plant_pulse_total + ) - if cv.fwbs_nu <= cv.fwbs_nref: + if self.data.costs.fwbs_nu <= self.data.costs.fwbs_nref: logger.error( """fwbs_nu <= fwbs_nref The cycle when the blanket fails with 100% probability <= &Reference value for cycle life of blanket @@ -850,13 +887,15 @@ def calc_u_unplanned_fwbs(self, output: bool) -> float: # Integrating the instantaneous availability gives the mean # availability over the planned cycle life N - if n <= cv.fwbs_nref: + if n <= self.data.costs.fwbs_nref: fwbs_avail = a0 - elif n >= cv.fwbs_nu: + elif n >= self.data.costs.fwbs_nu: fwbs_avail = 0.0e0 else: - fwbs_avail = (a0 / (cv.fwbs_nu - cv.fwbs_nref)) * ( - cv.fwbs_nu - 0.5e0 * cv.fwbs_nref**2.0e0 / n - 0.5e0 * n + fwbs_avail = (a0 / (self.data.costs.fwbs_nu - self.data.costs.fwbs_nref)) * ( + self.data.costs.fwbs_nu + - 0.5e0 * self.data.costs.fwbs_nref**2.0e0 / n + - 0.5e0 * n ) # First wall / blanket unplanned unavailability @@ -870,25 +909,25 @@ def calc_u_unplanned_fwbs(self, output: bool) -> float: self.outfile, "Probability of failure per operational day", "(fwbs_prob_fail)", - cv.fwbs_prob_fail, + self.data.costs.fwbs_prob_fail, ) po.ovarre( self.outfile, "Repair time (years)", "(fwbs_umain_time)", - cv.fwbs_umain_time, + self.data.costs.fwbs_umain_time, ) po.ovarre( self.outfile, "Reference value for cycle life", "(fwbs_nref)", - cv.fwbs_nref, + self.data.costs.fwbs_nref, ) po.ovarre( self.outfile, "The cycle when failure is 100% certain", "(fwbs_nu)", - cv.fwbs_nu, + self.data.costs.fwbs_nu, ) po.ovarre( self.outfile, "Number of cycles between planned replacements", "(n)", n @@ -929,7 +968,10 @@ def calc_u_unplanned_bop(self, output: bool) -> float: # Number of balance of plant failures in plant operational lifetime bop_num_failures = math.ceil( - bop_fail_rate * DAYS_IN_YEAR * 24.0e0 * cv.t_plant_operational_total_yrs + bop_fail_rate + * DAYS_IN_YEAR + * 24.0e0 + * self.data.costs.t_plant_operational_total_yrs ) # Balance of plant mean time to repair (years) @@ -938,7 +980,7 @@ def calc_u_unplanned_bop(self, output: bool) -> float: # Unplanned downtime balance of plant u_unplanned_bop = (bop_mttr * bop_num_failures) / ( - cv.t_plant_operational_total_yrs + self.data.costs.t_plant_operational_total_yrs ) # Output @@ -1008,18 +1050,18 @@ def calc_u_unplanned_vacuum(self, output: bool) -> float: """ # Number of shutdowns n_shutdown: int = round( - (cv.life_plant - cv.t_plant_operational_total_yrs) - / ((21.0e0 * cv.num_rh_systems ** (-0.9e0) + 2.0e0) / 12.0e0) + (self.data.costs.life_plant - self.data.costs.t_plant_operational_total_yrs) + / ((21.0e0 * self.data.costs.num_rh_systems ** (-0.9e0) + 2.0e0) / 12.0e0) ) # Operational time between shutdowns - t_op_bt = cv.t_plant_operational_total_yrs / (n_shutdown + 1.0e0) + t_op_bt = self.data.costs.t_plant_operational_total_yrs / (n_shutdown + 1.0e0) # Cryopump maintenance time (y) = 2 months cryo_main_time = 1.0e0 / 6.0e0 # Total pumps = pumps + redundant pumps - total_pumps = self.data.vacuum.n_vac_pumps_high + cv.redun_vac + total_pumps = self.data.vacuum.n_vac_pumps_high + self.data.costs.redun_vac # Cryopump failure rate per machine operational period # From "Selected component failure rate values from fusion @@ -1033,7 +1075,7 @@ def calc_u_unplanned_vacuum(self, output: bool) -> float: sum_prob = 0.0e0 - for n in range(cv.redun_vac + 1, total_pumps + 1): + for n in range(self.data.costs.redun_vac + 1, total_pumps + 1): # Probability for n failures in the operational period, n > number of redundant pumps # calculate sum in formula for downtime @@ -1041,7 +1083,7 @@ def calc_u_unplanned_vacuum(self, output: bool) -> float: combinations(total_pumps, n) * (cryo_nfailure_rate ** (total_pumps - n)) * (cryo_failure_rate**n) - * (n - cv.redun_vac) + * (n - self.data.costs.redun_vac) ) # Total down-time in reactor life @@ -1049,7 +1091,7 @@ def calc_u_unplanned_vacuum(self, output: bool) -> float: # Total vacuum unplanned unavailability u_unplanned_vacuum = max( - 0.005, t_down / (cv.t_plant_operational_total_yrs + t_down) + 0.005, t_down / (self.data.costs.t_plant_operational_total_yrs + t_down) ) # Output @@ -1067,7 +1109,7 @@ def calc_u_unplanned_vacuum(self, output: bool) -> float: self.outfile, "Number of redundant pumps", "(redun_vac)", - cv.redun_vac, + self.data.costs.redun_vac, "OP ", ) po.ovarre( @@ -1123,44 +1165,49 @@ def avail_st(self, output: bool): ref_dpa_fpy = 10.0e0 # dpa per fpy from T. Franke 2020 states up to 10 dpa/FPY dpa_fpy = f_scale * ref_dpa_fpy - if cv.ibkt_life == 0: + if self.data.costs.ibkt_life == 0: fwbsv.life_blkt_fpy = min( - cv.abktflnc / pv.pflux_fw_neutron_mw, cv.life_plant + self.data.costs.abktflnc / pv.pflux_fw_neutron_mw, + self.data.costs.life_plant, ) else: - fwbsv.life_blkt_fpy = min(cv.life_dpa / dpa_fpy, cv.life_plant) # DEMO + fwbsv.life_blkt_fpy = min( + self.data.costs.life_dpa / dpa_fpy, self.data.costs.life_plant + ) # DEMO # Divertor lifetime (years) - cv.life_div_fpy = self.divertor_lifetime() + self.data.costs.life_div_fpy = self.divertor_lifetime() # CP lifetime (years) - cv.cplife = self.cp_lifetime() + self.data.costs.cplife = self.cp_lifetime() # Current drive lifetime (assumed equal to first wall and blanket lifetime) - cv.life_hcd_fpy = fwbsv.life_blkt_fpy + self.data.costs.life_hcd_fpy = fwbsv.life_blkt_fpy # Time for a maintenance cycle (years) # Shortest component lifetime + time to replace shortest_lifetime = min( fwbsv.life_blkt_fpy, - cv.life_div_fpy, - cv.cplife, - cv.life_hcd_fpy, - cv.life_plant, + self.data.costs.life_div_fpy, + self.data.costs.cplife, + self.data.costs.life_hcd_fpy, + self.data.costs.life_plant, ) - maint_cycle = shortest_lifetime + cv.tmain + maint_cycle = shortest_lifetime + self.data.costs.tmain # Number of maintenance cycles over plant lifetime - n_cycles_main = cv.life_plant / maint_cycle + n_cycles_main = self.data.costs.life_plant / maint_cycle # Number of centre columns over plant lifetime n_centre_cols = math.ceil(n_cycles_main) # Planned unavailability - u_planned = cv.tmain / maint_cycle + u_planned = self.data.costs.tmain / maint_cycle # Operational time (years) - cv.t_plant_operational_total_yrs = cv.life_plant * (1.0e0 - u_planned) + self.data.costs.t_plant_operational_total_yrs = self.data.costs.life_plant * ( + 1.0e0 - u_planned + ) if output: po.oheadr(self.outfile, "Plant Availability") @@ -1185,8 +1232,9 @@ def avail_st(self, output: bool): # Vacuum systems # Number of redundant pumps - cv.redun_vac = math.floor( - self.data.vacuum.n_vac_pumps_high * cv.redun_vacp / 100.0 + 0.5e0 + self.data.costs.redun_vac = math.floor( + self.data.vacuum.n_vac_pumps_high * self.data.costs.redun_vacp / 100.0 + + 0.5e0 ) u_unplanned_vacuum = self.calc_u_unplanned_vacuum(output) @@ -1200,35 +1248,40 @@ def avail_st(self, output: bool): + u_unplanned_bop + u_unplanned_hcd + u_unplanned_vacuum - + cv.u_unplanned_cp, + + self.data.costs.u_unplanned_cp, ) # Total availability - cv.f_t_plant_available = max( + self.data.costs.f_t_plant_available = max( 1.0e0 - (u_planned + u_unplanned + u_planned * u_unplanned), 0.0e0 ) # Modify lifetimes to take account of the availability if ifev.ife != 1: # First wall / blanket - if fwbsv.life_blkt_fpy < cv.life_plant: + if fwbsv.life_blkt_fpy < self.data.costs.life_plant: fwbsv.life_blkt_fpy = min( - fwbsv.life_blkt_fpy / cv.f_t_plant_available, cv.life_plant + fwbsv.life_blkt_fpy / self.data.costs.f_t_plant_available, + self.data.costs.life_plant, ) - cv.life_hcd_fpy = fwbsv.life_blkt_fpy + self.data.costs.life_hcd_fpy = fwbsv.life_blkt_fpy # Divertor - if cv.life_div_fpy < cv.life_plant: - cv.life_div_fpy = min( - cv.life_div_fpy / cv.f_t_plant_available, cv.life_plant + if self.data.costs.life_div_fpy < self.data.costs.life_plant: + self.data.costs.life_div_fpy = min( + self.data.costs.life_div_fpy / self.data.costs.f_t_plant_available, + self.data.costs.life_plant, ) # Centrepost - if pv.itart == 1 and cv.cplife < cv.life_plant: - cv.cplife = min(cv.cplife / cv.f_t_plant_available, cv.life_plant) + if pv.itart == 1 and self.data.costs.cplife < self.data.costs.life_plant: + self.data.costs.cplife = min( + self.data.costs.cplife / self.data.costs.f_t_plant_available, + self.data.costs.life_plant, + ) # Capacity factor - cv.cpfact = cv.f_t_plant_available * ( + self.data.costs.cpfact = self.data.costs.f_t_plant_available * ( tv.t_plant_pulse_burn / tv.t_plant_pulse_total ) @@ -1239,13 +1292,13 @@ def avail_st(self, output: bool): self.outfile, "Allowable blanket neutron fluence (MW-yr/m2)", "(abktflnc)", - cv.abktflnc, + self.data.costs.abktflnc, ) po.ovarre( self.outfile, "Allowable divertor heat fluence (MW-yr/m2)", "(adivflnc)", - cv.adivflnc, + self.data.costs.adivflnc, ) po.ovarre( self.outfile, @@ -1258,7 +1311,7 @@ def avail_st(self, output: bool): self.outfile, "Divertor lifetime (FPY)", "(life_div_fpy)", - cv.life_div_fpy, + self.data.costs.life_div_fpy, "OP ", ) if tfv.i_tf_sup == TFConductorModel.SUPERCONDUCTING: @@ -1281,7 +1334,7 @@ def avail_st(self, output: bool): self.outfile, "Allowable ST centrepost neutron fluence (MW-yr/m2)", "(cpstflnc)", - cv.cpstflnc, + self.data.costs.cpstflnc, "OP ", ) po.ovarre( @@ -1295,7 +1348,7 @@ def avail_st(self, output: bool): self.outfile, "Centrepost lifetime (years)", "(cplife)", - cv.cplife, + self.data.costs.cplife, "OP ", ) po.oblnkl(self.outfile) @@ -1303,7 +1356,7 @@ def avail_st(self, output: bool): self.outfile, "Maintenance time for replacing CP (years)", "(tmain)", - cv.tmain, + self.data.costs.tmain, "OP ", ) po.ovarre( @@ -1346,33 +1399,32 @@ def avail_st(self, output: bool): self.outfile, "Total plant availability fraction", "(f_t_plant_available)", - cv.f_t_plant_available, + self.data.costs.f_t_plant_available, "OP ", ) po.ovarre( self.outfile, "Capacity factor: total lifetime elec. energy output / output power", "(cpfact)", - cv.cpfact, + self.data.costs.cpfact, "OP ", ) po.ovarre( self.outfile, "Total DT operational time (years)", "(t_plant_operational_total_yrs)", - cv.t_plant_operational_total_yrs, + self.data.costs.t_plant_operational_total_yrs, "OP ", ) po.ovarre( self.outfile, "Total plant lifetime (years)", "(life_plant)", - cv.life_plant, + self.data.costs.life_plant, "OP", ) - @staticmethod - def cp_lifetime(): + def cp_lifetime(self): """Calculate Centrepost Lifetime This routine calculates the lifetime of the centrepost, @@ -1387,23 +1439,25 @@ def cp_lifetime(): # Rem : only the TF maximum fluence is considered for now if tfv.i_tf_sup == TFConductorModel.SUPERCONDUCTING: cplife = ( - cv.life_plant + self.data.costs.life_plant if fwbsv.neut_flux_cp <= 0.0 else min( (ctv.nflutfmax / (fwbsv.neut_flux_cp * YEAR_SECONDS)), - cv.life_plant, + self.data.costs.life_plant, ) ) # Aluminium/Copper magnets CP lifetime # For now, we keep the original def, developed for GLIDCOP magnets ... else: - cplife = min(cv.cpstflnc / pv.pflux_fw_neutron_mw, cv.life_plant) + cplife = min( + self.data.costs.cpstflnc / pv.pflux_fw_neutron_mw, + self.data.costs.life_plant, + ) return cplife - @staticmethod - def divertor_lifetime(): + def divertor_lifetime(self): """Calculate Divertor Lifetime This routine calculates the lifetime of the divertor based on the allowable divertor heat fluence. @@ -1415,4 +1469,10 @@ def divertor_lifetime(): """ # Divertor lifetime # Either 0.0, calculated from allowable divertor fluence and heat load, or lifetime of the plant - return max(0.0, min(cv.adivflnc / dv.pflux_div_heat_load_mw, cv.life_plant)) + return max( + 0.0, + min( + self.data.costs.adivflnc / dv.pflux_div_heat_load_mw, + self.data.costs.life_plant, + ), + ) diff --git a/process/models/blankets/hcpb.py b/process/models/blankets/hcpb.py index a93ce4bd7d..f72976f83a 100644 --- a/process/models/blankets/hcpb.py +++ b/process/models/blankets/hcpb.py @@ -12,7 +12,6 @@ from process.data_structure import ( build_variables, ccfe_hcpb_module, - cost_variables, current_drive_variables, divertor_variables, first_wall_variables, @@ -1558,7 +1557,7 @@ def write_output(self): self.outfile, "Allowable nominal neutron fluence at first wall (MW.year/m2)", "(abktflnc)", - cost_variables.abktflnc, + self.data.costs.abktflnc, ) po.ovarre( self.outfile, diff --git a/process/models/buildings.py b/process/models/buildings.py index 2c27dd4ebd..1fef24f3aa 100644 --- a/process/models/buildings.py +++ b/process/models/buildings.py @@ -8,7 +8,6 @@ from process.data_structure import ( build_variables, buildings_variables, - cost_variables, current_drive_variables, divertor_variables, fwbs_variables, @@ -568,7 +567,7 @@ def bldgs_sizes(self, output, tf_radial_dim, tf_vertical_dim): # Inboard 'component': shield, blanket, first wall: # find height, maximum radial dimension, maximum toroidal dimension - if cost_variables.life_plant != 0.0e0: # noqa: RUF069 + if self.data.costs.life_plant != 0.0e0: # noqa: RUF069 hcomp_height = 2 * ( build_variables.z_tf_inside_half - ( @@ -608,7 +607,7 @@ def bldgs_sizes(self, output, tf_radial_dim, tf_vertical_dim): # ( number in build * (plant lifetime / component lifetime) ) * quantity safety factor hcomp_req_supply = ( tfcoil_variables.n_tf_coils - * (cost_variables.life_plant / cost_variables.life_plant) + * (self.data.costs.life_plant / self.data.costs.life_plant) ) * buildings_variables.qnty_sfty_fac # total storage space for required supply of inboard shield-blanket-wall ib_hotcell_vol = hcomp_req_supply * hcomp_vol @@ -648,7 +647,7 @@ def bldgs_sizes(self, output, tf_radial_dim, tf_vertical_dim): ) hcomp_req_supply = ( tfcoil_variables.n_tf_coils - * (cost_variables.life_plant / cost_variables.life_plant) + * (self.data.costs.life_plant / self.data.costs.life_plant) ) * buildings_variables.qnty_sfty_fac # total storage space for required supply of outboard wall-blanket-shield ob_hotcell_vol = hcomp_req_supply * hcomp_vol @@ -658,7 +657,7 @@ def bldgs_sizes(self, output, tf_radial_dim, tf_vertical_dim): # Divertor # Note: this estimation developed before the divertor design has been finalised - if cost_variables.life_div_fpy != 0.0e0: # noqa: RUF069 + if self.data.costs.life_div_fpy != 0.0e0: # noqa: RUF069 hcomp_height = divertor_variables.dz_divertor hcomp_rad_thk = 2 * physics_variables.rminor hcomp_tor_thk = physics_variables.rmajor + physics_variables.rminor @@ -670,7 +669,7 @@ def bldgs_sizes(self, output, tf_radial_dim, tf_vertical_dim): ) hcomp_req_supply = ( tfcoil_variables.n_tf_coils - * (cost_variables.life_plant / cost_variables.life_div_fpy) + * (self.data.costs.life_plant / self.data.costs.life_div_fpy) ) * buildings_variables.qnty_sfty_fac # total storage space for required supply of divertor segments div_hotcell_vol = hcomp_req_supply * hcomp_vol @@ -678,7 +677,7 @@ def bldgs_sizes(self, output, tf_radial_dim, tf_vertical_dim): div_hotcell_vol = 0.0e0 # Centre post - if cost_variables.cplife != 0.0e0: # noqa: RUF069 + if self.data.costs.cplife != 0.0e0: # noqa: RUF069 hcomp_height = 2 * build_variables.z_tf_inside_half if tfcoil_variables.i_tf_sup != 1: hcomp_rad_thk = build_variables.r_cp_top @@ -692,7 +691,7 @@ def bldgs_sizes(self, output, tf_radial_dim, tf_vertical_dim): hcomp_rad_thk + buildings_variables.hot_sepdist ) hcomp_req_supply = ( - cost_variables.life_plant / cost_variables.cplife + self.data.costs.life_plant / self.data.costs.cplife ) * buildings_variables.qnty_sfty_fac # total storage space for required supply of centre posts cp_hotcell_vol = hcomp_req_supply * hcomp_vol diff --git a/process/models/costs/costs.py b/process/models/costs/costs.py index 533c9a3f7a..a0528dcf43 100644 --- a/process/models/costs/costs.py +++ b/process/models/costs/costs.py @@ -9,7 +9,6 @@ from process.data_structure import ( build_variables, buildings_variables, - cost_variables, current_drive_variables, divertor_variables, first_wall_variables, @@ -72,31 +71,31 @@ def run(self): self.acc26() # Total plant direct cost - # cdirt = c21 + c22 + cost_variables.c23 + cost_variables.c24 + cost_variables.c25 + cost_variables.c26 + chplant - cost_variables.cdirt = ( - cost_variables.c21 - + cost_variables.c22 - + cost_variables.c23 - + cost_variables.c24 - + cost_variables.c25 - + cost_variables.c26 + # cdirt = c21 + c22 + self.data.costs.c23 + self.data.costs.c24 + self.data.costs.c25 + self.data.costs.c26 + self.data.costs.cdirt = ( + self.data.costs.c21 + + self.data.costs.c22 + + self.data.costs.c23 + + self.data.costs.c24 + + self.data.costs.c25 + + self.data.costs.c26 ) # Account 9 : Indirect cost and project contingency self.acc9() # Constructed cost - cost_variables.concost = ( - cost_variables.cdirt + cost_variables.cindrt + cost_variables.ccont + self.data.costs.concost = ( + self.data.costs.cdirt + self.data.costs.cindrt + self.data.costs.ccont ) # Cost of electricity - if (cost_variables.ireactor == 1) and (cost_variables.ipnet == 0): + if (self.data.costs.ireactor == 1) and (self.data.costs.ipnet == 0): self.coelc() def output(self): self.run() - if cost_variables.output_costs == 0: + if self.data.costs.output_costs == 0: return po.oheadr(self.outfile, "Power Reactor Costs (1990 US$)") @@ -113,89 +112,89 @@ def output(self): self.outfile, "Divertor life (years)", "(life_div)", - cost_variables.life_div, + self.data.costs.life_div, ) if physics_variables.itart == 1: po.ovarrf( self.outfile, "Centrepost life (years)", "(cplife_cal)", - cost_variables.cplife_cal, + self.data.costs.cplife_cal, ) po.ovarrf( - self.outfile, "Cost of electricity (m$/kWh)", "(coe)", cost_variables.coe + self.outfile, "Cost of electricity (m$/kWh)", "(coe)", self.data.costs.coe ) po.osubhd(self.outfile, "Power Generation Costs :") # TODO: Convert fortran format to Python # if ((annfwbl != annfwbl) or (annfwbl > 1.0e10) or (annfwbl < 0.0e0)) : # write(outfile,*)'Problem with annfwbl' - # write(outfile,*)'fwallcst=', fwallcst, ' blkcst=', cost_variables.blkcst - # write(outfile,*)'crffwbl=', crffwbl, ' fcap0cp=', cost_variables.fcap0cp + # write(outfile,*)'fwallcst=', fwallcst, ' blkcst=', self.data.costs.blkcst + # write(outfile,*)'crffwbl=', crffwbl, ' fcap0cp=', self.data.costs.fcap0cp # write(outfile,*)'feffwbl=', feffwbl, ' fwbllife=', fwbllife # write(outfile,200) # anncap,coecap, # annoam,coeoam, # anndecom,coedecom, # annfwbl,coefwbl, # anndiv,coediv, # anncp,coecp, # anncdr,coecdr, # annfuel,coefuel, # annwst,coewst, # annfuelt,coefuelt, # anntot,coe # 200 format( # t76,'Annual Costs, M$ COE, m$/kWh'// # 1x,'Capital Investment',t80,f10.2,10x,f10.2/ # 1x,'Operation & Maintenance',t80,f10.2,10x,f10.2/ # 1x,'Decommissioning Fund',t80,f10.2,10x,f10.2/ # 1x,'Fuel Charge Breakdown'// # 5x,'Blanket & first wall',t72,f10.2,10x,f10.2/ # 5x,'Divertors',t72,f10.2,10x,f10.2/ # 5x,'Centrepost (TART only)',t72,f10.2,10x,f10.2/ # 5x,'Auxiliary Heating',t72,f10.2,10x,f10.2/ # 5x,'Actual Fuel',t72,f10.2,10x,f10.2/ # 5x,'Waste Disposal',t72,f10.2,10x,f10.2/ # 1x,'Total Fuel Cost',t80,f10.2,10x,f10.2// # 1x,'Total Cost',t80,f10.2,10x,f10.2 ) - if cost_variables.ifueltyp == 1: + if self.data.costs.ifueltyp == 1: po.oshead(self.outfile, "Replaceable Components Direct Capital Cost") po.ovarrf( self.outfile, "First wall direct capital cost (M$)", "(fwallcst)", - cost_variables.fwallcst, + self.data.costs.fwallcst, ) po.ovarrf( self.outfile, "Blanket direct capital cost (M$)", "(blkcst)", - cost_variables.blkcst, + self.data.costs.blkcst, ) if ife_variables.ife != 1: po.ovarrf( self.outfile, "Divertor direct capital cost (M$)", "(divcst)", - cost_variables.divcst, + self.data.costs.divcst, ) if physics_variables.itart == 1: po.ovarrf( self.outfile, "Centrepost direct capital cost (M$)", "(cpstcst)", - cost_variables.cpstcst, + self.data.costs.cpstcst, ) po.ovarrf( self.outfile, "Plasma heating/CD system cap cost (M$)", "", - cost_variables.cdcost - * cost_variables.fcdfuel - / (1.0e0 - cost_variables.fcdfuel), + self.data.costs.cdcost + * self.data.costs.fcdfuel + / (1.0e0 - self.data.costs.fcdfuel), ) po.ovarrf( self.outfile, "Fraction of CD cost --> fuel cost", "(fcdfuel)", - cost_variables.fcdfuel, + self.data.costs.fcdfuel, ) else: po.ovarrf( self.outfile, "IFE driver system direct cap cost (M$)", "", - cost_variables.cdcost - * cost_variables.fcdfuel - / (1.0e0 - cost_variables.fcdfuel), + self.data.costs.cdcost + * self.data.costs.fcdfuel + / (1.0e0 - self.data.costs.fcdfuel), ) po.ovarrf( self.outfile, "Fraction of driver cost --> fuel cost", "(fcdfuel)", - cost_variables.fcdfuel, + self.data.costs.fcdfuel, ) po.oheadr(self.outfile, "Detailed Costings (1990 US$)") @@ -203,195 +202,197 @@ def output(self): self.outfile, "Acc.22 multiplier for Nth of a kind", "(fkind)", - cost_variables.fkind, + self.data.costs.fkind, + ) + po.ovarin( + self.outfile, "Level of Safety Assurance", "(lsa)", self.data.costs.lsa ) - po.ovarin(self.outfile, "Level of Safety Assurance", "(lsa)", cost_variables.lsa) po.oblnkl(self.outfile) po.oshead(self.outfile, "Structures and Site Facilities") po.ocosts( self.outfile, "(c211)", "Site improvements, facilities, land (M$)", - cost_variables.c211, + self.data.costs.c211, ) po.ocosts( self.outfile, "(c212)", "Reactor building cost (M$)", - cost_variables.c212, + self.data.costs.c212, ) po.ocosts( self.outfile, "(c213)", "Turbine building cost (M$)", - cost_variables.c213, + self.data.costs.c213, ) po.ocosts( self.outfile, "(c2141)", "Reactor maintenance building cost (M$)", - cost_variables.c2141, + self.data.costs.c2141, ) - po.ocosts(self.outfile, "(c2142)", "Warm shop cost (M$)", cost_variables.c2142) + po.ocosts(self.outfile, "(c2142)", "Warm shop cost (M$)", self.data.costs.c2142) po.ocosts( self.outfile, "(c215)", "Tritium building cost (M$)", - cost_variables.c215, + self.data.costs.c215, ) po.ocosts( self.outfile, "(c216)", "Electrical equipment building cost (M$)", - cost_variables.c216, + self.data.costs.c216, ) po.ocosts( self.outfile, "(c2171)", "Additional buildings cost (M$)", - cost_variables.c2171, + self.data.costs.c2171, ) po.ocosts( self.outfile, "(c2172)", "Control room buildings cost (M$)", - cost_variables.c2172, + self.data.costs.c2172, ) po.ocosts( self.outfile, "(c2173)", "Shop and warehouses cost (M$)", - cost_variables.c2173, + self.data.costs.c2173, ) po.ocosts( self.outfile, "(c2174)", "Cryogenic building cost (M$)", - cost_variables.c2174, + self.data.costs.c2174, ) po.oblnkl(self.outfile) po.ocosts( self.outfile, "(c21)", "Total account 21 cost (M$)", - cost_variables.c21, + self.data.costs.c21, ) po.oshead(self.outfile, "Reactor Systems") - po.ocosts(self.outfile, "(c2211)", "First wall cost (M$)", cost_variables.c2211) + po.ocosts(self.outfile, "(c2211)", "First wall cost (M$)", self.data.costs.c2211) if ife_variables.ife != 1: po.ocosts( self.outfile, "(c22121)", "Blanket beryllium cost (M$)", - cost_variables.c22121, + self.data.costs.c22121, ) po.ocosts( self.outfile, "(c22122)", "Blanket breeder material cost (M$)", - cost_variables.c22122, + self.data.costs.c22122, ) po.ocosts( self.outfile, "(c22123)", "Blanket stainless steel cost (M$)", - cost_variables.c22123, + self.data.costs.c22123, ) po.ocosts( self.outfile, "(c22124)", "Blanket vanadium cost (M$)", - cost_variables.c22124, + self.data.costs.c22124, ) else: # IFE po.ocosts( self.outfile, "(c22121)", "Blanket beryllium cost (M$)", - cost_variables.c22121, + self.data.costs.c22121, ) po.ocosts( self.outfile, "(c22122)", "Blanket lithium oxide cost (M$)", - cost_variables.c22122, + self.data.costs.c22122, ) po.ocosts( self.outfile, "(c22123)", "Blanket stainless steel cost (M$)", - cost_variables.c22123, + self.data.costs.c22123, ) po.ocosts( self.outfile, "(c22124)", "Blanket vanadium cost (M$)", - cost_variables.c22124, + self.data.costs.c22124, ) po.ocosts( self.outfile, "(c22125)", "Blanket carbon cloth cost (M$)", - cost_variables.c22125, + self.data.costs.c22125, ) po.ocosts( self.outfile, "(c22126)", "Blanket concrete cost (M$)", - cost_variables.c22126, + self.data.costs.c22126, ) po.ocosts( self.outfile, "(c22127)", "Blanket FLiBe cost (M$)", - cost_variables.c22127, + self.data.costs.c22127, ) po.ocosts( self.outfile, "(c22128)", "Blanket lithium cost (M$)", - cost_variables.c22128, + self.data.costs.c22128, ) po.ocosts( self.outfile, "(c2212)", "Blanket total cost (M$)", - cost_variables.c2212, + self.data.costs.c2212, ) po.ocosts( self.outfile, "(c22131)", "Bulk shield cost (M$)", - cost_variables.c22131, + self.data.costs.c22131, ) po.ocosts( self.outfile, "(c22132)", "Penetration shielding cost (M$)", - cost_variables.c22132, + self.data.costs.c22132, ) po.ocosts( self.outfile, "(c2213)", "Total shield cost (M$)", - cost_variables.c2213, + self.data.costs.c2213, ) po.ocosts( self.outfile, "(c2214)", "Total support structure cost (M$)", - cost_variables.c2214, + self.data.costs.c2214, ) - po.ocosts(self.outfile, "(c2215)", "Divertor cost (M$)", cost_variables.c2215) + po.ocosts(self.outfile, "(c2215)", "Divertor cost (M$)", self.data.costs.c2215) # TODO: Convert fortran format to Python - # if (cost_variables.ifueltyp == 1) : + # if (self.data.costs.ifueltyp == 1) : # po.oblnkl(self.outfile) # write(self.outfile,20) # 20 format(t2, 'First wall, total blanket and divertor direct costs',/, t2,'are zero as they are assumed to be fuel costs.') - # elif (cost_variables.ifueltyp == 2) : + # elif (self.data.costs.ifueltyp == 2) : # po.oblnkl(self.outfile) # write(self.outfile,31) # 21 format(t2, 'Initial First wall, total blanket and divertor direct costs',/, t2,'are in capital and replacemnet are in cost of electricity') @@ -401,7 +402,7 @@ def output(self): self.outfile, "(c221)", "Total account 221 cost (M$)", - cost_variables.c221, + self.data.costs.c221, ) if ife_variables.ife != 1: @@ -415,108 +416,108 @@ def output(self): self.outfile, "(c22211)", "Centrepost costs (M$)", - cost_variables.c22211, + self.data.costs.c22211, ) else: po.ocosts( self.outfile, "(c22211)", "Inboard leg cost (M$)", - cost_variables.c22211, + self.data.costs.c22211, ) po.ocosts( self.outfile, "(c22212)", "Outboard leg cost (M$)", - cost_variables.c22212, + self.data.costs.c22212, ) po.ocosts( self.outfile, "(c2221)", "TF magnet assemblies cost (M$)", - cost_variables.c2221, + self.data.costs.c2221, ) else: # Superconducting TF coils po.ocosts( self.outfile, "(c22211)", "TF coil conductor cost (M$)", - cost_variables.c22211, + self.data.costs.c22211, ) po.ocosts( self.outfile, "(c22212)", "TF coil winding cost (M$)", - cost_variables.c22212, + self.data.costs.c22212, ) po.ocosts( self.outfile, "(c22213)", "TF coil case cost (M$)", - cost_variables.c22213, + self.data.costs.c22213, ) po.ocosts( self.outfile, "(c22214)", "TF intercoil structure cost (M$)", - cost_variables.c22214, + self.data.costs.c22214, ) po.ocosts( self.outfile, "(c22215)", "TF coil gravity support structure (M$)", - cost_variables.c22215, + self.data.costs.c22215, ) po.ocosts( self.outfile, "(c2221)", "TF magnet assemblies cost (M$)", - cost_variables.c2221, + self.data.costs.c2221, ) po.ocosts( self.outfile, "(c22221)", "PF coil conductor cost (M$)", - cost_variables.c22221, + self.data.costs.c22221, ) po.ocosts( self.outfile, "(c22222)", "PF coil winding cost (M$)", - cost_variables.c22222, + self.data.costs.c22222, ) po.ocosts( self.outfile, "(c22223)", "PF coil case cost (M$)", - cost_variables.c22223, + self.data.costs.c22223, ) po.ocosts( self.outfile, "(c22224)", "PF coil support structure cost (M$)", - cost_variables.c22224, + self.data.costs.c22224, ) po.ocosts( self.outfile, "(c2222)", "PF magnet assemblies cost (M$)", - cost_variables.c2222, + self.data.costs.c2222, ) po.ocosts( self.outfile, "(c2223)", "Vacuum vessel assembly cost (M$)", - cost_variables.c2223, + self.data.costs.c2223, ) # TODO: Convert fortran format to Python - # if ((physics_variables.itart == 1)and(cost_variables.ifueltyp == 1)) : + # if ((physics_variables.itart == 1)and(self.data.costs.ifueltyp == 1)) : # po.oblnkl(self.outfile) # write(self.outfile,30) # 30 format(t2, 'Centrepost direct cost is zero, as it ', 'is assumed to be a fuel cost.') - # elif ((physics_variables.itart == 1)and(cost_variables.ifueltyp == 2)) : + # elif ((physics_variables.itart == 1)and(self.data.costs.ifueltyp == 2)) : # po.oblnkl(self.outfile) # write(self.outfile,31) # 31 format(t2, 'Initial centrepost direct cost in included in capital ', 'cost and replacements are assumed to be a fuel cost.') @@ -526,7 +527,7 @@ def output(self): self.outfile, "(c222)", "Total account 222 cost (M$)", - cost_variables.c222, + self.data.costs.c222, ) po.oshead(self.outfile, "Power Injection") @@ -536,26 +537,26 @@ def output(self): self.outfile, "(c2231)", "IFE driver system cost (M$)", - cost_variables.c2231, + self.data.costs.c2231, ) else: po.ocosts( self.outfile, "(c2231)", "ECH system cost (M$)", - cost_variables.c2231, + self.data.costs.c2231, ) po.ocosts( self.outfile, "(c2232)", "Lower hybrid system cost (M$)", - cost_variables.c2232, + self.data.costs.c2232, ) po.ocosts( self.outfile, "(c2233)", "Neutral beam system cost (M$)", - cost_variables.c2233, + self.data.costs.c2233, ) po.oblnkl(self.outfile) @@ -563,7 +564,7 @@ def output(self): self.outfile, "(c223)", "Total account 223 cost (M$)", - cost_variables.c223, + self.data.costs.c223, ) po.oshead(self.outfile, "Vacuum Systems") @@ -571,39 +572,39 @@ def output(self): self.outfile, "(c2241)", "High vacuum pumps cost (M$)", - cost_variables.c2241, + self.data.costs.c2241, ) po.ocosts( self.outfile, "(c2242)", "Backing pumps cost (M$)", - cost_variables.c2242, + self.data.costs.c2242, ) po.ocosts( self.outfile, "(c2243)", "Vacuum duct cost (M$)", - cost_variables.c2243, + self.data.costs.c2243, ) - po.ocosts(self.outfile, "(c2244)", "Valves cost (M$)", cost_variables.c2244) + po.ocosts(self.outfile, "(c2244)", "Valves cost (M$)", self.data.costs.c2244) po.ocosts( self.outfile, "(c2245)", "Duct shielding cost (M$)", - cost_variables.c2245, + self.data.costs.c2245, ) po.ocosts( self.outfile, "(c2246)", "Instrumentation cost (M$)", - cost_variables.c2246, + self.data.costs.c2246, ) po.oblnkl(self.outfile) po.ocosts( self.outfile, "(c224)", "Total account 224 cost (M$)", - cost_variables.c224, + self.data.costs.c224, ) if ife_variables.ife != 1: @@ -612,98 +613,98 @@ def output(self): self.outfile, "(c22511)", "TF coil power supplies cost (M$)", - cost_variables.c22511, + self.data.costs.c22511, ) po.ocosts( self.outfile, "(c22512)", "TF coil breakers cost (M$)", - cost_variables.c22512, + self.data.costs.c22512, ) po.ocosts( self.outfile, "(c22513)", "TF coil dump resistors cost (M$)", - cost_variables.c22513, + self.data.costs.c22513, ) po.ocosts( self.outfile, "(c22514)", "TF coil instrumentation and control (M$)", - cost_variables.c22514, + self.data.costs.c22514, ) po.ocosts( self.outfile, "(c22515)", "TF coil bussing cost (M$)", - cost_variables.c22515, + self.data.costs.c22515, ) po.ocosts( self.outfile, "(c2251)", "Total, TF coil power costs (M$)", - cost_variables.c2251, + self.data.costs.c2251, ) po.ocosts( self.outfile, "(c22521)", "PF coil power supplies cost (M$)", - cost_variables.c22521, + self.data.costs.c22521, ) po.ocosts( self.outfile, "(c22522)", "PF coil instrumentation and control (M$)", - cost_variables.c22522, + self.data.costs.c22522, ) po.ocosts( self.outfile, "(c22523)", "PF coil bussing cost (M$)", - cost_variables.c22523, + self.data.costs.c22523, ) po.ocosts( self.outfile, "(c22524)", "PF coil burn power supplies cost (M$)", - cost_variables.c22524, + self.data.costs.c22524, ) po.ocosts( self.outfile, "(c22525)", "PF coil breakers cost (M$)", - cost_variables.c22525, + self.data.costs.c22525, ) po.ocosts( self.outfile, "(c22526)", "PF coil dump resistors cost (M$)", - cost_variables.c22526, + self.data.costs.c22526, ) po.ocosts( self.outfile, "(c22527)", "PF coil ac breakers cost (M$)", - cost_variables.c22527, + self.data.costs.c22527, ) po.ocosts( self.outfile, "(c2252)", "Total, PF coil power costs (M$)", - cost_variables.c2252, + self.data.costs.c2252, ) po.ocosts( self.outfile, "(c2253)", "Total, energy storage cost (M$)", - cost_variables.c2253, + self.data.costs.c2253, ) po.oblnkl(self.outfile) po.ocosts( self.outfile, "(c225)", "Total account 225 cost (M$)", - cost_variables.c225, + self.data.costs.c225, ) po.oshead(self.outfile, "Heat Transport System") @@ -711,44 +712,44 @@ def output(self): self.outfile, "(cpp)", "Pumps and piping system cost (M$)", - cost_variables.cpp, + self.data.costs.cpp, ) po.ocosts( self.outfile, "(chx)", "Primary heat exchanger cost (M$)", - cost_variables.chx, + self.data.costs.chx, ) po.ocosts( self.outfile, "(c2261)", "Total, reactor cooling system cost (M$)", - cost_variables.c2261, + self.data.costs.c2261, ) po.ocosts( self.outfile, "(cppa)", "Pumps, piping cost (M$)", - cost_variables.cppa, + self.data.costs.cppa, ) po.ocosts( self.outfile, "(c2262)", "Total, auxiliary cooling system cost (M$)", - cost_variables.c2262, + self.data.costs.c2262, ) po.ocosts( self.outfile, "(c2263)", "Total, cryogenic system cost (M$)", - cost_variables.c2263, + self.data.costs.c2263, ) po.oblnkl(self.outfile) po.ocosts( self.outfile, "(c226)", "Total account 226 cost (M$)", - cost_variables.c226, + self.data.costs.c226, ) po.oshead(self.outfile, "Fuel Handling System") @@ -756,32 +757,32 @@ def output(self): self.outfile, "(c2271)", "Fuelling system cost (M$)", - cost_variables.c2271, + self.data.costs.c2271, ) po.ocosts( self.outfile, "(c2272)", "Fuel processing and purification cost (M$)", - cost_variables.c2272, + self.data.costs.c2272, ) po.ocosts( self.outfile, "(c2273)", "Atmospheric recovery systems cost (M$)", - cost_variables.c2273, + self.data.costs.c2273, ) po.ocosts( self.outfile, "(c2274)", "Nuclear building ventilation cost (M$)", - cost_variables.c2274, + self.data.costs.c2274, ) po.oblnkl(self.outfile) po.ocosts( self.outfile, "(c227)", "Total account 227 cost (M$)", - cost_variables.c227, + self.data.costs.c227, ) po.oshead(self.outfile, "Instrumentation and Control") @@ -789,7 +790,7 @@ def output(self): self.outfile, "(c228)", "Instrumentation and control cost (M$)", - cost_variables.c228, + self.data.costs.c228, ) po.oshead(self.outfile, "Maintenance Equipment") @@ -797,7 +798,7 @@ def output(self): self.outfile, "(c229)", "Maintenance equipment cost (M$)", - cost_variables.c229, + self.data.costs.c229, ) po.oshead(self.outfile, "Total Account 22 Cost") @@ -805,7 +806,7 @@ def output(self): self.outfile, "(c22)", "Total account 22 cost (M$)", - cost_variables.c22, + self.data.costs.c22, ) po.oshead(self.outfile, "Turbine Plant Equipment") @@ -813,7 +814,7 @@ def output(self): self.outfile, "(c23)", "Turbine plant equipment cost (M$)", - cost_variables.c23, + self.data.costs.c23, ) po.oshead(self.outfile, "Electric Plant Equipment") @@ -821,33 +822,33 @@ def output(self): self.outfile, "(c241)", "Switchyard equipment cost (M$)", - cost_variables.c241, + self.data.costs.c241, ) - po.ocosts(self.outfile, "(c242)", "Transformers cost (M$)", cost_variables.c242) + po.ocosts(self.outfile, "(c242)", "Transformers cost (M$)", self.data.costs.c242) po.ocosts( self.outfile, "(c243)", "Low voltage equipment cost (M$)", - cost_variables.c243, + self.data.costs.c243, ) po.ocosts( self.outfile, "(c244)", "Diesel backup equipment cost (M$)", - cost_variables.c244, + self.data.costs.c244, ) po.ocosts( self.outfile, "(c245)", "Auxiliary facilities cost (M$)", - cost_variables.c245, + self.data.costs.c245, ) po.oblnkl(self.outfile) po.ocosts( self.outfile, "(c24)", "Total account 24 cost (M$)", - cost_variables.c24, + self.data.costs.c24, ) po.oshead(self.outfile, "Miscellaneous Plant Equipment") @@ -855,7 +856,7 @@ def output(self): self.outfile, "(c25)", "Miscellaneous plant equipment cost (M$)", - cost_variables.c25, + self.data.costs.c25, ) po.oshead(self.outfile, "Heat Rejection System") @@ -863,12 +864,12 @@ def output(self): self.outfile, "(c26)", "Heat rejection system cost (M$)", - cost_variables.c26, + self.data.costs.c26, ) po.oshead(self.outfile, "Plant Direct Cost") po.ocosts( - self.outfile, "(cdirt)", "Plant direct cost (M$)", cost_variables.cdirt + self.outfile, "(cdirt)", "Plant direct cost (M$)", self.data.costs.cdirt ) po.oshead(self.outfile, "Reactor Core Cost") @@ -876,18 +877,18 @@ def output(self): self.outfile, "(crctcore)", "Reactor core cost (M$)", - cost_variables.crctcore, + self.data.costs.crctcore, ) po.oshead(self.outfile, "Indirect Cost") - po.ocosts(self.outfile, "(c9)", "Indirect cost (M$)", cost_variables.cindrt) + po.ocosts(self.outfile, "(c9)", "Indirect cost (M$)", self.data.costs.cindrt) po.oshead(self.outfile, "Total Contingency") po.ocosts( self.outfile, "(ccont)", "Total contingency (M$)", - cost_variables.ccont, + self.data.costs.ccont, ) po.oshead(self.outfile, "Constructed Cost") @@ -895,16 +896,16 @@ def output(self): self.outfile, "(concost)", "Constructed cost (M$)", - cost_variables.concost, + self.data.costs.concost, ) - if cost_variables.ireactor == 1: + if self.data.costs.ireactor == 1: po.oshead(self.outfile, "Interest during Construction") po.ocosts( self.outfile, "(moneyint)", "Interest during construction (M$)", - cost_variables.moneyint, + self.data.costs.moneyint, ) po.oshead(self.outfile, "Total Capital Investment") @@ -912,7 +913,7 @@ def output(self): self.outfile, "(capcost)", "Total capital investment (M$)", - cost_variables.capcost, + self.data.costs.capcost, ) def acc22(self): @@ -955,21 +956,21 @@ def acc22(self): self.acc229() # Reactor core costs - cost_variables.crctcore = ( - cost_variables.c221 + cost_variables.c222 + cost_variables.c223 + self.data.costs.crctcore = ( + self.data.costs.c221 + self.data.costs.c222 + self.data.costs.c223 ) # Total account 22 - cost_variables.c22 = ( - cost_variables.c221 - + cost_variables.c222 - + cost_variables.c223 - + cost_variables.c224 - + cost_variables.c225 - + cost_variables.c226 - + cost_variables.c227 - + cost_variables.c228 - + cost_variables.c229 + self.data.costs.c22 = ( + self.data.costs.c221 + + self.data.costs.c222 + + self.data.costs.c223 + + self.data.costs.c224 + + self.data.costs.c225 + + self.data.costs.c226 + + self.data.costs.c227 + + self.data.costs.c228 + + self.data.costs.c229 ) def acc221(self): @@ -1002,12 +1003,12 @@ def acc221(self): # Total account 221 - cost_variables.c221 = ( - cost_variables.c2211 - + cost_variables.c2212 - + cost_variables.c2213 - + cost_variables.c2214 - + cost_variables.c2215 + self.data.costs.c221 = ( + self.data.costs.c2211 + + self.data.costs.c2212 + + self.data.costs.c2213 + + self.data.costs.c2214 + + self.data.costs.c2215 ) def acc222(self): @@ -1016,7 +1017,7 @@ def acc222(self): including the costs of associated cryostats. """ if ife_variables.ife == 1: - cost_variables.c222 = 0.0e0 + self.data.costs.c222 = 0.0e0 return # Account 222.1 : TF magnet assemblies @@ -1032,8 +1033,8 @@ def acc222(self): # Total account 222 - cost_variables.c222 = ( - cost_variables.c2221 + cost_variables.c2222 + cost_variables.c2223 + self.data.costs.c222 = ( + self.data.costs.c2221 + self.data.costs.c2222 + self.data.costs.c2223 ) def acc225(self): @@ -1041,7 +1042,7 @@ def acc225(self): This routine evaluates the Account 225 (power conditioning) costs. """ if ife_variables.ife == 1: - cost_variables.c225 = 0.0e0 + self.data.costs.c225 = 0.0e0 else: # Account 225.1 : TF coil power conditioning @@ -1057,8 +1058,8 @@ def acc225(self): # Total account 225 - cost_variables.c225 = ( - cost_variables.c2251 + cost_variables.c2252 + cost_variables.c2253 + self.data.costs.c225 = ( + self.data.costs.c2251 + self.data.costs.c2252 + self.data.costs.c2253 ) def acc21(self): @@ -1078,105 +1079,107 @@ def acc21(self): # Account 211 : Site improvements, facilities and land # N.B. Land unaffected by LSA - cost_variables.c211 = ( - cost_variables.csi * cmlsa[cost_variables.lsa - 1] + cost_variables.cland + self.data.costs.c211 = ( + self.data.costs.csi * cmlsa[self.data.costs.lsa - 1] + self.data.costs.cland ) # Account 212 : Reactor building - cost_variables.c212 = ( + self.data.costs.c212 = ( 1.0e-6 - * cost_variables.ucrb + * self.data.costs.ucrb * buildings_variables.rbvol**exprb - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) # Account 213 : Turbine building - if cost_variables.ireactor == 1: - cost_variables.c213 = cost_variables.cturbb * cmlsa[cost_variables.lsa - 1] + if self.data.costs.ireactor == 1: + self.data.costs.c213 = ( + self.data.costs.cturbb * cmlsa[self.data.costs.lsa - 1] + ) else: - cost_variables.c213 = 0.0e0 + self.data.costs.c213 = 0.0e0 # Account 214 : Reactor maintenance and warm shops buildings - cost_variables.c2141 = ( + self.data.costs.c2141 = ( 1.0e-6 - * cost_variables.UCMB + * self.data.costs.UCMB * buildings_variables.rmbvol**exprb - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c2142 = ( + self.data.costs.c2142 = ( 1.0e-6 - * cost_variables.UCWS + * self.data.costs.UCWS * buildings_variables.wsvol**exprb - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c214 = cost_variables.c2141 + cost_variables.c2142 + self.data.costs.c214 = self.data.costs.c2141 + self.data.costs.c2142 # Account 215 : Tritium building - cost_variables.c215 = ( + self.data.costs.c215 = ( 1.0e-6 - * cost_variables.UCTR + * self.data.costs.UCTR * buildings_variables.triv**exprb - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) # Account 216 : Electrical equipment building - cost_variables.c216 = ( + self.data.costs.c216 = ( 1.0e-6 - * cost_variables.UCEL + * self.data.costs.UCEL * buildings_variables.elevol**exprb - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) # Account 217 : Other buildings # Includes administration, control, shops, cryogenic # plant and an allowance for miscellaneous structures - cost_variables.c2171 = ( + self.data.costs.c2171 = ( 1.0e-6 - * cost_variables.UCAD + * self.data.costs.UCAD * buildings_variables.admvol**exprb - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c2172 = ( + self.data.costs.c2172 = ( 1.0e-6 - * cost_variables.UCCO + * self.data.costs.UCCO * buildings_variables.convol**exprb - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c2173 = ( + self.data.costs.c2173 = ( 1.0e-6 - * cost_variables.UCSH + * self.data.costs.UCSH * buildings_variables.shovol**exprb - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c2174 = ( + self.data.costs.c2174 = ( 1.0e-6 - * cost_variables.UCCR + * self.data.costs.UCCR * buildings_variables.cryvol**exprb - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c217 = ( - cost_variables.c2171 - + cost_variables.c2172 - + cost_variables.c2173 - + cost_variables.c2174 + self.data.costs.c217 = ( + self.data.costs.c2171 + + self.data.costs.c2172 + + self.data.costs.c2173 + + self.data.costs.c2174 ) # Total for Account 21 - cost_variables.c21 = ( - cost_variables.c211 - + cost_variables.c212 - + cost_variables.c213 - + cost_variables.c214 - + cost_variables.c215 - + cost_variables.c216 - + cost_variables.c217 + self.data.costs.c21 = ( + self.data.costs.c211 + + self.data.costs.c212 + + self.data.costs.c213 + + self.data.costs.c214 + + self.data.costs.c215 + + self.data.costs.c216 + + self.data.costs.c217 ) def acc2211(self): @@ -1191,21 +1194,21 @@ def acc2211(self): cmlsa = [0.5000e0, 0.7500e0, 0.8750e0, 1.0000e0] if ife_variables.ife != 1: - cost_variables.c2211 = ( + self.data.costs.c2211 = ( 1.0e-6 - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] * ( - (cost_variables.UCFWA + cost_variables.UCFWS) + (self.data.costs.UCFWA + self.data.costs.UCFWS) * first_wall_variables.a_fw_total - + cost_variables.UCFWPS + + self.data.costs.UCFWPS ) ) else: - cost_variables.c2211 = ( + self.data.costs.c2211 = ( 1.0e-6 - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] * ( - cost_variables.ucblss + self.data.costs.ucblss * ( ife_variables.fwmatm[0, 0] + ife_variables.fwmatm[1, 0] @@ -1217,7 +1220,7 @@ def acc2211(self): + ife_variables.fwmatm[1, 1] + ife_variables.fwmatm[2, 1] ) - + cost_variables.ucblli2o + + self.data.costs.ucblli2o * ( ife_variables.fwmatm[0, 3] + ife_variables.fwmatm[1, 3] @@ -1232,15 +1235,15 @@ def acc2211(self): ) ) - cost_variables.c2211 = cost_variables.fkind * cost_variables.c2211 + self.data.costs.c2211 = self.data.costs.fkind * self.data.costs.c2211 - if cost_variables.ifueltyp == 1: - cost_variables.fwallcst = cost_variables.c2211 - cost_variables.c2211 = 0.0e0 - elif cost_variables.ifueltyp == 2: - cost_variables.fwallcst = cost_variables.c2211 + if self.data.costs.ifueltyp == 1: + self.data.costs.fwallcst = self.data.costs.c2211 + self.data.costs.c2211 = 0.0e0 + elif self.data.costs.ifueltyp == 2: + self.data.costs.fwallcst = self.data.costs.c2211 else: - cost_variables.fwallcst = 0.0e0 + self.data.costs.fwallcst = 0.0e0 def acc2212(self): """Account 221.2 : Blanket @@ -1254,38 +1257,38 @@ def acc2212(self): if ife_variables.ife != 1: # Solid blanket (Li2O + Be) - cost_variables.c22121 = ( - 1.0e-6 * fwbs_variables.m_blkt_beryllium * cost_variables.ucblbe + self.data.costs.c22121 = ( + 1.0e-6 * fwbs_variables.m_blkt_beryllium * self.data.costs.ucblbe ) # CCFE model - cost_variables.c22122 = ( - 1.0e-6 * fwbs_variables.m_blkt_li2o * cost_variables.ucblli2o + self.data.costs.c22122 = ( + 1.0e-6 * fwbs_variables.m_blkt_li2o * self.data.costs.ucblli2o ) - cost_variables.c22123 = ( - 1.0e-6 * fwbs_variables.m_blkt_steel_total * cost_variables.ucblss + self.data.costs.c22123 = ( + 1.0e-6 * fwbs_variables.m_blkt_steel_total * self.data.costs.ucblss ) - cost_variables.c22124 = ( - 1.0e-6 * fwbs_variables.m_blkt_vanadium * cost_variables.ucblvd + self.data.costs.c22124 = ( + 1.0e-6 * fwbs_variables.m_blkt_vanadium * self.data.costs.ucblvd ) - cost_variables.c22125 = 0.0e0 - cost_variables.c22126 = 0.0e0 - cost_variables.c22127 = 0.0e0 + self.data.costs.c22125 = 0.0e0 + self.data.costs.c22126 = 0.0e0 + self.data.costs.c22127 = 0.0e0 else: # IFE blanket; materials present are Li2O, steel, carbon, concrete, # FLiBe and lithium - cost_variables.c22121 = 0.0e0 - cost_variables.c22122 = ( - 1.0e-6 * fwbs_variables.m_blkt_li2o * cost_variables.ucblli2o + self.data.costs.c22121 = 0.0e0 + self.data.costs.c22122 = ( + 1.0e-6 * fwbs_variables.m_blkt_li2o * self.data.costs.ucblli2o ) - cost_variables.c22123 = ( - 1.0e-6 * fwbs_variables.m_blkt_steel_total * cost_variables.ucblss + self.data.costs.c22123 = ( + 1.0e-6 * fwbs_variables.m_blkt_steel_total * self.data.costs.ucblss ) - cost_variables.c22124 = 0.0e0 - cost_variables.c22125 = ( + self.data.costs.c22124 = 0.0e0 + self.data.costs.c22125 = ( 1.0e-6 * ife_variables.uccarb * ( @@ -1294,7 +1297,7 @@ def acc2212(self): + ife_variables.blmatm[2, 1] ) ) - cost_variables.c22126 = ( + self.data.costs.c22126 = ( 1.0e-6 * ife_variables.ucconc * ( @@ -1303,50 +1306,64 @@ def acc2212(self): + ife_variables.blmatm[2, 4] ) ) - cost_variables.c22127 = 1.0e-6 * ife_variables.ucflib * ife_variables.mflibe - cost_variables.c22128 = ( - 1.0e-6 * cost_variables.ucblli * fwbs_variables.m_blkt_lithium - ) - - cost_variables.c22121 = ( - cost_variables.fkind * cost_variables.c22121 * cmlsa[cost_variables.lsa - 1] - ) - cost_variables.c22122 = ( - cost_variables.fkind * cost_variables.c22122 * cmlsa[cost_variables.lsa - 1] - ) - cost_variables.c22123 = ( - cost_variables.fkind * cost_variables.c22123 * cmlsa[cost_variables.lsa - 1] - ) - cost_variables.c22124 = ( - cost_variables.fkind * cost_variables.c22124 * cmlsa[cost_variables.lsa - 1] - ) - cost_variables.c22125 = ( - cost_variables.fkind * cost_variables.c22125 * cmlsa[cost_variables.lsa - 1] - ) - cost_variables.c22126 = ( - cost_variables.fkind * cost_variables.c22126 * cmlsa[cost_variables.lsa - 1] - ) - cost_variables.c22127 = ( - cost_variables.fkind * cost_variables.c22127 * cmlsa[cost_variables.lsa - 1] - ) - - cost_variables.c2212 = ( - cost_variables.c22121 - + cost_variables.c22122 - + cost_variables.c22123 - + cost_variables.c22124 - + cost_variables.c22125 - + cost_variables.c22126 - + cost_variables.c22127 - ) - - if cost_variables.ifueltyp == 1: - cost_variables.blkcst = cost_variables.c2212 - cost_variables.c2212 = 0.0e0 - elif cost_variables.ifueltyp == 2: - cost_variables.blkcst = cost_variables.c2212 + self.data.costs.c22127 = 1.0e-6 * ife_variables.ucflib * ife_variables.mflibe + self.data.costs.c22128 = ( + 1.0e-6 * self.data.costs.ucblli * fwbs_variables.m_blkt_lithium + ) + + self.data.costs.c22121 = ( + self.data.costs.fkind + * self.data.costs.c22121 + * cmlsa[self.data.costs.lsa - 1] + ) + self.data.costs.c22122 = ( + self.data.costs.fkind + * self.data.costs.c22122 + * cmlsa[self.data.costs.lsa - 1] + ) + self.data.costs.c22123 = ( + self.data.costs.fkind + * self.data.costs.c22123 + * cmlsa[self.data.costs.lsa - 1] + ) + self.data.costs.c22124 = ( + self.data.costs.fkind + * self.data.costs.c22124 + * cmlsa[self.data.costs.lsa - 1] + ) + self.data.costs.c22125 = ( + self.data.costs.fkind + * self.data.costs.c22125 + * cmlsa[self.data.costs.lsa - 1] + ) + self.data.costs.c22126 = ( + self.data.costs.fkind + * self.data.costs.c22126 + * cmlsa[self.data.costs.lsa - 1] + ) + self.data.costs.c22127 = ( + self.data.costs.fkind + * self.data.costs.c22127 + * cmlsa[self.data.costs.lsa - 1] + ) + + self.data.costs.c2212 = ( + self.data.costs.c22121 + + self.data.costs.c22122 + + self.data.costs.c22123 + + self.data.costs.c22124 + + self.data.costs.c22125 + + self.data.costs.c22126 + + self.data.costs.c22127 + ) + + if self.data.costs.ifueltyp == 1: + self.data.costs.blkcst = self.data.costs.c2212 + self.data.costs.c2212 = 0.0e0 + elif self.data.costs.ifueltyp == 2: + self.data.costs.blkcst = self.data.costs.c2212 else: - cost_variables.blkcst = 0.0e0 + self.data.costs.blkcst = 0.0e0 def acc2213(self): """Account 221.3 : Shield @@ -1355,18 +1372,18 @@ def acc2213(self): cmlsa = [0.5000e0, 0.7500e0, 0.8750e0, 1.0000e0] if ife_variables.ife != 1: - cost_variables.c22131 = ( + self.data.costs.c22131 = ( 1.0e-6 * fwbs_variables.whtshld - * cost_variables.ucshld - * cmlsa[cost_variables.lsa - 1] + * self.data.costs.ucshld + * cmlsa[self.data.costs.lsa - 1] ) else: - cost_variables.c22131 = ( + self.data.costs.c22131 = ( 1.0e-6 - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] * ( - cost_variables.ucshld + self.data.costs.ucshld * ( ife_variables.shmatm[0, 0] + ife_variables.shmatm[1, 0] @@ -1378,7 +1395,7 @@ def acc2213(self): + ife_variables.shmatm[1, 1] + ife_variables.shmatm[2, 1] ) - + cost_variables.ucblli2o + + self.data.costs.ucblli2o * ( ife_variables.shmatm[0, 3] + ife_variables.shmatm[1, 3] @@ -1393,22 +1410,22 @@ def acc2213(self): ) ) - cost_variables.c22131 = cost_variables.fkind * cost_variables.c22131 + self.data.costs.c22131 = self.data.costs.fkind * self.data.costs.c22131 # Penetration shield assumed to be typical steel plate if ife_variables.ife != 1: - cost_variables.c22132 = ( + self.data.costs.c22132 = ( 1.0e-6 * fwbs_variables.wpenshld - * cost_variables.ucpens - * cmlsa[cost_variables.lsa - 1] + * self.data.costs.ucpens + * cmlsa[self.data.costs.lsa - 1] ) else: - cost_variables.c22132 = 0.0e0 + self.data.costs.c22132 = 0.0e0 - cost_variables.c22132 = cost_variables.fkind * cost_variables.c22132 + self.data.costs.c22132 = self.data.costs.fkind * self.data.costs.c22132 - cost_variables.c2213 = cost_variables.c22131 + cost_variables.c22132 + self.data.costs.c2213 = self.data.costs.c22131 + self.data.costs.c22132 def acc2214(self): """Account 221.4 : Reactor structure @@ -1417,13 +1434,13 @@ def acc2214(self): """ cmlsa = [0.6700e0, 0.8350e0, 0.9175e0, 1.0000e0] - cost_variables.c2214 = ( + self.data.costs.c2214 = ( 1.0e-6 * structure_variables.gsmass - * cost_variables.UCGSS - * cmlsa[cost_variables.lsa - 1] + * self.data.costs.UCGSS + * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c2214 = cost_variables.fkind * cost_variables.c2214 + self.data.costs.c2214 = self.data.costs.fkind * self.data.costs.c2214 def acc2215(self): """Account 221.5 : Divertor @@ -1438,22 +1455,22 @@ def acc2215(self): and the replacement divertor costs ae treated as a fuel cost, """ if ife_variables.ife != 1: - cost_variables.c2215 = ( - 1.0e-6 * divertor_variables.a_div_surface_total * cost_variables.ucdiv + self.data.costs.c2215 = ( + 1.0e-6 * divertor_variables.a_div_surface_total * self.data.costs.ucdiv ) - cost_variables.c2215 = cost_variables.fkind * cost_variables.c2215 + self.data.costs.c2215 = self.data.costs.fkind * self.data.costs.c2215 - if cost_variables.ifueltyp == 1: - cost_variables.divcst = cost_variables.c2215 - cost_variables.c2215 = 0.0e0 - elif cost_variables.ifueltyp == 2: - cost_variables.divcst = cost_variables.c2215 + if self.data.costs.ifueltyp == 1: + self.data.costs.divcst = self.data.costs.c2215 + self.data.costs.c2215 = 0.0e0 + elif self.data.costs.ifueltyp == 2: + self.data.costs.divcst = self.data.costs.c2215 else: - cost_variables.divcst = 0.0e0 + self.data.costs.divcst = 0.0e0 else: - cost_variables.c2215 = 0.0e0 - cost_variables.divcst = 0.0e0 + self.data.costs.c2215 = 0.0e0 + self.data.costs.divcst = 0.0e0 def acc2221(self): """Account 222.1 : TF magnet assemblies @@ -1473,49 +1490,49 @@ def acc2221(self): ): # Resistive TF coils # Account 222.1.1 : Inboard TF coil legs - cost_variables.c22211 = ( + self.data.costs.c22211 = ( 1.0e-6 * tfcoil_variables.whtcp - * cost_variables.uccpcl1 - * cmlsa[cost_variables.lsa - 1] + * self.data.costs.uccpcl1 + * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c22211 = cost_variables.fkind * cost_variables.c22211 + self.data.costs.c22211 = self.data.costs.fkind * self.data.costs.c22211 - cost_variables.cpstcst = 0.0e0 # TART centrepost - if (physics_variables.itart == 1) and (cost_variables.ifueltyp == 1): - cost_variables.cpstcst = cost_variables.c22211 - cost_variables.c22211 = 0.0e0 - elif (physics_variables.itart == 1) and (cost_variables.ifueltyp == 2): - cost_variables.cpstcst = cost_variables.c22211 + self.data.costs.cpstcst = 0.0e0 # TART centrepost + if (physics_variables.itart == 1) and (self.data.costs.ifueltyp == 1): + self.data.costs.cpstcst = self.data.costs.c22211 + self.data.costs.c22211 = 0.0e0 + elif (physics_variables.itart == 1) and (self.data.costs.ifueltyp == 2): + self.data.costs.cpstcst = self.data.costs.c22211 # Account 222.1.2 : Outboard TF coil legs - cost_variables.c22212 = ( + self.data.costs.c22212 = ( 1.0e-6 * tfcoil_variables.whttflgs - * cost_variables.uccpclb - * cmlsa[cost_variables.lsa - 1] + * self.data.costs.uccpclb + * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c22212 = cost_variables.fkind * cost_variables.c22212 + self.data.costs.c22212 = self.data.costs.fkind * self.data.costs.c22212 # Total (copper) TF coil costs - cost_variables.c2221 = cost_variables.c22211 + cost_variables.c22212 + self.data.costs.c2221 = self.data.costs.c22211 + self.data.costs.c22212 else: # Superconducting TF coils # Account 222.1.1 : Conductor # Superconductor ($/m) - if cost_variables.supercond_cost_model == 0: + if self.data.costs.supercond_cost_model == 0: costtfsc = ( - cost_variables.ucsc[tfcoil_variables.i_tf_sc_mat - 1] + self.data.costs.ucsc[tfcoil_variables.i_tf_sc_mat - 1] * tfcoil_variables.m_tf_coil_superconductor / (tfcoil_variables.len_tf_coil * tfcoil_variables.n_tf_coil_turns) ) else: costtfsc = ( - cost_variables.sc_mat_cost_0[tfcoil_variables.i_tf_sc_mat - 1] + self.data.costs.sc_mat_cost_0[tfcoil_variables.i_tf_sc_mat - 1] * tfcoil_variables.j_crit_str_0[tfcoil_variables.i_tf_sc_mat - 1] / tfcoil_variables.j_crit_str_tf ) @@ -1523,7 +1540,7 @@ def acc2221(self): # Copper ($/m) costtfcu = ( - cost_variables.uccu + self.data.costs.uccu * tfcoil_variables.m_tf_coil_copper / (tfcoil_variables.len_tf_coil * tfcoil_variables.n_tf_coil_turns) ) @@ -1534,81 +1551,81 @@ def acc2221(self): # Total cost/metre of conductor (including sheath and fixed costs) - ctfconpm = costwire + cost_variables.cconshtf + cost_variables.cconfix + ctfconpm = costwire + self.data.costs.cconshtf + self.data.costs.cconfix # Total conductor costs - cost_variables.c22211 = ( + self.data.costs.c22211 = ( 1.0e-6 * ctfconpm * tfcoil_variables.n_tf_coils * tfcoil_variables.len_tf_coil * tfcoil_variables.n_tf_coil_turns ) - cost_variables.c22211 = ( - cost_variables.fkind - * cost_variables.c22211 - * cmlsa[cost_variables.lsa - 1] + self.data.costs.c22211 = ( + self.data.costs.fkind + * self.data.costs.c22211 + * cmlsa[self.data.costs.lsa - 1] ) # Account 222.1.2 : Winding - cost_variables.c22212 = ( + self.data.costs.c22212 = ( 1.0e-6 - * cost_variables.ucwindtf + * self.data.costs.ucwindtf * tfcoil_variables.n_tf_coils * tfcoil_variables.len_tf_coil * tfcoil_variables.n_tf_coil_turns ) - cost_variables.c22212 = ( - cost_variables.fkind - * cost_variables.c22212 - * cmlsa[cost_variables.lsa - 1] + self.data.costs.c22212 = ( + self.data.costs.fkind + * self.data.costs.c22212 + * cmlsa[self.data.costs.lsa - 1] ) # Account 222.1.3 : Case - cost_variables.c22213 = ( + self.data.costs.c22213 = ( 1.0e-6 - * (tfcoil_variables.m_tf_coil_case * cost_variables.uccase) + * (tfcoil_variables.m_tf_coil_case * self.data.costs.uccase) * tfcoil_variables.n_tf_coils ) - cost_variables.c22213 = ( - cost_variables.fkind - * cost_variables.c22213 - * cmlsa[cost_variables.lsa - 1] + self.data.costs.c22213 = ( + self.data.costs.fkind + * self.data.costs.c22213 + * cmlsa[self.data.costs.lsa - 1] ) # Account 222.1.4 : Intercoil structure - cost_variables.c22214 = ( - 1.0e-6 * structure_variables.aintmass * cost_variables.UCINT + self.data.costs.c22214 = ( + 1.0e-6 * structure_variables.aintmass * self.data.costs.UCINT ) - cost_variables.c22214 = ( - cost_variables.fkind - * cost_variables.c22214 - * cmlsa[cost_variables.lsa - 1] + self.data.costs.c22214 = ( + self.data.costs.fkind + * self.data.costs.c22214 + * cmlsa[self.data.costs.lsa - 1] ) # Account 222.1.5 : Gravity support structure - cost_variables.c22215 = ( - 1.0e-6 * structure_variables.clgsmass * cost_variables.UCGSS + self.data.costs.c22215 = ( + 1.0e-6 * structure_variables.clgsmass * self.data.costs.UCGSS ) - cost_variables.c22215 = ( - cost_variables.fkind - * cost_variables.c22215 - * cmlsa[cost_variables.lsa - 1] + self.data.costs.c22215 = ( + self.data.costs.fkind + * self.data.costs.c22215 + * cmlsa[self.data.costs.lsa - 1] ) # Total (superconducting) TF coil costs - cost_variables.c2221 = ( - cost_variables.c22211 - + cost_variables.c22212 - + cost_variables.c22213 - + cost_variables.c22214 - + cost_variables.c22215 + self.data.costs.c2221 = ( + self.data.costs.c22211 + + self.data.costs.c22212 + + self.data.costs.c22213 + + self.data.costs.c22214 + + self.data.costs.c22215 ) def acc2222(self): @@ -1643,7 +1660,7 @@ def acc2222(self): # each superconducting cable (so is zero for resistive coils) costpfsh = ( - 0.0 if pfcoil_variables.i_pf_conductor == 1 else cost_variables.cconshpf + 0.0 if pfcoil_variables.i_pf_conductor == 1 else self.data.costs.cconshpf ) # Non-Central Solenoid coils @@ -1653,14 +1670,14 @@ def acc2222(self): else: npf = pfcoil_variables.n_cs_pf_coils - cost_variables.c22221 = 0.0e0 + self.data.costs.c22221 = 0.0e0 for i in range(npf): # Superconductor ($/m) - if cost_variables.supercond_cost_model == 0: + if self.data.costs.supercond_cost_model == 0: if pfcoil_variables.i_pf_conductor == 0: costpfsc = ( - cost_variables.ucsc[pfcoil_variables.i_pf_superconductor - 1] + self.data.costs.ucsc[pfcoil_variables.i_pf_superconductor - 1] * (1.0e0 - pfcoil_variables.fcupfsu) * (1.0e0 - pfcoil_variables.f_a_pf_coil_void[i]) * abs( @@ -1677,7 +1694,7 @@ def acc2222(self): costpfsc = 0.0e0 elif pfcoil_variables.i_pf_conductor == 0: costpfsc = ( - cost_variables.sc_mat_cost_0[ + self.data.costs.sc_mat_cost_0[ pfcoil_variables.i_pf_superconductor - 1 ] * tfcoil_variables.j_crit_str_0[ @@ -1691,7 +1708,7 @@ def acc2222(self): # Copper ($/m) if pfcoil_variables.i_pf_conductor == 0: costpfcu = ( - cost_variables.uccu + self.data.costs.uccu * pfcoil_variables.fcupfsu * (1.0e0 - pfcoil_variables.f_a_pf_coil_void[i]) * abs( @@ -1704,7 +1721,7 @@ def acc2222(self): ) else: costpfcu = ( - cost_variables.uccu + self.data.costs.uccu * (1.0e0 - pfcoil_variables.f_a_pf_coil_void[i]) * abs( pfcoil_variables.c_pf_cs_coils_peak_ma[i] @@ -1721,11 +1738,11 @@ def acc2222(self): # Total cost/metre of conductor (including sheath and fixed costs) - cpfconpm = costwire + costpfsh + cost_variables.cconfix + cpfconpm = costwire + costpfsh + self.data.costs.cconfix # Total account 222.2.1 (PF coils excluding Central Solenoid) - cost_variables.c22221 += ( + self.data.costs.c22221 += ( 1.0e-6 * 2.0 * np.pi @@ -1738,11 +1755,11 @@ def acc2222(self): if build_variables.iohcl == 1: # Superconductor ($/m) - if cost_variables.supercond_cost_model == 0: + if self.data.costs.supercond_cost_model == 0: # Issue #328 Use CS conductor cross-sectional area (m2) if pfcoil_variables.i_pf_conductor == 0: costpfsc = ( - cost_variables.ucsc[pfcoil_variables.i_cs_superconductor - 1] + self.data.costs.ucsc[pfcoil_variables.i_cs_superconductor - 1] * pfcoil_variables.awpoh * (1 - pfcoil_variables.f_a_cs_void) * (1 - pfcoil_variables.fcuohsu) @@ -1757,7 +1774,7 @@ def acc2222(self): costpfsc = 0.0e0 elif pfcoil_variables.i_pf_conductor == 0: costpfsc = ( - cost_variables.sc_mat_cost_0[ + self.data.costs.sc_mat_cost_0[ pfcoil_variables.i_cs_superconductor - 1 ] * tfcoil_variables.j_crit_str_0[ @@ -1772,7 +1789,7 @@ def acc2222(self): if pfcoil_variables.i_pf_conductor == 0: costpfcu = ( - cost_variables.uccu + self.data.costs.uccu * pfcoil_variables.awpoh * (1 - pfcoil_variables.f_a_cs_void) * pfcoil_variables.fcuohsu @@ -1784,7 +1801,7 @@ def acc2222(self): else: # MDK I don't know if this is ccorrect as we never use the resistive model costpfcu = ( - cost_variables.uccu + self.data.costs.uccu * pfcoil_variables.awpoh * (1 - pfcoil_variables.f_a_cs_void) / pfcoil_variables.n_pf_coil_turns[ @@ -1799,11 +1816,11 @@ def acc2222(self): # Total cost/metre of conductor (including sheath and fixed costs) - cpfconpm = costwire + costpfsh + cost_variables.cconfix + cpfconpm = costwire + costpfsh + self.data.costs.cconfix # Total account 222.2.1 (PF+Central Solenoid coils) - cost_variables.c22221 += ( + self.data.costs.c22221 += ( 1.0e-6 * 2.0 * np.pi @@ -1812,42 +1829,50 @@ def acc2222(self): * cpfconpm ) - cost_variables.c22221 = ( - cost_variables.fkind * cost_variables.c22221 * cmlsa[cost_variables.lsa - 1] + self.data.costs.c22221 = ( + self.data.costs.fkind + * self.data.costs.c22221 + * cmlsa[self.data.costs.lsa - 1] ) # Account 222.2.2 : Winding - cost_variables.c22222 = 1.0e-6 * cost_variables.ucwindpf * pfwndl - cost_variables.c22222 = ( - cost_variables.fkind * cost_variables.c22222 * cmlsa[cost_variables.lsa - 1] + self.data.costs.c22222 = 1.0e-6 * self.data.costs.ucwindpf * pfwndl + self.data.costs.c22222 = ( + self.data.costs.fkind + * self.data.costs.c22222 + * cmlsa[self.data.costs.lsa - 1] ) # Account 222.2.3 : Steel case - will be zero for resistive coils - cost_variables.c22223 = ( - 1.0e-6 * cost_variables.uccase * pfcoil_variables.m_pf_coil_structure_total + self.data.costs.c22223 = ( + 1.0e-6 * self.data.costs.uccase * pfcoil_variables.m_pf_coil_structure_total ) - cost_variables.c22223 = ( - cost_variables.fkind * cost_variables.c22223 * cmlsa[cost_variables.lsa - 1] + self.data.costs.c22223 = ( + self.data.costs.fkind + * self.data.costs.c22223 + * cmlsa[self.data.costs.lsa - 1] ) # Account 222.2.4 : Support structure - cost_variables.c22224 = ( - 1.0e-6 * cost_variables.ucfnc * structure_variables.fncmass + self.data.costs.c22224 = ( + 1.0e-6 * self.data.costs.ucfnc * structure_variables.fncmass ) - cost_variables.c22224 = ( - cost_variables.fkind * cost_variables.c22224 * cmlsa[cost_variables.lsa - 1] + self.data.costs.c22224 = ( + self.data.costs.fkind + * self.data.costs.c22224 + * cmlsa[self.data.costs.lsa - 1] ) # Total account 222.2 - cost_variables.c2222 = ( - cost_variables.c22221 - + cost_variables.c22222 - + cost_variables.c22223 - + cost_variables.c22224 + self.data.costs.c2222 = ( + self.data.costs.c22221 + + self.data.costs.c22222 + + self.data.costs.c22223 + + self.data.costs.c22224 ) def acc2223(self): @@ -1856,9 +1881,11 @@ def acc2223(self): """ cmlsa = [0.6900e0, 0.8450e0, 0.9225e0, 1.0000e0] - cost_variables.c2223 = 1.0e-6 * fwbs_variables.m_vv * cost_variables.uccryo - cost_variables.c2223 = ( - cost_variables.fkind * cost_variables.c2223 * cmlsa[cost_variables.lsa - 1] + self.data.costs.c2223 = 1.0e-6 * fwbs_variables.m_vv * self.data.costs.uccryo + self.data.costs.c2223 = ( + self.data.costs.fkind + * self.data.costs.c2223 + * cmlsa[self.data.costs.lsa - 1] ) def acc223(self): @@ -1877,57 +1904,57 @@ def acc223(self): if ife_variables.ife != 1: # Account 223.1 : ECH - cost_variables.c2231 = ( + self.data.costs.c2231 = ( 1.0e-6 - * cost_variables.ucech + * self.data.costs.ucech * (1.0e6 * current_drive_variables.p_hcd_ecrh_injected_total_mw) ** exprf ) - if cost_variables.ifueltyp == 1: - cost_variables.c2231 = ( - 1.0e0 - cost_variables.fcdfuel - ) * cost_variables.c2231 - cost_variables.c2231 = cost_variables.fkind * cost_variables.c2231 + if self.data.costs.ifueltyp == 1: + self.data.costs.c2231 = ( + 1.0e0 - self.data.costs.fcdfuel + ) * self.data.costs.c2231 + self.data.costs.c2231 = self.data.costs.fkind * self.data.costs.c2231 # Account 223.2 : Lower Hybrid or ICH if current_drive_variables.i_hcd_primary != 2: - cost_variables.c2232 = ( + self.data.costs.c2232 = ( 1.0e-6 - * cost_variables.uclh + * self.data.costs.uclh * (1.0e6 * current_drive_variables.p_hcd_lowhyb_injected_total_mw) ** exprf ) else: - cost_variables.c2232 = ( + self.data.costs.c2232 = ( 1.0e-6 - * cost_variables.ucich + * self.data.costs.ucich * (1.0e6 * current_drive_variables.p_hcd_lowhyb_injected_total_mw) ** exprf ) - if cost_variables.ifueltyp == 1: - cost_variables.c2232 = ( - 1.0e0 - cost_variables.fcdfuel - ) * cost_variables.c2232 - cost_variables.c2232 = cost_variables.fkind * cost_variables.c2232 + if self.data.costs.ifueltyp == 1: + self.data.costs.c2232 = ( + 1.0e0 - self.data.costs.fcdfuel + ) * self.data.costs.c2232 + self.data.costs.c2232 = self.data.costs.fkind * self.data.costs.c2232 # Account 223.3 : Neutral Beam - # cost_variables.c2233 = 1.0e-6 * cost_variables.ucnbi * (1.0e6*p_hcd_beam_injected_total_mw)**exprf + # self.data.costs.c2233 = 1.0e-6 * self.data.costs.ucnbi * (1.0e6*p_hcd_beam_injected_total_mw)**exprf # #327 - cost_variables.c2233 = ( + self.data.costs.c2233 = ( 1.0e-6 - * cost_variables.ucnbi + * self.data.costs.ucnbi * (1.0e6 * current_drive_variables.p_beam_injected_mw) ** exprf ) - if cost_variables.ifueltyp == 1: - cost_variables.c2233 = ( - 1.0e0 - cost_variables.fcdfuel - ) * cost_variables.c2233 - cost_variables.c2233 = cost_variables.fkind * cost_variables.c2233 + if self.data.costs.ifueltyp == 1: + self.data.costs.c2233 = ( + 1.0e0 - self.data.costs.fcdfuel + ) * self.data.costs.c2233 + self.data.costs.c2233 = self.data.costs.fkind * self.data.costs.c2233 else: # IFE driver costs (depends on driver type) @@ -1943,47 +1970,47 @@ def acc223(self): ) if ife_variables.edrive <= switch: - cost_variables.c2231 = ife_variables.mcdriv * ( + self.data.costs.c2231 = ife_variables.mcdriv * ( ife_variables.cdriv1 + ife_variables.dcdrv1 * 1.0e-6 * ife_variables.edrive ) else: - cost_variables.c2231 = ife_variables.mcdriv * ( + self.data.costs.c2231 = ife_variables.mcdriv * ( ife_variables.cdriv2 + ife_variables.dcdrv2 * 1.0e-6 * ife_variables.edrive ) elif ife_variables.ifedrv == 3: - cost_variables.c2231 = ( + self.data.costs.c2231 = ( ife_variables.mcdriv * 1.0e-6 * ife_variables.cdriv3 * (ife_variables.edrive / ife_variables.etadrv) ) else: - cost_variables.c2231 = ife_variables.mcdriv * ( + self.data.costs.c2231 = ife_variables.mcdriv * ( ife_variables.cdriv0 + ife_variables.dcdrv0 * 1.0e-6 * ife_variables.edrive ) - if cost_variables.ifueltyp == 1: - cost_variables.c2231 = ( - 1.0e0 - cost_variables.fcdfuel - ) * cost_variables.c2231 - cost_variables.c2231 = cost_variables.fkind * cost_variables.c2231 - cost_variables.c2232 = 0.0e0 - cost_variables.c2233 = 0.0e0 - cost_variables.c2234 = 0.0e0 + if self.data.costs.ifueltyp == 1: + self.data.costs.c2231 = ( + 1.0e0 - self.data.costs.fcdfuel + ) * self.data.costs.c2231 + self.data.costs.c2231 = self.data.costs.fkind * self.data.costs.c2231 + self.data.costs.c2232 = 0.0e0 + self.data.costs.c2233 = 0.0e0 + self.data.costs.c2234 = 0.0e0 # Total account 223 - cost_variables.c223 = ( - cost_variables.c2231 - + cost_variables.c2232 - + cost_variables.c2233 - + cost_variables.c2234 + self.data.costs.c223 = ( + self.data.costs.c2231 + + self.data.costs.c2232 + + self.data.costs.c2233 + + self.data.costs.c2234 ) - cost_variables.cdcost = cost_variables.c223 + self.data.costs.cdcost = self.data.costs.c223 def acc224(self): """Account 224 : Vacuum system @@ -1991,68 +2018,68 @@ def acc224(self): The costs are scaled from TETRA reactor code runs. """ if self.data.vacuum.i_vacuum_pump_type == 1: - cost_variables.c2241 = ( - 1.0e-6 * self.data.vacuum.n_vac_pumps_high * cost_variables.UCCPMP + self.data.costs.c2241 = ( + 1.0e-6 * self.data.vacuum.n_vac_pumps_high * self.data.costs.UCCPMP ) else: - cost_variables.c2241 = ( - 1.0e-6 * self.data.vacuum.n_vac_pumps_high * cost_variables.UCTPMP + self.data.costs.c2241 = ( + 1.0e-6 * self.data.vacuum.n_vac_pumps_high * self.data.costs.UCTPMP ) - cost_variables.c2241 = cost_variables.fkind * cost_variables.c2241 + self.data.costs.c2241 = self.data.costs.fkind * self.data.costs.c2241 # Account 224.2 : Backing pumps - cost_variables.c2242 = ( - 1.0e-6 * self.data.vacuum.n_vv_vacuum_ducts * cost_variables.UCBPMP + self.data.costs.c2242 = ( + 1.0e-6 * self.data.vacuum.n_vv_vacuum_ducts * self.data.costs.UCBPMP ) - cost_variables.c2242 = cost_variables.fkind * cost_variables.c2242 + self.data.costs.c2242 = self.data.costs.fkind * self.data.costs.c2242 # Account 224.3 : Vacuum duct - cost_variables.c2243 = ( + self.data.costs.c2243 = ( 1.0e-6 * self.data.vacuum.n_vv_vacuum_ducts * self.data.vacuum.dlscal - * cost_variables.UCDUCT + * self.data.costs.UCDUCT ) - cost_variables.c2243 = cost_variables.fkind * cost_variables.c2243 + self.data.costs.c2243 = self.data.costs.fkind * self.data.costs.c2243 # Account 224.4 : Valves - cost_variables.c2244 = ( + self.data.costs.c2244 = ( 1.0e-6 * 2.0e0 * self.data.vacuum.n_vv_vacuum_ducts * (self.data.vacuum.dia_vv_vacuum_ducts * 1.2e0) ** 1.4e0 - * cost_variables.UCVALV + * self.data.costs.UCVALV ) - cost_variables.c2244 = cost_variables.fkind * cost_variables.c2244 + self.data.costs.c2244 = self.data.costs.fkind * self.data.costs.c2244 # Account 224.5 : Duct shielding - cost_variables.c2245 = ( + self.data.costs.c2245 = ( 1.0e-6 * self.data.vacuum.n_vv_vacuum_ducts * self.data.vacuum.m_vv_vacuum_duct_shield - * cost_variables.UCVDSH + * self.data.costs.UCVDSH ) - cost_variables.c2245 = cost_variables.fkind * cost_variables.c2245 + self.data.costs.c2245 = self.data.costs.fkind * self.data.costs.c2245 # Account 224.6 : Instrumentation - cost_variables.c2246 = 1.0e-6 * cost_variables.UCVIAC - cost_variables.c2246 = cost_variables.fkind * cost_variables.c2246 + self.data.costs.c2246 = 1.0e-6 * self.data.costs.UCVIAC + self.data.costs.c2246 = self.data.costs.fkind * self.data.costs.c2246 # Total account 224 - cost_variables.c224 = ( - cost_variables.c2241 - + cost_variables.c2242 - + cost_variables.c2243 - + cost_variables.c2244 - + cost_variables.c2245 - + cost_variables.c2246 + self.data.costs.c224 = ( + self.data.costs.c2241 + + self.data.costs.c2242 + + self.data.costs.c2243 + + self.data.costs.c2244 + + self.data.costs.c2245 + + self.data.costs.c2246 ) def acc2251(self): @@ -2064,18 +2091,18 @@ def acc2251(self): materials and installation. """ expel = 0.7e0 - cost_variables.c22511 = ( + self.data.costs.c22511 = ( 1.0e-6 - * cost_variables.uctfps + * self.data.costs.uctfps * (tfcoil_variables.tfckw * 1.0e3 + tfcoil_variables.tfcmw * 1.0e6) ** expel ) - cost_variables.c22511 = cost_variables.fkind * cost_variables.c22511 + self.data.costs.c22511 = self.data.costs.fkind * self.data.costs.c22511 # Account 225.1.2 : TF coil breakers (zero cost for copper coils) if tfcoil_variables.i_tf_sup == TFConductorModel.SUPERCONDUCTING: - cost_variables.c22512 = 1.0e-6 * ( - cost_variables.uctfbr + self.data.costs.c22512 = 1.0e-6 * ( + self.data.costs.uctfbr * tfcoil_variables.n_tf_coils * ( tfcoil_variables.c_tf_turn @@ -2083,54 +2110,54 @@ def acc2251(self): * 1.0e3 ) ** expel - + cost_variables.uctfsw * tfcoil_variables.c_tf_turn + + self.data.costs.uctfsw * tfcoil_variables.c_tf_turn ) else: - cost_variables.c22512 = 0.0e0 + self.data.costs.c22512 = 0.0e0 - cost_variables.c22512 = cost_variables.fkind * cost_variables.c22512 + self.data.costs.c22512 = self.data.costs.fkind * self.data.costs.c22512 # Account 225.1.3 : TF coil dump resistors - cost_variables.c22513 = 1.0e-6 * ( + self.data.costs.c22513 = 1.0e-6 * ( 1.0e9 - * cost_variables.UCTFDR + * self.data.costs.UCTFDR * tfcoil_variables.e_tf_magnetic_stored_total_gj - + cost_variables.UCTFGR * 0.5e0 * tfcoil_variables.n_tf_coils + + self.data.costs.UCTFGR * 0.5e0 * tfcoil_variables.n_tf_coils ) - cost_variables.c22513 = cost_variables.fkind * cost_variables.c22513 + self.data.costs.c22513 = self.data.costs.fkind * self.data.costs.c22513 # Account 225.1.4 : TF coil instrumentation and control - cost_variables.c22514 = ( - 1.0e-6 * cost_variables.UCTFIC * (30.0e0 * tfcoil_variables.n_tf_coils) + self.data.costs.c22514 = ( + 1.0e-6 * self.data.costs.UCTFIC * (30.0e0 * tfcoil_variables.n_tf_coils) ) - cost_variables.c22514 = cost_variables.fkind * cost_variables.c22514 + self.data.costs.c22514 = self.data.costs.fkind * self.data.costs.c22514 # Account 225.1.5 : TF coil bussing if tfcoil_variables.i_tf_sup != TFConductorModel.SUPERCONDUCTING: - cost_variables.c22515 = ( - 1.0e-6 * cost_variables.uctfbus * tfcoil_variables.m_tf_bus + self.data.costs.c22515 = ( + 1.0e-6 * self.data.costs.uctfbus * tfcoil_variables.m_tf_bus ) else: - cost_variables.c22515 = ( + self.data.costs.c22515 = ( 1.0e-6 - * cost_variables.ucbus + * self.data.costs.ucbus * tfcoil_variables.c_tf_turn * tfcoil_variables.len_tf_bus ) - cost_variables.c22515 = cost_variables.fkind * cost_variables.c22515 + self.data.costs.c22515 = self.data.costs.fkind * self.data.costs.c22515 # Total account 225.1 - cost_variables.c2251 = ( - cost_variables.c22511 - + cost_variables.c22512 - + cost_variables.c22513 - + cost_variables.c22514 - + cost_variables.c22515 + self.data.costs.c2251 = ( + self.data.costs.c22511 + + self.data.costs.c22512 + + self.data.costs.c22513 + + self.data.costs.c22514 + + self.data.costs.c22515 ) def acc2252(self): @@ -2140,76 +2167,76 @@ def acc2252(self): Costs are taken from the equipment specification of the pfpwr routine from the plant power module. """ - cost_variables.c22521 = ( - 1.0e-6 * cost_variables.ucpfps * heat_transport_variables.peakmva + self.data.costs.c22521 = ( + 1.0e-6 * self.data.costs.ucpfps * heat_transport_variables.peakmva ) - cost_variables.c22521 = cost_variables.fkind * cost_variables.c22521 + self.data.costs.c22521 = self.data.costs.fkind * self.data.costs.c22521 # Account 225.2.2 : PF coil instrumentation and control - cost_variables.c22522 = ( - 1.0e-6 * cost_variables.ucpfic * pf_power_variables.pfckts * 30.0e0 + self.data.costs.c22522 = ( + 1.0e-6 * self.data.costs.ucpfic * pf_power_variables.pfckts * 30.0e0 ) - cost_variables.c22522 = cost_variables.fkind * cost_variables.c22522 + self.data.costs.c22522 = self.data.costs.fkind * self.data.costs.c22522 # Account 225.2.3 : PF coil bussing - cost_variables.c22523 = ( + self.data.costs.c22523 = ( 1.0e-6 - * cost_variables.ucpfb + * self.data.costs.ucpfb * pf_power_variables.spfbusl * pf_power_variables.acptmax ) - cost_variables.c22523 = cost_variables.fkind * cost_variables.c22523 + self.data.costs.c22523 = self.data.costs.fkind * self.data.costs.c22523 # Account 225.2.4 : PF coil burn power supplies if pf_power_variables.pfckts != 0.0e0: # noqa: RUF069 - cost_variables.c22524 = ( + self.data.costs.c22524 = ( 1.0e-6 - * cost_variables.ucpfbs + * self.data.costs.ucpfbs * pf_power_variables.pfckts * (pf_power_variables.srcktpm / pf_power_variables.pfckts) ** 0.7e0 ) else: - cost_variables.c22524 = 0.0e0 + self.data.costs.c22524 = 0.0e0 - cost_variables.c22524 = cost_variables.fkind * cost_variables.c22524 + self.data.costs.c22524 = self.data.costs.fkind * self.data.costs.c22524 # Account 225.2.5 : PF coil breakers - cost_variables.c22525 = ( + self.data.costs.c22525 = ( 1.0e-6 - * cost_variables.ucpfbk + * self.data.costs.ucpfbk * pf_power_variables.pfckts * (pf_power_variables.acptmax * pf_power_variables.vpfskv) ** 0.7e0 ) - cost_variables.c22525 = cost_variables.fkind * cost_variables.c22525 + self.data.costs.c22525 = self.data.costs.fkind * self.data.costs.c22525 # Account 225.2.6 : PF coil dump resistors - cost_variables.c22526 = ( - 1.0e-6 * cost_variables.ucpfdr1 * pf_power_variables.ensxpfm + self.data.costs.c22526 = ( + 1.0e-6 * self.data.costs.ucpfdr1 * pf_power_variables.ensxpfm ) - cost_variables.c22526 = cost_variables.fkind * cost_variables.c22526 + self.data.costs.c22526 = self.data.costs.fkind * self.data.costs.c22526 # Account 225.2.7 : PF coil AC breakers - cost_variables.c22527 = ( - 1.0e-6 * cost_variables.ucpfcb * pf_power_variables.pfckts + self.data.costs.c22527 = ( + 1.0e-6 * self.data.costs.ucpfcb * pf_power_variables.pfckts ) - cost_variables.c22527 = cost_variables.fkind * cost_variables.c22527 + self.data.costs.c22527 = self.data.costs.fkind * self.data.costs.c22527 # Total account 225.2 - cost_variables.c2252 = ( - cost_variables.c22521 - + cost_variables.c22522 - + cost_variables.c22523 - + cost_variables.c22524 - + cost_variables.c22525 - + cost_variables.c22526 - + cost_variables.c22527 + self.data.costs.c2252 = ( + self.data.costs.c22521 + + self.data.costs.c22522 + + self.data.costs.c22523 + + self.data.costs.c22524 + + self.data.costs.c22525 + + self.data.costs.c22526 + + self.data.costs.c22527 ) def acc226(self): @@ -2218,8 +2245,8 @@ def acc226(self): Costs are estimated from major equipment and heat transport system loops developed in the heatpwr module of the code. """ - cost_variables.c226 = ( - cost_variables.c2261 + cost_variables.c2262 + cost_variables.c2263 + self.data.costs.c226 = ( + self.data.costs.c2261 + self.data.costs.c2262 + self.data.costs.c2263 ) def acc2261(self): @@ -2233,9 +2260,9 @@ def acc2261(self): # N.B. with blktmodel > 0, the blanket is assumed to be helium-cooled, # but the shield etc. is water-cooled (i_blkt_coolant_type=2). Therefore, a slight # inconsistency exists here... - cost_variables.cpp = ( + self.data.costs.cpp = ( 1.0e-6 - * cost_variables.uchts[fwbs_variables.i_blkt_coolant_type - 1] + * self.data.costs.uchts[fwbs_variables.i_blkt_coolant_type - 1] * ( (1.0e6 * heat_transport_variables.p_fw_div_heat_deposited_mw) ** exphts + (1.0e6 * fwbs_variables.p_blkt_nuclear_heat_total_mw) ** exphts @@ -2243,14 +2270,14 @@ def acc2261(self): ) ) - cost_variables.cpp = ( - cost_variables.fkind * cost_variables.cpp * cmlsa[cost_variables.lsa - 1] + self.data.costs.cpp = ( + self.data.costs.fkind * self.data.costs.cpp * cmlsa[self.data.costs.lsa - 1] ) # Primary heat exchangers - cost_variables.chx = ( + self.data.costs.chx = ( 1.0e-6 - * cost_variables.UCPHX + * self.data.costs.UCPHX * heat_transport_variables.n_primary_heat_exchangers * ( 1.0e6 @@ -2259,11 +2286,11 @@ def acc2261(self): ) ** exphts ) - cost_variables.chx = ( - cost_variables.fkind * cost_variables.chx * cmlsa[cost_variables.lsa - 1] + self.data.costs.chx = ( + self.data.costs.fkind * self.data.costs.chx * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c2261 = cost_variables.chx + cost_variables.cpp + self.data.costs.c2261 = self.data.costs.chx + self.data.costs.cpp def acc2262(self): """Account 2262 : Auxiliary component cooling @@ -2273,9 +2300,9 @@ def acc2262(self): exphts = 0.7e0 # Pumps and piping system - cost_variables.cppa = ( + self.data.costs.cppa = ( 1.0e-6 - * cost_variables.UCAHTS + * 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 @@ -2287,9 +2314,9 @@ def acc2262(self): ) if ife_variables.ife == 1: - cost_variables.cppa += ( + self.data.costs.cppa += ( 1.0e-6 - * cost_variables.UCAHTS + * self.data.costs.UCAHTS * ( (1.0e6 * ife_variables.tdspmw) ** exphts + (1.0e6 * ife_variables.tfacmw) ** exphts @@ -2297,11 +2324,11 @@ def acc2262(self): ) # Apply Nth kind and safety assurance factors - cost_variables.cppa = ( - cost_variables.fkind * cost_variables.cppa * cmlsa[cost_variables.lsa - 1] + self.data.costs.cppa = ( + self.data.costs.fkind * self.data.costs.cppa * cmlsa[self.data.costs.lsa - 1] ) - cost_variables.c2262 = cost_variables.cppa + self.data.costs.c2262 = self.data.costs.cppa def acc2263(self): """Account 2263 : Cryogenic system @@ -2310,17 +2337,19 @@ def acc2263(self): cmlsa = 0.4000e0, 0.7000e0, 0.8500e0, 1.0000e0 expcry = 0.67e0 - cost_variables.c2263 = ( + self.data.costs.c2263 = ( 1.0e-6 - * cost_variables.uccry + * self.data.costs.uccry * 4.5e0 / tfcoil_variables.temp_tf_cryo * heat_transport_variables.helpow**expcry ) # Apply Nth kind and safety factors - cost_variables.c2263 = ( - cost_variables.fkind * cost_variables.c2263 * cmlsa[cost_variables.lsa - 1] + self.data.costs.c2263 = ( + self.data.costs.fkind + * self.data.costs.c2263 + * cmlsa[self.data.costs.lsa - 1] ) def acc227(self): @@ -2328,21 +2357,21 @@ def acc227(self): This routine evaluates the Account 227 (fuel handling) costs. Costs are scaled from TETRA reactor code runs. """ - cost_variables.c227 = ( - cost_variables.c2271 - + cost_variables.c2272 - + cost_variables.c2273 - + cost_variables.c2274 + self.data.costs.c227 = ( + self.data.costs.c2271 + + self.data.costs.c2272 + + self.data.costs.c2273 + + self.data.costs.c2274 ) def acc2271(self): """Account 2271 : Fuelling system This routine evaluates the Account 2271 - Fuelling system """ - cost_variables.c2271 = 1.0e-6 * cost_variables.ucf1 + self.data.costs.c2271 = 1.0e-6 * self.data.costs.ucf1 # Apply Nth kind factor - cost_variables.c2271 = cost_variables.fkind * cost_variables.c2271 + self.data.costs.c2271 = self.data.costs.fkind * self.data.costs.c2271 def acc2272(self): """Account 2272 : Fuel processing and purification @@ -2374,13 +2403,13 @@ def acc2272(self): physics_variables.wtgpd = targtm * ife_variables.reprat * 86400.0e0 # Assumes that He3 costs same as tritium to process... - cost_variables.c2272 = ( + self.data.costs.c2272 = ( 1.0e-6 - * cost_variables.UCFPR + * self.data.costs.UCFPR * (0.5e0 + 0.5e0 * (physics_variables.wtgpd / 60.0e0) ** 0.67e0) ) - cost_variables.c2272 = cost_variables.fkind * cost_variables.c2272 + self.data.costs.c2272 = self.data.costs.fkind * self.data.costs.c2272 def acc2273(self): """Account 2273 : Atmospheric recovery systems @@ -2390,31 +2419,31 @@ def acc2273(self): # No detritiation needed if purely D-He3 reaction if physics_variables.f_plasma_fuel_tritium > 1.0e-3: - cost_variables.c2273 = ( + self.data.costs.c2273 = ( 1.0e-6 - * cost_variables.UCDTC + * self.data.costs.UCDTC * ( (cfrht / 1.0e4) ** 0.6e0 * (buildings_variables.volrci + buildings_variables.wsvol) ) ) else: - cost_variables.c2273 = 0.0e0 + self.data.costs.c2273 = 0.0e0 - cost_variables.c2273 = cost_variables.fkind * cost_variables.c2273 + self.data.costs.c2273 = self.data.costs.fkind * self.data.costs.c2273 def acc2274(self): """Account 2274 : Nuclear building ventilation This routine evaluates the Account 2274 - Nuclear building ventilation """ - cost_variables.c2274 = ( + self.data.costs.c2274 = ( 1.0e-6 - * cost_variables.UCNBV + * self.data.costs.UCNBV * (buildings_variables.volrci + buildings_variables.wsvol) ** 0.8e0 ) # Apply Nth kind factor - cost_variables.c2274 = cost_variables.fkind * cost_variables.c2274 + self.data.costs.c2274 = self.data.costs.fkind * self.data.costs.c2274 def acc228(self): """Account 228 : Instrumentation and control @@ -2423,16 +2452,16 @@ def acc228(self): control) costs. Costs are based on TFCX and INTOR. """ - cost_variables.c228 = 1.0e-6 * cost_variables.uciac - cost_variables.c228 = cost_variables.fkind * cost_variables.c228 + self.data.costs.c228 = 1.0e-6 * self.data.costs.uciac + self.data.costs.c228 = self.data.costs.fkind * self.data.costs.c228 def acc229(self): """Account 229 : Maintenance equipment This routine evaluates the Account 229 (maintenance equipment) costs. """ - cost_variables.c229 = 1.0e-6 * cost_variables.ucme - cost_variables.c229 = cost_variables.fkind * cost_variables.c229 + self.data.costs.c229 = 1.0e-6 * self.data.costs.ucme + self.data.costs.c229 = self.data.costs.fkind * self.data.costs.c229 def acc23(self): """Account 23 : Turbine plant equipment @@ -2440,10 +2469,10 @@ def acc23(self): This routine evaluates the Account 23 (turbine plant equipment) costs. """ exptpe = 0.83e0 - if cost_variables.ireactor == 1: - cost_variables.c23 = ( + if self.data.costs.ireactor == 1: + self.data.costs.c23 = ( 1.0e-6 - * cost_variables.ucturb[fwbs_variables.i_blkt_coolant_type - 1] + * self.data.costs.ucturb[fwbs_variables.i_blkt_coolant_type - 1] * (heat_transport_variables.p_plant_electric_gross_mw / 1200.0e0) ** exptpe ) @@ -2453,12 +2482,12 @@ def acc24(self): This routine evaluates the Account 24 (electric plant equipment) costs. """ - cost_variables.c24 = ( - cost_variables.c241 - + cost_variables.c242 - + cost_variables.c243 - + cost_variables.c244 - + cost_variables.c245 + self.data.costs.c24 = ( + self.data.costs.c241 + + self.data.costs.c242 + + self.data.costs.c243 + + self.data.costs.c244 + + self.data.costs.c245 ) def acc241(self): @@ -2468,8 +2497,8 @@ def acc241(self): cmlsa = 0.5700e0, 0.7850e0, 0.8925e0, 1.0000e0 # Account 241 : Switchyard - cost_variables.c241 = ( - 1.0e-6 * cost_variables.UCSWYD * cmlsa[cost_variables.lsa - 1] + self.data.costs.c241 = ( + 1.0e-6 * self.data.costs.UCSWYD * cmlsa[self.data.costs.lsa - 1] ) def acc242(self): @@ -2480,14 +2509,14 @@ def acc242(self): expepe = 0.9e0 # Account 242 : Transformers - cost_variables.c242 = 1.0e-6 * ( - cost_variables.UCPP * (heat_transport_variables.pacpmw * 1.0e3) ** expepe - + cost_variables.UCAP + self.data.costs.c242 = 1.0e-6 * ( + self.data.costs.UCPP * (heat_transport_variables.pacpmw * 1.0e3) ** expepe + + self.data.costs.UCAP * (heat_transport_variables.p_plant_electric_base_total_mw * 1.0e3) ) # Apply safety assurance factor - cost_variables.c242 *= cmlsa[cost_variables.lsa - 1] + self.data.costs.c242 *= cmlsa[self.data.costs.lsa - 1] def acc243(self): """Account 243 : Electric plant equipment - Low voltage @@ -2497,13 +2526,13 @@ def acc243(self): # Account 243 : Low voltage # (include 0.8 factor for transformer efficiency) - cost_variables.c243 = ( + self.data.costs.c243 = ( 1.0e-6 - * cost_variables.UCLV + * self.data.costs.UCLV * heat_transport_variables.tlvpmw * 1.0e3 / 0.8e0 - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) def acc244(self): @@ -2513,8 +2542,8 @@ def acc244(self): cmlsa = [0.5700e0, 0.7850e0, 0.8925e0, 1.0000e0] # Account 244 : Diesel generator (8 MW per generator, assume 4 ) - cost_variables.c244 = ( - 1.0e-6 * cost_variables.UCDGEN * 4.0e0 * cmlsa[cost_variables.lsa - 1] + self.data.costs.c244 = ( + 1.0e-6 * self.data.costs.UCDGEN * 4.0e0 * cmlsa[self.data.costs.lsa - 1] ) def acc245(self): @@ -2524,8 +2553,8 @@ def acc245(self): cmlsa = 0.5700e0, 0.7850e0, 0.8925e0, 1.0000e0 # Account 245 : Auxiliary facility power needs - cost_variables.c245 = ( - 1.0e-6 * cost_variables.UCAF * cmlsa[cost_variables.lsa - 1] + self.data.costs.c245 = ( + 1.0e-6 * self.data.costs.UCAF * cmlsa[self.data.costs.lsa - 1] ) def acc25(self): @@ -2536,8 +2565,8 @@ def acc25(self): """ cmlsa = 0.7700e0, 0.8850e0, 0.9425e0, 1.0000e0 - cost_variables.c25 = ( - 1.0e-6 * cost_variables.ucmisc * cmlsa[cost_variables.lsa - 1] + self.data.costs.c25 = ( + 1.0e-6 * self.data.costs.ucmisc * cmlsa[self.data.costs.lsa - 1] ) def acc26(self): @@ -2551,7 +2580,7 @@ def acc26(self): cmlsa = [0.8000e0, 0.9000e0, 0.9500e0, 1.0000e0] # Calculate rejected heat for non-reactor (==0) and reactor (==1) - if cost_variables.ireactor == 0: + if self.data.costs.ireactor == 0: pwrrej = ( physics_variables.p_fusion_total_mw + heat_transport_variables.p_hcd_electric_total_mw @@ -2563,13 +2592,13 @@ def acc26(self): - heat_transport_variables.p_plant_electric_gross_mw ) - # cost_variables.uchrs - reference cost of heat rejection system [$] - cost_variables.c26 = ( + # self.data.costs.uchrs - reference cost of heat rejection system [$] + self.data.costs.c26 = ( 1.0e-6 - * cost_variables.uchrs + * self.data.costs.uchrs * pwrrej / 2300.0e0 - * cmlsa[cost_variables.lsa - 1] + * cmlsa[self.data.costs.lsa - 1] ) def acc9(self): @@ -2585,23 +2614,23 @@ def acc9(self):

The factors used are estimated from commercial plant experience. J. Delene, private communication, ORNL, June 1990 """ - cost_variables.cindrt = ( - cost_variables.cfind[cost_variables.lsa - 1] - * cost_variables.cdirt - * (1.0e0 + cost_variables.cowner) + self.data.costs.cindrt = ( + self.data.costs.cfind[self.data.costs.lsa - 1] + * self.data.costs.cdirt + * (1.0e0 + self.data.costs.cowner) ) # Contingency costs - cost_variables.ccont = cost_variables.fcontng * ( - cost_variables.cdirt + cost_variables.cindrt + self.data.costs.ccont = self.data.costs.fcontng * ( + self.data.costs.cdirt + self.data.costs.cindrt ) def acc2253(self): """Account 225.3 : Energy storage This routine evaluates the Account 225.3 (energy storage) costs. """ - cost_variables.c2253 = 0.0e0 + self.data.costs.c2253 = 0.0e0 # Thermal storage options for a pulsed reactor # See F/MPE/MOD/CAG/PROCESS/PULSE/0008 and 0014 @@ -2612,51 +2641,51 @@ def acc2253(self): # Pulsed Fusion Reactor Study : AEA FUS 205 # Increased condensate tank capacity - cost_variables.c2253 = 0.1e0 + self.data.costs.c2253 = 0.1e0 # Additional electrically-driven feedpump (50 per cent duty) - cost_variables.c2253 += 0.8e0 + self.data.costs.c2253 += 0.8e0 # Increased turbine-generator duty (5 per cent duty) - cost_variables.c2253 += 4.0e0 + self.data.costs.c2253 += 4.0e0 # Additional auxiliary transformer capacity and ancillaries - cost_variables.c2253 += 0.5e0 + self.data.costs.c2253 += 0.5e0 # Increased drum capacity - cost_variables.c2253 += 2.8e0 + self.data.costs.c2253 += 2.8e0 # Externally fired superheater - cost_variables.c2253 += 29.0e0 + self.data.costs.c2253 += 29.0e0 elif pulse_variables.istore == 2: # Option 2 from ELECTROWATT report # Pulsed Fusion Reactor Study : AEA FUS 205 # Increased condensate tank capacity - cost_variables.c2253 = 0.1e0 + self.data.costs.c2253 = 0.1e0 # Additional electrically-driven feedpump (50 per cent duty) - cost_variables.c2253 += 0.8e0 + self.data.costs.c2253 += 0.8e0 # Increased drum capacity - cost_variables.c2253 += 2.8e0 + self.data.costs.c2253 += 2.8e0 # Increased turbine-generator duty (5 per cent duty) - cost_variables.c2253 += 4.0e0 + self.data.costs.c2253 += 4.0e0 # Additional fired boiler (1 x 100 per cent duty) - cost_variables.c2253 += 330.0e0 + self.data.costs.c2253 += 330.0e0 # HP/LP steam bypass system for auxiliary boiler # (30 per cent boiler capacity) - cost_variables.c2253 += 1.0e0 + self.data.costs.c2253 += 1.0e0 # Dump condenser - cost_variables.c2253 += 2.0e0 + self.data.costs.c2253 += 2.0e0 # Increased cooling water system capacity - cost_variables.c2253 += 18.0e0 + self.data.costs.c2253 += 18.0e0 elif pulse_variables.istore == 3: # Simplistic approach that assumes that a large stainless steel @@ -2668,8 +2697,8 @@ def acc2253(self): # stainless steel block (input) shcss = 520.0e0 - cost_variables.c2253 = ( - cost_variables.ucblss + self.data.costs.c2253 = ( + self.data.costs.ucblss * (heat_transport_variables.p_plant_primary_heat_mw * 1.0e6) * times_variables.t_plant_pulse_no_burn / (shcss * pulse_variables.dtstor) @@ -2681,10 +2710,10 @@ def acc2253(self): ) if pulse_variables.istore < 3: - # Scale cost_variables.c2253 with net electric power + # Scale self.data.costs.c2253 with net electric power - cost_variables.c2253 = ( - cost_variables.c2253 + self.data.costs.c2253 = ( + self.data.costs.c2253 * heat_transport_variables.p_plant_electric_net_mw / 1200.0e0 ) @@ -2693,9 +2722,9 @@ def acc2253(self): # Reasonable guess for the exchange rate + inflation factor # inflation = 5% per annum; exchange rate = 1.5 dollars per pound - cost_variables.c2253 *= 1.36e0 + self.data.costs.c2253 *= 1.36e0 - cost_variables.c2253 = cost_variables.fkind * cost_variables.c2253 + self.data.costs.c2253 = self.data.costs.fkind * self.data.costs.c2253 def coelc(self): """Routine to calculate the cost of electricity for a fusion power plant @@ -2713,14 +2742,14 @@ def coelc(self): 1.0e3 * heat_transport_variables.p_plant_electric_net_mw * (24.0e0 * constants.N_DAY_YEAR) - * cost_variables.f_t_plant_available + * self.data.costs.f_t_plant_available ) else: kwhpy = ( 1.0e3 * heat_transport_variables.p_plant_electric_net_mw * (24.0e0 * constants.N_DAY_YEAR) - * cost_variables.f_t_plant_available + * self.data.costs.f_t_plant_available * times_variables.t_plant_pulse_burn / times_variables.t_plant_pulse_total ) @@ -2730,15 +2759,17 @@ def coelc(self): # Interest on construction costs - cost_variables.moneyint = cost_variables.concost * (cost_variables.fcap0 - 1.0e0) + self.data.costs.moneyint = self.data.costs.concost * ( + self.data.costs.fcap0 - 1.0e0 + ) # Capital costs - cost_variables.capcost = cost_variables.concost + cost_variables.moneyint + self.data.costs.capcost = self.data.costs.concost + self.data.costs.moneyint # Annual cost of plant capital cost - anncap = cost_variables.capcost * cost_variables.fcr0 + anncap = self.data.costs.capcost * self.data.costs.fcr0 # SJP Issue #836 # Check for the condition when kwhpy=0 @@ -2747,30 +2778,30 @@ def coelc(self): # Cost of electricity due to plant capital cost - cost_variables.coecap = 1.0e9 * anncap / kwhpy + self.data.costs.coecap = 1.0e9 * anncap / kwhpy # Costs due to first wall and blanket renewal # =========================================== # Compound interest factor - feffwbl = (1.0e0 + cost_variables.discount_rate) ** fwbs_variables.life_blkt + feffwbl = (1.0e0 + self.data.costs.discount_rate) ** fwbs_variables.life_blkt # Capital recovery factor - crffwbl = (feffwbl * cost_variables.discount_rate) / (feffwbl - 1.0e0) + crffwbl = (feffwbl * self.data.costs.discount_rate) / (feffwbl - 1.0e0) # Annual cost of replacements annfwbl = ( - (cost_variables.fwallcst + cost_variables.blkcst) - * (1.0e0 + cost_variables.cfind[cost_variables.lsa - 1]) - * cost_variables.fcap0cp + (self.data.costs.fwallcst + self.data.costs.blkcst) + * (1.0e0 + self.data.costs.cfind[self.data.costs.lsa - 1]) + * self.data.costs.fcap0cp * crffwbl ) - if cost_variables.ifueltyp == 2: - annfwbl *= 1.0e0 - fwbs_variables.life_blkt_fpy / cost_variables.life_plant + if self.data.costs.ifueltyp == 2: + annfwbl *= 1.0e0 - fwbs_variables.life_blkt_fpy / self.data.costs.life_plant # Cost of electricity due to first wall/blanket replacements @@ -2785,25 +2816,27 @@ def coelc(self): else: # Compound interest factor - fefdiv = (1.0e0 + cost_variables.discount_rate) ** cost_variables.life_div + fefdiv = (1.0e0 + self.data.costs.discount_rate) ** self.data.costs.life_div # Capital recovery factor - crfdiv = (fefdiv * cost_variables.discount_rate) / (fefdiv - 1.0e0) + crfdiv = (fefdiv * self.data.costs.discount_rate) / (fefdiv - 1.0e0) # Annual cost of replacements anndiv = ( - cost_variables.divcst - * (1.0e0 + cost_variables.cfind[cost_variables.lsa - 1]) - * cost_variables.fcap0cp + self.data.costs.divcst + * (1.0e0 + self.data.costs.cfind[self.data.costs.lsa - 1]) + * self.data.costs.fcap0cp * crfdiv ) # Cost of electricity due to divertor replacements - if cost_variables.ifueltyp == 2: - anndiv *= 1.0e0 - cost_variables.life_div_fpy / cost_variables.life_plant + if self.data.costs.ifueltyp == 2: + anndiv *= ( + 1.0e0 - self.data.costs.life_div_fpy / self.data.costs.life_plant + ) coediv = 1.0e9 * anndiv / kwhpy @@ -2813,24 +2846,24 @@ def coelc(self): if (physics_variables.itart == 1) and (ife_variables.ife != 1): # Compound interest factor - fefcp = (1.0e0 + cost_variables.discount_rate) ** cost_variables.cplife_cal + fefcp = (1.0e0 + self.data.costs.discount_rate) ** self.data.costs.cplife_cal # Capital recovery factor - crfcp = (fefcp * cost_variables.discount_rate) / (fefcp - 1.0e0) + crfcp = (fefcp * self.data.costs.discount_rate) / (fefcp - 1.0e0) # Annual cost of replacements anncp = ( - cost_variables.cpstcst - * (1.0e0 + cost_variables.cfind[cost_variables.lsa - 1]) - * cost_variables.fcap0cp + self.data.costs.cpstcst + * (1.0e0 + self.data.costs.cfind[self.data.costs.lsa - 1]) + * self.data.costs.fcap0cp * crfcp ) # Cost of electricity due to centrepost replacements - if cost_variables.ifueltyp == 2: - anncp *= 1.0e0 - cost_variables.cplife / cost_variables.life_plant + if self.data.costs.ifueltyp == 2: + anncp *= 1.0e0 - self.data.costs.cplife / self.data.costs.life_plant coecp = 1.0e9 * anncp / kwhpy @@ -2843,23 +2876,23 @@ def coelc(self): # Compound interest factor - fefcdr = (1.0e0 + cost_variables.discount_rate) ** cost_variables.cdrlife_cal + fefcdr = (1.0e0 + self.data.costs.discount_rate) ** self.data.costs.cdrlife_cal # Capital recovery factor - crfcdr = (fefcdr * cost_variables.discount_rate) / (fefcdr - 1.0e0) + crfcdr = (fefcdr * self.data.costs.discount_rate) / (fefcdr - 1.0e0) # Annual cost of replacements - if cost_variables.ifueltyp == 0: + if self.data.costs.ifueltyp == 0: anncdr = 0.0e0 else: anncdr = ( - cost_variables.cdcost - * cost_variables.fcdfuel - / (1.0e0 - cost_variables.fcdfuel) - * (1.0e0 + cost_variables.cfind[cost_variables.lsa - 1]) - * cost_variables.fcap0cp + self.data.costs.cdcost + * self.data.costs.fcdfuel + / (1.0e0 - self.data.costs.fcdfuel) + * (1.0e0 + self.data.costs.cfind[self.data.costs.lsa - 1]) + * self.data.costs.fcap0cp * crfcdr ) @@ -2882,7 +2915,7 @@ def coelc(self): heat_transport_variables.p_plant_electric_net_mw / 1200.0e0 ) annoam = ( - cost_variables.ucoam[cost_variables.lsa - 1] + self.data.costs.ucoam[self.data.costs.lsa - 1] * sqrt_p_plant_electric_net_mw_1200 ) @@ -2914,7 +2947,7 @@ def coelc(self): # Cost of electricity due to operation and maintenance - cost_variables.coeoam = 1.0e9 * annoam / kwhpy + self.data.costs.coeoam = 1.0e9 * annoam / kwhpy # Costs due to reactor fuel # ========================= @@ -2924,16 +2957,16 @@ def coelc(self): if ife_variables.ife != 1: # Sum D-T fuel cost and He3 fuel cost annfuel = ( - cost_variables.ucfuel + self.data.costs.ucfuel * heat_transport_variables.p_plant_electric_net_mw / 1200.0e0 + 1.0e-6 * physics_variables.f_plasma_fuel_helium3 * physics_variables.wtgpd * 1.0e-3 - * cost_variables.uche3 + * self.data.costs.uche3 * constants.N_DAY_YEAR - * cost_variables.f_t_plant_available + * self.data.costs.f_t_plant_available ) else: annfuel = ( @@ -2941,7 +2974,7 @@ def coelc(self): * ife_variables.uctarg * ife_variables.reprat * 3.1536e7 - * cost_variables.f_t_plant_available + * self.data.costs.f_t_plant_available ) # Cost of electricity due to reactor fuel @@ -2954,7 +2987,7 @@ def coelc(self): # Annual cost of waste disposal annwst = ( - cost_variables.ucwst[cost_variables.lsa - 1] + self.data.costs.ucwst[self.data.costs.lsa - 1] * sqrt_p_plant_electric_net_mw_1200 ) @@ -2966,20 +2999,20 @@ def coelc(self): # ================================= # Annual contributions to fund for decommissioning - # A fraction cost_variables.decomf of the construction cost is set aside for + # A fraction self.data.costs.decomf of the construction cost is set aside for # this purpose at the start of the plant life. # Final factor takes into account inflation over the plant lifetime # (suggested by Tim Hender 07/03/96) - # Difference (cost_variables.dintrt) between borrowing and saving interest rates is - # included, along with the possibility of completing the fund cost_variables.dtlife + # Difference (self.data.costs.dintrt) between borrowing and saving interest rates is + # included, along with the possibility of completing the fund self.data.costs.dtlife # years before the end of the plant's lifetime anndecom = ( - cost_variables.decomf - * cost_variables.concost - * cost_variables.fcr0 - / (1.0e0 + cost_variables.discount_rate - cost_variables.dintrt) - ** (cost_variables.life_plant - cost_variables.dtlife) + self.data.costs.decomf + * self.data.costs.concost + * self.data.costs.fcr0 + / (1.0e0 + self.data.costs.discount_rate - self.data.costs.dintrt) + ** (self.data.costs.life_plant - self.data.costs.dtlife) ) # Cost of electricity due to decommissioning fund @@ -2995,7 +3028,7 @@ def coelc(self): # Total cost of electricity due to 'fuel-like' components - cost_variables.coefuelt = coefwbl + coediv + coecdr + coecp + coefuel + coewst + self.data.costs.coefuelt = coefwbl + coediv + coecdr + coecp + coefuel + coewst # Total annual costs @@ -3003,41 +3036,40 @@ def coelc(self): # Total cost of electricity - cost_variables.coe = ( - cost_variables.coecap - + cost_variables.coefuelt - + cost_variables.coeoam + self.data.costs.coe = ( + self.data.costs.coecap + + self.data.costs.coefuelt + + self.data.costs.coeoam + coedecom ) - @staticmethod - def convert_fpy_to_calendar(): + def convert_fpy_to_calendar(self): """Routine to convert component lifetimes in FPY to calendar years. Required for replacement component costs. """ # FW/Blanket and HCD - if fwbs_variables.life_blkt_fpy < cost_variables.life_plant: + if fwbs_variables.life_blkt_fpy < self.data.costs.life_plant: fwbs_variables.life_blkt = ( - fwbs_variables.life_blkt_fpy * cost_variables.f_t_plant_available + fwbs_variables.life_blkt_fpy * self.data.costs.f_t_plant_available ) # Current drive system lifetime (assumed equal to first wall and blanket lifetime) - cost_variables.cdrlife_cal = fwbs_variables.life_blkt + self.data.costs.cdrlife_cal = fwbs_variables.life_blkt else: fwbs_variables.life_blkt = fwbs_variables.life_blkt_fpy # Divertor - if cost_variables.life_div_fpy < cost_variables.life_plant: - cost_variables.life_div = ( - cost_variables.life_div_fpy * cost_variables.f_t_plant_available + if self.data.costs.life_div_fpy < self.data.costs.life_plant: + self.data.costs.life_div = ( + self.data.costs.life_div_fpy * self.data.costs.f_t_plant_available ) else: - cost_variables.life_div = cost_variables.life_div_fpy + self.data.costs.life_div = self.data.costs.life_div_fpy # Centrepost if physics_variables.itart == 1: - if cost_variables.cplife < cost_variables.life_plant: - cost_variables.cplife_cal = ( - cost_variables.cplife * cost_variables.f_t_plant_available + if self.data.costs.cplife < self.data.costs.life_plant: + self.data.costs.cplife_cal = ( + self.data.costs.cplife * self.data.costs.f_t_plant_available ) else: - cost_variables.cplife_cal = cost_variables.cplife + self.data.costs.cplife_cal = self.data.costs.cplife diff --git a/process/models/costs/costs_2015.py b/process/models/costs/costs_2015.py index 0305acd435..e7779ee8cc 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 ( build_variables, - cost_variables, current_drive_variables, first_wall_variables, fwbs_variables, @@ -71,11 +70,11 @@ def run(self): ) # Save as concost, the variable used as a Figure of Merit (M$) - cost_variables.concost = self.data.costs_2015.total_costs / 1.0e6 + self.data.costs.concost = self.data.costs_2015.total_costs / 1.0e6 # Electrical output (given availability) for a whole year self.data.costs_2015.mean_electric_output = ( - heat_transport_variables.p_plant_electric_net_mw * cost_variables.cpfact + heat_transport_variables.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 @@ -84,7 +83,7 @@ def run(self): # Annual maintenance cost. self.data.costs_2015.maintenance = ( self.data.costs_2015.s_cost[26] + self.data.costs_2015.s_cost[37] - ) * cost_variables.maintenance_fwbs + ( + ) * self.data.costs.maintenance_fwbs + ( self.data.costs_2015.s_cost[8] + self.data.costs_2015.s_cost[30] + self.data.costs_2015.s_cost[33] @@ -101,20 +100,20 @@ def run(self): + self.data.costs_2015.s_cost[52] + self.data.costs_2015.s_cost[53] + self.data.costs_2015.s_cost[57] - ) * cost_variables.maintenance_gen + ) * self.data.costs.maintenance_gen # Levelized cost of electricity (LCOE) ($/MWh) if self.data.costs_2015.annual_electric_output > 0.00001: - cost_variables.coe = ( + self.data.costs.coe = ( 1.0e0 / self.data.costs_2015.annual_electric_output ) * ( - self.data.costs_2015.total_costs / cost_variables.amortization + self.data.costs_2015.total_costs / self.data.costs.amortization + self.data.costs_2015.maintenance ) # Switch on output if there is a NaN error - if (abs(cost_variables.concost) > 9.99e99) or ( - cost_variables.concost != cost_variables.concost + if (abs(self.data.costs.concost) > 9.99e99) or ( + self.data.costs.concost != self.data.costs.concost ): self.output() @@ -142,7 +141,7 @@ def calc_fwbs_costs(self): PROCESS Costs Paper (M. Kovari, J. Morris) """ for i in range(21, 27): - self.data.costs_2015.s_cost_factor[i] = cost_variables.cost_factor_fwbs + self.data.costs_2015.s_cost_factor[i] = self.data.costs.cost_factor_fwbs # Enrichment # Costs based on the number of separative work units (SWU) required @@ -189,7 +188,7 @@ def calc_fwbs_costs(self): self.data.costs_2015.s_cost_factor[21] * self.data.costs_2015.s_cref[21] * (self.data.costs_2015.s_k[21] / self.data.costs_2015.s_kref[21]) - ** cost_variables.costexp + ** self.data.costs.costexp ) if abs(self.data.costs_2015.s_cost[21] - 0.1e6) / 0.1e6 < 1.0e-3: po.ocmmnt(self.outfile, "Reference cost for enrichment CORRECT") @@ -238,7 +237,7 @@ def calc_fwbs_costs(self): self.data.costs_2015.s_cost_factor[21] * self.data.costs_2015.s_cref[21] * (self.data.costs_2015.s_k[21] / self.data.costs_2015.s_kref[21]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[22] = "Lithium orthosilicate pebble manufacturing" @@ -251,7 +250,7 @@ def calc_fwbs_costs(self): self.data.costs_2015.s_cost_factor[22] * self.data.costs_2015.s_cref[22] * (self.data.costs_2015.s_k[22] / self.data.costs_2015.s_kref[22]) - ** cost_variables.costexp_pebbles + ** self.data.costs.costexp_pebbles ) self.data.costs_2015.s_label[23] = "Titanium beryllide pebble manufacturing" @@ -264,7 +263,7 @@ def calc_fwbs_costs(self): self.data.costs_2015.s_cost_factor[23] * self.data.costs_2015.s_cref[23] * (self.data.costs_2015.s_k[23] / self.data.costs_2015.s_kref[23]) - ** cost_variables.costexp_pebbles + ** self.data.costs.costexp_pebbles ) self.data.costs_2015.s_label[24] = "First wall W coating manufacturing" @@ -281,7 +280,7 @@ def calc_fwbs_costs(self): self.data.costs_2015.s_cost_factor[24] * self.data.costs_2015.s_cref[24] * (self.data.costs_2015.s_k[24] / self.data.costs_2015.s_kref[24]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[25] = ( @@ -300,7 +299,7 @@ def calc_fwbs_costs(self): self.data.costs_2015.s_cost_factor[25] * self.data.costs_2015.s_cref[25] * (self.data.costs_2015.s_k[25] / self.data.costs_2015.s_kref[25]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[26] = "Total first wall and blanket cost" @@ -424,7 +423,7 @@ def output(self): "OP ", ) po.ovarrf( - self.outfile, "Capacity factor", "(cpfact)", cost_variables.cpfact, "OP " + self.outfile, "Capacity factor", "(cpfact)", self.data.costs.cpfact, "OP " ) po.ovarrf( self.outfile, @@ -446,7 +445,7 @@ def output(self): self.outfile, "Levelized cost of electricity ($/MWh)", "(coe)", - cost_variables.coe, + self.data.costs.coe, "OP ", ) @@ -463,12 +462,12 @@ def calc_building_costs(self): PROCESS Costs Paper (M. Kovari, J. Morris) """ for i in range(9): - self.data.costs_2015.s_cost_factor[i] = cost_variables.cost_factor_buildings + self.data.costs_2015.s_cost_factor[i] = self.data.costs.cost_factor_buildings # Power plant admin buildings cost ($) self.data.costs_2015.s_label[0] = "Admin Buildings" self.data.costs_2015.s_cref[0] = ( - 129000.0e0 * cost_variables.light_build_cost_per_vol + 129000.0e0 * self.data.costs.light_build_cost_per_vol ) self.data.costs_2015.s_cost[0] = ( self.data.costs_2015.s_cost_factor[0] * self.data.costs_2015.s_cref[0] @@ -477,7 +476,7 @@ def calc_building_costs(self): # Tokamak complex excluding hot cell cost ($) self.data.costs_2015.s_label[1] = "Tokamak Complex (excluding hot cell)" self.data.costs_2015.s_cref[1] = ( - 1100000.0e0 * cost_variables.tok_build_cost_per_vol + 1100000.0e0 * self.data.costs.tok_build_cost_per_vol ) # ITER cryostat volume (m^3) self.data.costs_2015.s_k[1] = ( @@ -495,7 +494,7 @@ def calc_building_costs(self): # Neutral beam buildings cost ($) self.data.costs_2015.s_label[2] = "Neutral beam buildings" self.data.costs_2015.s_cref[2] = ( - 28000.0e0 * cost_variables.light_build_cost_per_vol + 28000.0e0 * self.data.costs.light_build_cost_per_vol ) # Scale with neutral beam wall plug power (MW) self.data.costs_2015.s_k[2] = current_drive_variables.pwpnb @@ -509,7 +508,7 @@ def calc_building_costs(self): # Cryoplant buildings cost ($) self.data.costs_2015.s_label[3] = "Cryoplant buildings" self.data.costs_2015.s_cref[3] = ( - 130000.0e0 * cost_variables.light_build_cost_per_vol + 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 @@ -523,7 +522,7 @@ def calc_building_costs(self): # PF Coil winding building cost ($) self.data.costs_2015.s_label[4] = "PF Coil winding building" self.data.costs_2015.s_cref[4] = ( - 190000.0e0 * cost_variables.light_build_cost_per_vol + 190000.0e0 * self.data.costs.light_build_cost_per_vol ) # Scale with the radius of the largest PF coil squared (m^2) self.data.costs_2015.s_k[4] = pfcoil_variables.r_pf_coil_outer_max**2 @@ -537,7 +536,7 @@ def calc_building_costs(self): # Magnet power supplies and related buildings cost ($) self.data.costs_2015.s_label[5] = "Magnet power supplies and related buildings" self.data.costs_2015.s_cref[5] = ( - 110000.0e0 * cost_variables.light_build_cost_per_vol + 110000.0e0 * self.data.costs.light_build_cost_per_vol ) # Scale with TF current per coil (MA) self.data.costs_2015.s_k[5] = ( @@ -553,7 +552,7 @@ def calc_building_costs(self): # Magnet discharge buildings cost ($) self.data.costs_2015.s_label[6] = "Magnet discharge buildings" self.data.costs_2015.s_cref[6] = ( - 35000.0e0 * cost_variables.light_build_cost_per_vol + 35000.0e0 * self.data.costs.light_build_cost_per_vol ) # Scale with total stored energy in TF coils (GJ) self.data.costs_2015.s_k[6] = tfcoil_variables.e_tf_magnetic_stored_total_gj @@ -568,7 +567,7 @@ def calc_building_costs(self): self.data.costs_2015.s_label[7] = "Heat removal system buildings" # ITER volume of cooling water buildings (m^3) self.data.costs_2015.s_cref[7] = ( - 51000.0e0 * cost_variables.light_build_cost_per_vol + 51000.0e0 * self.data.costs.light_build_cost_per_vol ) # Scale with total thermal power removed from the core (MW) self.data.costs_2015.s_k[7] = ( @@ -594,7 +593,7 @@ def calc_land_costs(self): PROCESS Costs Paper (M. Kovari, J. Morris) """ for i in range(9, 13): - self.data.costs_2015.s_cost_factor[i] = cost_variables.cost_factor_land + self.data.costs_2015.s_cost_factor[i] = self.data.costs.cost_factor_land # Land purchasing cost ($) self.data.costs_2015.s_label[9] = "Land purchasing" @@ -617,7 +616,7 @@ def calc_land_costs(self): * ( ITER_key_buildings_land_area * (self.data.costs_2015.s_k[9] / self.data.costs_2015.s_kref[9]) - ** cost_variables.costexp + ** self.data.costs.costexp + ITER_buffer_land_area ) ) @@ -632,7 +631,7 @@ def calc_land_costs(self): self.data.costs_2015.s_cost[10] = ( self.data.costs_2015.s_cost_factor[10] * (self.data.costs_2015.s_k[10] / self.data.costs_2015.s_kref[10]) - ** cost_variables.costexp + ** self.data.costs.costexp * self.data.costs_2015.s_cref[10] ) @@ -650,7 +649,7 @@ def calc_land_costs(self): self.data.costs_2015.s_cost_factor[11] * self.data.costs_2015.s_cref[11] * (self.data.costs_2015.s_k[11] / self.data.costs_2015.s_kref[11]) - ** cost_variables.costexp + ** self.data.costs.costexp ) # Total land costs ($) @@ -666,7 +665,7 @@ def calc_tf_coil_costs(self): PROCESS Costs Paper (M. Kovari, J. Morris) """ for i in range(13, 20): - self.data.costs_2015.s_cost_factor[i] = cost_variables.cost_factor_tf_coils + self.data.costs_2015.s_cost_factor[i] = self.data.costs.cost_factor_tf_coils # TF coil insertion and welding costs ($) self.data.costs_2015.s_label[13] = "TF Coil insertion and welding" @@ -681,7 +680,7 @@ def calc_tf_coil_costs(self): self.data.costs_2015.s_cost_factor[13] * self.data.costs_2015.s_cref[13] * (self.data.costs_2015.s_k[13] / self.data.costs_2015.s_kref[13]) - ** cost_variables.costexp + ** self.data.costs.costexp ) # TF coil winding costs ($) @@ -699,7 +698,7 @@ def calc_tf_coil_costs(self): self.data.costs_2015.s_cost_factor[15] * self.data.costs_2015.s_cref[15] * (self.data.costs_2015.s_k[15] / self.data.costs_2015.s_kref[15]) - ** cost_variables.costexp + ** self.data.costs.costexp ) # Copper stand cost for TF coil ($) @@ -715,7 +714,7 @@ def calc_tf_coil_costs(self): self.data.costs_2015.s_cost_factor[16] * self.data.costs_2015.s_cref[16] * (self.data.costs_2015.s_k[16] / self.data.costs_2015.s_kref[16]) - ** cost_variables.costexp + ** self.data.costs.costexp ) # superconductor strand cost ($) @@ -733,7 +732,7 @@ def calc_tf_coil_costs(self): self.data.costs_2015.s_cost_factor[17] * self.data.costs_2015.s_cref[17] * (self.data.costs_2015.s_k[17] / self.data.costs_2015.s_kref[17]) - ** cost_variables.costexp + ** self.data.costs.costexp ) # Superconductor testing cost ($) @@ -759,7 +758,7 @@ def calc_tf_coil_costs(self): self.data.costs_2015.s_cost_factor[19] * self.data.costs_2015.s_cref[19] * (self.data.costs_2015.s_k[19] / self.data.costs_2015.s_kref[19]) - ** cost_variables.costexp + ** self.data.costs.costexp ) # Total TF coil costs ($) @@ -773,14 +772,14 @@ def calc_remote_handling_costs(self): PROCESS Costs Paper (M. Kovari, J. Morris) """ for i in range(27, 31): - self.data.costs_2015.s_cost_factor[i] = cost_variables.cost_factor_rh + self.data.costs_2015.s_cost_factor[i] = self.data.costs.cost_factor_rh # K:\Power Plant Physics and Technology\Costs\Remote handling # From Sam Ha. self.data.costs_2015.s_label[27] = "Moveable equipment" self.data.costs_2015.s_cref[27] = 1.0e6 * ( - 139.0e0 * cost_variables.num_rh_systems + 410.0e0 + 139.0e0 * self.data.costs.num_rh_systems + 410.0e0 ) # Scale with total mass of armour, first wall and blanket (kg) self.data.costs_2015.s_kref[27] = 4.35e6 @@ -789,14 +788,14 @@ def calc_remote_handling_costs(self): self.data.costs_2015.s_cost_factor[27] * self.data.costs_2015.s_cref[27] * (self.data.costs_2015.s_k[27] / self.data.costs_2015.s_kref[27]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[28] = ( "Active maintenance facility with fixed equipment" ) self.data.costs_2015.s_cref[28] = 1.0e6 * ( - 95.0e0 * cost_variables.num_rh_systems + 2562.0e0 + 95.0e0 * self.data.costs.num_rh_systems + 2562.0e0 ) # Scale with total mass of armour, first wall and blanket (kg) self.data.costs_2015.s_kref[28] = 4.35e6 @@ -805,7 +804,7 @@ def calc_remote_handling_costs(self): self.data.costs_2015.s_cost_factor[28] * self.data.costs_2015.s_cref[28] * (self.data.costs_2015.s_k[28] / self.data.costs_2015.s_kref[28]) - ** cost_variables.costexp + ** self.data.costs.costexp ) # s(30) is not in use @@ -822,7 +821,7 @@ def calc_n_plant_and_vv_costs(self): PROCESS Costs Paper (M. Kovari, J. Morris) """ for i in range(31, 34): - self.data.costs_2015.s_cost_factor[i] = cost_variables.cost_factor_vv + self.data.costs_2015.s_cost_factor[i] = self.data.costs.cost_factor_vv # Vacuum vessel self.data.costs_2015.s_label[31] = "Vacuum vessel" @@ -837,7 +836,7 @@ def calc_n_plant_and_vv_costs(self): self.data.costs_2015.s_cost_factor[31] * self.data.costs_2015.s_cref[31] * (self.data.costs_2015.s_k[31] / self.data.costs_2015.s_kref[31]) - ** cost_variables.costexp + ** self.data.costs.costexp ) # Nitrogen plant @@ -851,7 +850,7 @@ def calc_n_plant_and_vv_costs(self): self.data.costs_2015.s_cost_factor[32] * self.data.costs_2015.s_cref[32] * (self.data.costs_2015.s_k[32] / self.data.costs_2015.s_kref[32]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[33] = ( @@ -869,7 +868,7 @@ def calc_energy_conversion_system(self): """ self.data.costs_2015.s_label[34] = "Energy conversion system" # Set cost factor for energy conversion system - self.data.costs_2015.s_cost_factor[34] = cost_variables.cost_factor_bop + self.data.costs_2015.s_cost_factor[34] = self.data.costs.cost_factor_bop # Cost of reference energy conversion system (Rolls Royce) self.data.costs_2015.s_cref[34] = 511.0e6 # Scale with gross electric power (MWe) @@ -879,7 +878,7 @@ def calc_energy_conversion_system(self): self.data.costs_2015.s_cost_factor[34] * self.data.costs_2015.s_cref[34] * (self.data.costs_2015.s_k[34] / self.data.costs_2015.s_kref[34]) - ** cost_variables.costexp + ** self.data.costs.costexp ) def calc_remaining_subsystems(self): @@ -889,7 +888,7 @@ def calc_remaining_subsystems(self): PROCESS Costs Paper (M. Kovari, J. Morris) """ for i in range(35, 60): - self.data.costs_2015.s_cost_factor[i] = cost_variables.cost_factor_misc + self.data.costs_2015.s_cost_factor[i] = self.data.costs.cost_factor_misc self.data.costs_2015.s_label[35] = "CS and PF coils" # # Cost of ITER CS and PF magnets @@ -901,7 +900,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[35] * self.data.costs_2015.s_cref[35] * (self.data.costs_2015.s_k[35] / self.data.costs_2015.s_kref[35]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[36] = ( @@ -916,7 +915,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[36] * self.data.costs_2015.s_cref[36] * (self.data.costs_2015.s_k[36] / self.data.costs_2015.s_kref[36]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[37] = "Divertor" @@ -929,7 +928,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[37] * self.data.costs_2015.s_cref[37] * (self.data.costs_2015.s_k[37] / self.data.costs_2015.s_kref[37]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[38] = "not used" @@ -948,7 +947,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[40] * self.data.costs_2015.s_cref[40] * (self.data.costs_2015.s_k[40] / self.data.costs_2015.s_kref[40]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[41] = "not used" @@ -966,7 +965,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[42] * self.data.costs_2015.s_cref[42] * (self.data.costs_2015.s_k[42] / self.data.costs_2015.s_kref[42]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[43] = "Cryostat" @@ -983,7 +982,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[43] * self.data.costs_2015.s_cref[43] * (self.data.costs_2015.s_k[43] / self.data.costs_2015.s_kref[43]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[44] = "Heat removal system" @@ -999,7 +998,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[44] * self.data.costs_2015.s_cref[44] * (self.data.costs_2015.s_k[44] / self.data.costs_2015.s_kref[44]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[45] = "Thermal shields" @@ -1019,7 +1018,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[45] * self.data.costs_2015.s_cref[45] * (self.data.costs_2015.s_k[45] / self.data.costs_2015.s_kref[45]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[46] = "Pellet injection system" @@ -1032,7 +1031,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[46] * self.data.costs_2015.s_cref[46] * (self.data.costs_2015.s_k[46] / self.data.costs_2015.s_kref[46]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[47] = "Gas injection and wall conditioning system" @@ -1045,7 +1044,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[47] * self.data.costs_2015.s_cref[47] * (self.data.costs_2015.s_k[47] / self.data.costs_2015.s_kref[47]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[48] = "Vacuum pumping" @@ -1058,7 +1057,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[48] * self.data.costs_2015.s_cref[48] * (self.data.costs_2015.s_k[48] / self.data.costs_2015.s_kref[48]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[49] = "Tritium plant" @@ -1071,7 +1070,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[49] * self.data.costs_2015.s_cref[49] * (self.data.costs_2015.s_k[49] / self.data.costs_2015.s_kref[49]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[50] = "Cryoplant and distribution" @@ -1084,7 +1083,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[50] * self.data.costs_2015.s_cref[50] * (self.data.costs_2015.s_k[50] / self.data.costs_2015.s_kref[50]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[51] = "Electrical power supply and distribution" @@ -1101,7 +1100,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[51] * self.data.costs_2015.s_cref[51] * (self.data.costs_2015.s_k[51] / self.data.costs_2015.s_kref[51]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[52] = ( @@ -1116,7 +1115,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[52] * self.data.costs_2015.s_cref[52] * (self.data.costs_2015.s_k[52] / self.data.costs_2015.s_kref[52]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[53] = "Diagnostics systems" @@ -1137,7 +1136,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[54] * self.data.costs_2015.s_cref[54] * (self.data.costs_2015.s_k[54] / self.data.costs_2015.s_kref[54]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[55] = "Access control and security systems" @@ -1150,7 +1149,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[55] * self.data.costs_2015.s_cref[55] * (self.data.costs_2015.s_k[55] / self.data.costs_2015.s_kref[55]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[56] = "Assembly" @@ -1215,7 +1214,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[57] * self.data.costs_2015.s_cref[57] * (self.data.costs_2015.s_k[57] / self.data.costs_2015.s_kref[57]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[58] = "Additional project expenditure" @@ -1240,7 +1239,7 @@ def calc_remaining_subsystems(self): self.data.costs_2015.s_cost_factor[59] * self.data.costs_2015.s_cref[59] * (self.data.costs_2015.s_k[59] / self.data.costs_2015.s_kref[59]) - ** cost_variables.costexp + ** self.data.costs.costexp ) self.data.costs_2015.s_label[60] = "Total remaining subsystem costs" diff --git a/process/models/ife.py b/process/models/ife.py index c9384406a5..b7be4acba6 100644 --- a/process/models/ife.py +++ b/process/models/ife.py @@ -12,7 +12,6 @@ from process.core.model import Model from process.data_structure import ( buildings_variables, - cost_variables, first_wall_variables, fwbs_variables, heat_transport_variables, @@ -1764,14 +1763,14 @@ def ifefbs(self, output: bool = False): # Blanket and first wall lifetimes (HYLIFE-II: = plant life) if ife_variables.ifetyp in {3, 4}: - life = cost_variables.life_plant + life = self.data.costs.life_plant else: life = min( - cost_variables.life_plant, - cost_variables.abktflnc + self.data.costs.life_plant, + self.data.costs.abktflnc / ( physics_variables.pflux_fw_neutron_mw - * cost_variables.f_t_plant_available + * self.data.costs.f_t_plant_available ), ) @@ -1934,7 +1933,7 @@ def ifepw2(self, output: bool = False): ) # Calculate powers relevant to a power-producing plant - if cost_variables.ireactor == 1: + 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 @@ -2070,7 +2069,7 @@ def ifepw2(self, output: bool = False): heat_transport_variables.n_primary_heat_exchangers, ) - if cost_variables.ireactor == 1: + if self.data.costs.ireactor == 1: process_output.osubhd(self.outfile, "Reactor powers :") process_output.ovarre( self.outfile, diff --git a/process/models/power.py b/process/models/power.py index b11cf3ff2a..0ad471718e 100644 --- a/process/models/power.py +++ b/process/models/power.py @@ -11,7 +11,6 @@ from process.data_structure import ( build_variables, buildings_variables, - cost_variables, current_drive_variables, fwbs_variables, heat_transport_variables, @@ -1603,7 +1602,7 @@ def plant_electric_production(self): ) # Calculate powers relevant to a power-producing plant - if cost_variables.ireactor == 1: + if self.data.costs.ireactor == 1: # Gross electric power # p_plant_electric_gross_mw = (heat_transport_variables.p_plant_primary_heat_mw-hthermmw) * heat_transport_variables.eta_turbine if ( diff --git a/process/models/stellarator/stellarator.py b/process/models/stellarator/stellarator.py index 7761b57b31..f97c5aa02e 100644 --- a/process/models/stellarator/stellarator.py +++ b/process/models/stellarator/stellarator.py @@ -16,7 +16,6 @@ from process.data_structure import ( build_variables, constraint_variables, - cost_variables, current_drive_variables, divertor_variables, first_wall_variables, @@ -506,8 +505,8 @@ def st_fwbs(self, output: bool): """ fwbs_variables.life_fw_fpy = min( - cost_variables.abktflnc / physics_variables.pflux_fw_neutron_mw, - cost_variables.life_plant, + self.data.costs.abktflnc / physics_variables.pflux_fw_neutron_mw, + self.data.costs.life_plant, ) # First wall inboard, outboard areas (assume 50% of total each) @@ -1865,7 +1864,7 @@ def sc_tf_coil_nuclear_heating_iter90(self): # Full power DT operation years for replacement of TF Coil # (or plant life) - fpydt = cost_variables.f_t_plant_available * cost_variables.life_plant + fpydt = self.data.costs.f_t_plant_available * self.data.costs.life_plant fpsdt = fpydt * 3.154e7 # seconds # Insulator dose (rad) diff --git a/tests/unit/models/stellarator/test_stellarator.py b/tests/unit/models/stellarator/test_stellarator.py index 5834943121..59b1a81ff2 100644 --- a/tests/unit/models/stellarator/test_stellarator.py +++ b/tests/unit/models/stellarator/test_stellarator.py @@ -5,7 +5,6 @@ from process.data_structure import ( build_variables, - cost_variables, first_wall_variables, fwbs_variables, heat_transport_variables, @@ -16,34 +15,6 @@ structure_variables, tfcoil_variables, ) -from process.models.availability import Availability -from process.models.blankets.hcpb import CCFE_HCPB -from process.models.buildings import Buildings -from process.models.costs.costs import Costs -from process.models.fw import FirstWall -from process.models.physics.bootstrap_current import PlasmaBootstrapCurrent -from process.models.physics.confinement_time import PlasmaConfinementTime -from process.models.physics.current_drive import ( - CurrentDrive, - ElectronBernstein, - ElectronCyclotron, - IonCyclotron, - LowerHybrid, - NeutralBeam, -) -from process.models.physics.density_limit import PlasmaDensityLimit -from process.models.physics.exhaust import PlasmaExhaust -from process.models.physics.l_h_transition import PlasmaConfinementTransition -from process.models.physics.physics import ( - Physics, - PlasmaBeta, - PlasmaInductance, -) -from process.models.physics.plasma_current import PlasmaCurrent, PlasmaDiamagneticCurrent -from process.models.physics.plasma_fields import PlasmaFields -from process.models.physics.plasma_geometry import PlasmaGeom -from process.models.physics.plasma_profiles import PlasmaProfile -from process.models.power import Power from process.models.stellarator.build import st_build from process.models.stellarator.coils.coils import bmax_from_awp, intersect from process.models.stellarator.coils.quench import ( @@ -54,60 +25,16 @@ st_d_limit_ecrh, st_sudo_density_limit, ) -from process.models.stellarator.neoclassics import Neoclassics -from process.models.stellarator.stellarator import Stellarator -from process.models.vacuum import Vacuum @pytest.fixture -def stellarator(): +def stellarator(process_models): """Provides Stellarator object for testing. :returns: initialised Stellarator object :rtype: process.stellerator.Stellarator """ - return Stellarator( - Availability(), - Vacuum(), - Buildings(), - Costs(), - Power(), - PlasmaProfile(), - CCFE_HCPB(FirstWall()), - CurrentDrive( - PlasmaProfile(), - ElectronCyclotron(plasma_profile=PlasmaProfile()), - IonCyclotron(plasma_profile=PlasmaProfile()), - NeutralBeam(plasma_profile=PlasmaProfile()), - LowerHybrid(plasma_profile=PlasmaProfile()), - ElectronBernstein(plasma_profile=PlasmaProfile()), - ), - Physics( - PlasmaProfile(), - CurrentDrive( - PlasmaProfile(), - ElectronCyclotron(plasma_profile=PlasmaProfile()), - IonCyclotron(plasma_profile=PlasmaProfile()), - NeutralBeam(plasma_profile=PlasmaProfile()), - LowerHybrid(plasma_profile=PlasmaProfile()), - ElectronBernstein(plasma_profile=PlasmaProfile()), - ), - PlasmaBeta(), - PlasmaInductance(), - PlasmaDensityLimit(), - PlasmaExhaust(), - PlasmaBootstrapCurrent(plasma_profile=PlasmaProfile()), - PlasmaConfinementTime(), - PlasmaConfinementTransition(), - PlasmaCurrent(), - PlasmaFields(), - plasma_dia_current=PlasmaDiamagneticCurrent(), - plasma_geometry=PlasmaGeom(), - ), - Neoclassics(), - plasma_beta=PlasmaBeta(), - plasma_bootstrap=PlasmaBootstrapCurrent(plasma_profile=PlasmaProfile()), - ) + return process_models.stellarator class StgeomParam(NamedTuple): @@ -2214,7 +2141,7 @@ class SctfcoilNuclearHeatingIter90Param(NamedTuple): ], ) def test_sctfcoil_nuclear_heating_iter90( - sctfcoilnuclearheatingiter90param, monkeypatch, stellarator + sctfcoilnuclearheatingiter90param, monkeypatch, stellarator, process_models ): """ Automatically generated Regression Unit Test for sctfcoil_nuclear_heating_iter90. @@ -2258,12 +2185,14 @@ def test_sctfcoil_nuclear_heating_iter90( sctfcoilnuclearheatingiter90param.dr_shld_outboard, ) monkeypatch.setattr( - cost_variables, + stellarator.data.costs, "f_t_plant_available", sctfcoilnuclearheatingiter90param.f_t_plant_available, ) monkeypatch.setattr( - cost_variables, "life_plant", sctfcoilnuclearheatingiter90param.life_plant + stellarator.data.costs, + "life_plant", + sctfcoilnuclearheatingiter90param.life_plant, ) monkeypatch.setattr( physics_variables, diff --git a/tests/unit/models/test_availability.py b/tests/unit/models/test_availability.py index c2ee4e3868..dea932b83e 100644 --- a/tests/unit/models/test_availability.py +++ b/tests/unit/models/test_availability.py @@ -1,11 +1,10 @@ -"""Unit tests for availability.f90.""" +"""Unit tests for availability.py.""" import pytest from process import data_structure from process.core.init import init_all_module_vars from process.data_structure import constraint_variables as ctv -from process.data_structure import cost_variables as cv from process.data_structure import divertor_variables as dv from process.data_structure import fwbs_variables as fwbsv from process.data_structure import ife_variables as ifev @@ -16,7 +15,7 @@ @pytest.fixture def availability(process_models): - """Provides Availability object for testing. + """Fixture to get the Availability instance from process_models. :return availability: initialised Availability object :type availability: process.availability.Availability @@ -41,21 +40,21 @@ def test_avail_0(monkeypatch, availability, life_fw_fpy, ibkt_life, bktlife_exp_ monkeypatch.setattr(ifev, "ife", 0) monkeypatch.setattr(pv, "p_fusion_total_mw", 4.0e3) monkeypatch.setattr(fwbsv, "life_fw_fpy", life_fw_fpy) - monkeypatch.setattr(cv, "ibkt_life", ibkt_life) - monkeypatch.setattr(cv, "abktflnc", 4.0) + monkeypatch.setattr(availability.data.costs, "ibkt_life", ibkt_life) + monkeypatch.setattr(availability.data.costs, "abktflnc", 4.0) monkeypatch.setattr(pv, "pflux_fw_neutron_mw", 10.0) - monkeypatch.setattr(cv, "life_plant", 30.0) - monkeypatch.setattr(cv, "life_dpa", 40.0) - monkeypatch.setattr(cv, "adivflnc", 8.0) + monkeypatch.setattr(availability.data.costs, "life_plant", 30.0) + monkeypatch.setattr(availability.data.costs, "life_dpa", 40.0) + monkeypatch.setattr(availability.data.costs, "adivflnc", 8.0) monkeypatch.setattr(dv, "pflux_div_heat_load_mw", 10.0) monkeypatch.setattr(tv, "t_plant_pulse_total", 5.0) - monkeypatch.setattr(cv, "i_plant_availability", 0) - monkeypatch.setattr(cv, "f_t_plant_available", 0.8) + monkeypatch.setattr(availability.data.costs, "i_plant_availability", 0) + monkeypatch.setattr(availability.data.costs, "f_t_plant_available", 0.8) monkeypatch.setattr(tv, "t_plant_pulse_burn", 500.0) monkeypatch.setattr(pv, "itart", 1) availability.avail(output=False) - cpfact_obs = cv.cpfact + cpfact_obs = availability.data.costs.cpfact cpfact_exp = 80.0 assert pytest.approx(cpfact_obs) == cpfact_exp @@ -63,11 +62,11 @@ def test_avail_0(monkeypatch, availability, life_fw_fpy, ibkt_life, bktlife_exp_ bktlife_exp = bktlife_exp_param assert pytest.approx(bktlife_obs) == bktlife_exp - divlife_obs = cv.life_div_fpy + divlife_obs = availability.data.costs.life_div_fpy divlife_exp = 1.0 assert pytest.approx(divlife_obs) == divlife_exp - cplife_obs = cv.cplife + cplife_obs = availability.data.costs.cplife cplife_exp = 30.0 assert pytest.approx(cplife_obs) == cplife_exp @@ -84,23 +83,23 @@ def test_avail_1(monkeypatch, availability): init_all_module_vars() # Mock module vars - monkeypatch.setattr(cv, "i_plant_availability", 1) - monkeypatch.setattr(cv, "life_div_fpy", 1.0) + monkeypatch.setattr(availability.data.costs, "i_plant_availability", 1) + monkeypatch.setattr(availability.data.costs, "life_div_fpy", 1.0) monkeypatch.setattr(fwbsv, "life_blkt_fpy", 7.0) - monkeypatch.setattr(cv, "t_div_replace_yrs", 0.1) - monkeypatch.setattr(cv, "t_blkt_replace_yrs", 0.2) - monkeypatch.setattr(cv, "tcomrepl", 0.3) - monkeypatch.setattr(cv, "uubop", 0.4) - monkeypatch.setattr(cv, "uucd", 0.5) - monkeypatch.setattr(cv, "uudiv", 0.6) - monkeypatch.setattr(cv, "uufuel", 0.7) - monkeypatch.setattr(cv, "uufw", 0.8) - monkeypatch.setattr(cv, "uumag", 0.9) - monkeypatch.setattr(cv, "uuves", 0.11) + monkeypatch.setattr(availability.data.costs, "t_div_replace_yrs", 0.1) + monkeypatch.setattr(availability.data.costs, "t_blkt_replace_yrs", 0.2) + monkeypatch.setattr(availability.data.costs, "tcomrepl", 0.3) + monkeypatch.setattr(availability.data.costs, "uubop", 0.4) + monkeypatch.setattr(availability.data.costs, "uucd", 0.5) + monkeypatch.setattr(availability.data.costs, "uudiv", 0.6) + monkeypatch.setattr(availability.data.costs, "uufuel", 0.7) + monkeypatch.setattr(availability.data.costs, "uufw", 0.8) + monkeypatch.setattr(availability.data.costs, "uumag", 0.9) + monkeypatch.setattr(availability.data.costs, "uuves", 0.11) monkeypatch.setattr(tv, "t_plant_pulse_total", 1e4) availability.avail(output=False) - cfactr_obs = cv.f_t_plant_available + cfactr_obs = availability.data.costs.f_t_plant_available cfactr_exp = 0.0006344554455445239 assert pytest.approx(cfactr_exp) == cfactr_obs @@ -130,7 +129,7 @@ def test_calc_u_unplanned_bop(monkeypatch, availability): """ # Mock module variable t_plant_operational_total_yrs - monkeypatch.setattr(cv, "t_plant_operational_total_yrs", 25.0) + monkeypatch.setattr(availability.data.costs, "t_plant_operational_total_yrs", 25.0) # Call subroutine and check result is within an absolute tolerance result = availability.calc_u_unplanned_bop(output=False) @@ -185,7 +184,7 @@ def calc_u_planned_params(): @pytest.fixture(params=calc_u_planned_params(), ids=["nominal", "ST"]) -def calc_u_planned_fix(request, monkeypatch): +def calc_u_planned_fix(availability, request, monkeypatch): """Fixture for the calc_u_planned() variables. This fixture is parameterised using calc_u_planned_params(). This runs the @@ -212,14 +211,16 @@ def calc_u_planned_fix(request, monkeypatch): monkeypatch.setattr(data_structure.fwbs_variables, "life_blkt_fpy", 0.0) monkeypatch.setattr(pv, "pflux_fw_neutron_mw", param["pflux_fw_neutron_mw"]) monkeypatch.setattr(pv, "itart", param["itart"]) - monkeypatch.setattr(cv, "life_plant", param["life_plant"]) - monkeypatch.setattr(cv, "life_div_fpy", 0.0) - monkeypatch.setattr(cv, "adivflnc", param["adivflnc"]) - monkeypatch.setattr(cv, "abktflnc", param["abktflnc"]) - monkeypatch.setattr(cv, "life_hcd_fpy", 0.0) - monkeypatch.setattr(cv, "cplife", 0.0) - monkeypatch.setattr(cv, "cpstflnc", param["cpstflnc"]) - monkeypatch.setattr(cv, "num_rh_systems", param["num_rh_systems"]) + monkeypatch.setattr(availability.data.costs, "life_plant", param["life_plant"]) + monkeypatch.setattr(availability.data.costs, "life_div_fpy", 0.0) + monkeypatch.setattr(availability.data.costs, "adivflnc", param["adivflnc"]) + monkeypatch.setattr(availability.data.costs, "abktflnc", param["abktflnc"]) + monkeypatch.setattr(availability.data.costs, "life_hcd_fpy", 0.0) + monkeypatch.setattr(availability.data.costs, "cplife", 0.0) + monkeypatch.setattr(availability.data.costs, "cpstflnc", param["cpstflnc"]) + monkeypatch.setattr( + availability.data.costs, "num_rh_systems", param["num_rh_systems"] + ) monkeypatch.setattr(fwbsv, "neut_flux_cp", 1e18) # Return the expected result for the given parameter list @@ -295,7 +296,7 @@ def calc_u_unplanned_magnets_params(): params=calc_u_unplanned_magnets_params(), ids=["no_degredation", "no_degradation_conf", "degradation_conf"], ) -def calc_u_unplanned_magnets_fix(request, monkeypatch): +def calc_u_unplanned_magnets_fix(availability, request, monkeypatch): """Fixture for the calc_u_unplanned_magnets() test. :param request: Allows access to parameters @@ -311,9 +312,11 @@ def calc_u_unplanned_magnets_fix(request, monkeypatch): # Mock module variables monkeypatch.setattr( - cv, "t_plant_operational_total_yrs", param["t_plant_operational_total_yrs"] + availability.data.costs, + "t_plant_operational_total_yrs", + param["t_plant_operational_total_yrs"], ) - monkeypatch.setattr(cv, "conf_mag", param["conf_mag"]) + monkeypatch.setattr(availability.data.costs, "conf_mag", param["conf_mag"]) monkeypatch.setattr( tfv, "temp_cs_superconductor_margin_min", @@ -383,7 +386,7 @@ def calc_u_unplanned_divertor_params(): @pytest.fixture( params=calc_u_unplanned_divertor_params(), ids=["below_nref", "above_nu", "between"] ) -def calc_u_unplanned_divertor_fix(request, monkeypatch): +def calc_u_unplanned_divertor_fix(availability, request, monkeypatch): """Fixture for the calc_u_unplanned_divertor() variables. :param request: Request object for accessing parameters @@ -399,7 +402,7 @@ def calc_u_unplanned_divertor_fix(request, monkeypatch): # Mock variables used by calc_u_unplanned_divertor() # Some may be parameterised monkeypatch.setattr(tv, "t_plant_pulse_total", param["t_plant_pulse_total"]) - monkeypatch.setattr(cv, "life_div_fpy", param["life_div_fpy"]) + monkeypatch.setattr(availability.data.costs, "life_div_fpy", param["life_div_fpy"]) # Return the expected result for the given parameter list return param["expected"] @@ -555,16 +558,16 @@ def mock_calc_u_unplanned_vacuum(*args, **kwargs): monkeypatch.setattr(ifev, "ife", 0) monkeypatch.setattr(pv, "itart", 1) monkeypatch.setattr(fwbsv, "life_blkt_fpy", 5.0) - monkeypatch.setattr(cv, "life_div_fpy", 10.0) - monkeypatch.setattr(cv, "cplife", 15.0) + monkeypatch.setattr(availability.data.costs, "life_div_fpy", 10.0) + monkeypatch.setattr(availability.data.costs, "cplife", 15.0) availability.avail_2(False) - cfactr_obs = cv.f_t_plant_available + cfactr_obs = availability.data.costs.f_t_plant_available cfactr_exp = 0.7173 assert pytest.approx(cfactr_obs) == cfactr_exp - cpfact_obs = cv.cpfact + cpfact_obs = availability.data.costs.cpfact cpfact_exp = 0.07173 assert pytest.approx(cpfact_obs) == cpfact_exp @@ -572,11 +575,11 @@ def mock_calc_u_unplanned_vacuum(*args, **kwargs): bktlife_exp = 6.97058413 assert pytest.approx(bktlife_obs) == bktlife_exp - divlife_obs = cv.life_div_fpy + divlife_obs = availability.data.costs.life_div_fpy divlife_exp = 13.94116827 assert pytest.approx(divlife_obs) == divlife_exp - cplife_obs = cv.cplife + cplife_obs = availability.data.costs.cplife cplife_exp = 20.9117524 assert pytest.approx(cplife_obs) == cplife_exp @@ -592,24 +595,24 @@ def test_avail_st(monkeypatch, availability): """ # Initialise fortran variables to keep test isolated from others init_all_module_vars() - monkeypatch.setattr(cv, "tmain", 1.0) - monkeypatch.setattr(cv, "life_plant", 30.0) - monkeypatch.setattr(cv, "u_unplanned_cp", 0.05) + monkeypatch.setattr(availability.data.costs, "tmain", 1.0) + monkeypatch.setattr(availability.data.costs, "life_plant", 30.0) + monkeypatch.setattr(availability.data.costs, "u_unplanned_cp", 0.05) monkeypatch.setattr(tv, "t_plant_pulse_burn", 5.0) monkeypatch.setattr(tv, "t_plant_pulse_total", 9000.0) - monkeypatch.setattr(cv, "adivflnc", 10.0) + monkeypatch.setattr(availability.data.costs, "adivflnc", 10.0) monkeypatch.setattr(dv, "pflux_div_heat_load_mw", 10.0) - monkeypatch.setattr(cv, "ibkt_life", 0) - monkeypatch.setattr(cv, "abktflnc", 10.0) + monkeypatch.setattr(availability.data.costs, "ibkt_life", 0) + monkeypatch.setattr(availability.data.costs, "abktflnc", 10.0) monkeypatch.setattr(pv, "pflux_fw_neutron_mw", 10.0) - monkeypatch.setattr(cv, "cplife", 5.0) - monkeypatch.setattr(cv, "life_hcd_fpy", 15.0) + monkeypatch.setattr(availability.data.costs, "cplife", 5.0) + monkeypatch.setattr(availability.data.costs, "life_hcd_fpy", 15.0) availability.avail_st(output=False) - assert pytest.approx(cv.t_plant_operational_total_yrs) == 15.0 - assert pytest.approx(cv.f_t_plant_available) == 0.27008858 - assert pytest.approx(cv.cpfact, abs=1.0e-8) == 0.00015005 + assert pytest.approx(availability.data.costs.t_plant_operational_total_yrs) == 15.0 + assert pytest.approx(availability.data.costs.f_t_plant_available) == 0.27008858 + assert pytest.approx(availability.data.costs.cpfact, abs=1.0e-8) == 0.00015005 @pytest.mark.parametrize(("i_tf_sup", "exp"), [(1, 6.337618), (0, 4)]) @@ -626,9 +629,9 @@ def test_cp_lifetime(monkeypatch, availability, i_tf_sup, exp): monkeypatch.setattr(tfv, "i_tf_sup", i_tf_sup) monkeypatch.setattr(ctv, "nflutfmax", 1.0e23) monkeypatch.setattr(fwbsv, "neut_flux_cp", 5.0e14) - monkeypatch.setattr(cv, "cpstflnc", 20.0) + monkeypatch.setattr(availability.data.costs, "cpstflnc", 20.0) monkeypatch.setattr(pv, "pflux_fw_neutron_mw", 5.0) - monkeypatch.setattr(cv, "life_plant", 30.0) + monkeypatch.setattr(availability.data.costs, "life_plant", 30.0) cplife = availability.cp_lifetime() @@ -645,9 +648,9 @@ def test_divertor_lifetime(monkeypatch, availability): :type availability: tests.unit.test_availability.availability (functional fixture) """ - monkeypatch.setattr(cv, "adivflnc", 100.0) + monkeypatch.setattr(availability.data.costs, "adivflnc", 100.0) monkeypatch.setattr(dv, "pflux_div_heat_load_mw", 10.0) - monkeypatch.setattr(cv, "life_plant", 30.0) + monkeypatch.setattr(availability.data.costs, "life_plant", 30.0) divlife_obs = availability.divertor_lifetime() divlife_exp = 10.0 diff --git a/tests/unit/models/test_buildings.py b/tests/unit/models/test_buildings.py index 487751d469..ae2d3df63d 100644 --- a/tests/unit/models/test_buildings.py +++ b/tests/unit/models/test_buildings.py @@ -5,7 +5,6 @@ from process.data_structure import ( build_variables, buildings_variables, - cost_variables, current_drive_variables, divertor_variables, fwbs_variables, @@ -13,17 +12,16 @@ physics_variables, tfcoil_variables, ) -from process.models.buildings import Buildings @pytest.fixture -def buildings(): - """Provides Buildings object for testing. +def buildings(process_models): + """Fixture to get the Buildings instance from process_models. :returns buildings: initialised Buildings object :rtype: process.buildings.Buildings """ - return Buildings() + return process_models.buildings class BldgsSizesParam(NamedTuple): @@ -683,9 +681,11 @@ def test_bldgs_sizes(buildings, bldgssizesparam, monkeypatch): monkeypatch.setattr( pfcoil_variables, "r_pf_coil_outer_max", bldgssizesparam.r_pf_coil_outer_max ) - monkeypatch.setattr(cost_variables, "life_plant", bldgssizesparam.life_plant) - monkeypatch.setattr(cost_variables, "cplife", bldgssizesparam.cplife) - monkeypatch.setattr(cost_variables, "life_div_fpy", bldgssizesparam.life_div_fpy) + monkeypatch.setattr(buildings.data.costs, "life_plant", bldgssizesparam.life_plant) + monkeypatch.setattr(buildings.data.costs, "cplife", bldgssizesparam.cplife) + monkeypatch.setattr( + buildings.data.costs, "life_div_fpy", bldgssizesparam.life_div_fpy + ) monkeypatch.setattr( fwbs_variables, "r_cryostat_inboard", bldgssizesparam.r_cryostat_inboard ) diff --git a/tests/unit/models/test_costs_1990.py b/tests/unit/models/test_costs_1990.py index 911ebd76e2..c5a6fad694 100644 --- a/tests/unit/models/test_costs_1990.py +++ b/tests/unit/models/test_costs_1990.py @@ -1,4 +1,4 @@ -"""Unit tests for costs.f90.""" +"""Unit tests for costs.py.""" from typing import Any, NamedTuple @@ -9,7 +9,6 @@ from process.data_structure import ( build_variables, buildings_variables, - cost_variables, current_drive_variables, divertor_variables, first_wall_variables, @@ -28,7 +27,7 @@ @pytest.fixture def costs(process_models): - """Provides Costs object for testing. + """Fixture to get the Costs instance from process_models. :returns: initialised Costs object :rtype: process.costs.Costs @@ -78,14 +77,14 @@ def acc2261_fix(costs, request, monkeypatch): param = request.param # Mock variables used by acc2261() - monkeypatch.setattr(cost_variables, "fkind", 1) - monkeypatch.setattr(cost_variables, "lsa", 1) + 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(fwbs_variables, "p_blkt_nuclear_heat_total_mw", 1558.0) monkeypatch.setattr(fwbs_variables, "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(cost_variables, "c2261", 0) + monkeypatch.setattr(costs.data.costs, "c2261", 0) # Parameterised mocks monkeypatch.setattr( @@ -105,23 +104,23 @@ def test_acc2261(acc2261_fix, costs): # Run acc2261() with the current fixture, # then assert the result (c2261) is the expected one costs.acc2261() - assert cost_variables.c2261 == acc2261_fix + assert costs.data.costs.c2261 == acc2261_fix def test_acc2262(monkeypatch, costs): """Test acc2262().""" # Mock module variables - monkeypatch.setattr(cost_variables, "fkind", 1) - monkeypatch.setattr(cost_variables, "lsa", 4) + 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(cost_variables, "c2262", 0) + monkeypatch.setattr(costs.data.costs, "c2262", 0) costs.acc2262() - assert cost_variables.c2262 == pytest.approx(29.408, abs=0.01) + assert costs.data.costs.c2262 == pytest.approx(29.408, abs=0.01) def test_acc2263(monkeypatch, costs): @@ -130,15 +129,15 @@ def test_acc2263(monkeypatch, costs): :param monkeypatch: Mock fixture :type monkeypatch: object """ - monkeypatch.setattr(cost_variables, "fkind", 1) - monkeypatch.setattr(cost_variables, "lsa", 4) - monkeypatch.setattr(cost_variables, "uccry", 9.3e4) + monkeypatch.setattr(costs.data.costs, "fkind", 1) + 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(cost_variables, "c2263", 0) + monkeypatch.setattr(costs.data.costs, "c2263", 0) costs.acc2263() - assert cost_variables.c2263 == pytest.approx(180.76, abs=0.01) + assert costs.data.costs.c2263 == pytest.approx(180.76, abs=0.01) def test_acc2271(monkeypatch, costs): @@ -147,12 +146,12 @@ def test_acc2271(monkeypatch, costs): :param monkeypatch: Mock fixture :type monkeypatch: object """ - monkeypatch.setattr(cost_variables, "ucf1", 2.23e7) - monkeypatch.setattr(cost_variables, "fkind", 1) - monkeypatch.setattr(cost_variables, "c2271", 0) + monkeypatch.setattr(costs.data.costs, "ucf1", 2.23e7) + monkeypatch.setattr(costs.data.costs, "fkind", 1) + monkeypatch.setattr(costs.data.costs, "c2271", 0) costs.acc2271() - assert cost_variables.c2271 == pytest.approx(22.3, abs=0.01) + assert costs.data.costs.c2271 == pytest.approx(22.3, abs=0.01) def test_acc2272(monkeypatch, costs): @@ -163,11 +162,11 @@ def test_acc2272(monkeypatch, costs): """ monkeypatch.setattr(physics_variables, "rndfuel", 7.158e20) monkeypatch.setattr(physics_variables, "m_fuel_amu", 2.5) - monkeypatch.setattr(cost_variables, "fkind", 1) - monkeypatch.setattr(cost_variables, "c2271", 0) + monkeypatch.setattr(costs.data.costs, "fkind", 1) + monkeypatch.setattr(costs.data.costs, "c2271", 0) costs.acc2272() - assert cost_variables.c2272 == pytest.approx(114.707, abs=0.01) + assert costs.data.costs.c2272 == pytest.approx(114.707, abs=0.01) def acc2273_param(**kwargs): @@ -231,7 +230,7 @@ def acc2273_fix(request, monkeypatch, costs): # Mock result var as negative, as an expected result is 0 # Otherwise could get false positive result - monkeypatch.setattr(cost_variables, "c2273", -1) + monkeypatch.setattr(costs.data.costs, "c2273", -1) # Return the expected result for the given parameter list return param["expected"] @@ -246,7 +245,7 @@ def test_acc2273(acc2273_fix, costs): # Run acc2273() with the current fixture, # then assert the result is the expected one costs.acc2273() - assert cost_variables.c2273 == acc2273_fix + assert costs.data.costs.c2273 == acc2273_fix def test_acc2274(monkeypatch, costs): @@ -257,11 +256,11 @@ def test_acc2274(monkeypatch, costs): """ monkeypatch.setattr(data_structure.buildings_variables, "wsvol", 132304.1) monkeypatch.setattr(data_structure.buildings_variables, "volrci", 1299783.4) - monkeypatch.setattr(cost_variables, "fkind", 1) - monkeypatch.setattr(cost_variables, "c2274", 0) + monkeypatch.setattr(costs.data.costs, "fkind", 1) + monkeypatch.setattr(costs.data.costs, "c2274", 0) costs.acc2274() - assert cost_variables.c2274 == pytest.approx(84.10, abs=0.01) + assert costs.data.costs.c2274 == pytest.approx(84.10, abs=0.01) def acc228_param(**kwargs): @@ -307,8 +306,8 @@ def acc228_fix(request, monkeypatch, costs): # Mock variables used by acc228() # Some may be parameterised - monkeypatch.setattr(cost_variables, "fkind", param["fkind"]) - monkeypatch.setattr(cost_variables, "c228", 0) + monkeypatch.setattr(costs.data.costs, "fkind", param["fkind"]) + monkeypatch.setattr(costs.data.costs, "c228", 0) # Return the expected result for the given parameter list return param["expected"] @@ -323,7 +322,7 @@ def test_acc228(acc228_fix, costs): # Run acc228() with the current fixture, # then assert the result is the expected one costs.acc228() - assert cost_variables.c228 == acc228_fix + assert costs.data.costs.c228 == acc228_fix def acc229_param(**kwargs): @@ -369,8 +368,8 @@ def acc229_fix(request, monkeypatch, costs): # Mock variables used by acc229() # Some may be parameterised - monkeypatch.setattr(cost_variables, "fkind", param["fkind"]) - monkeypatch.setattr(cost_variables, "c229", 0) + monkeypatch.setattr(costs.data.costs, "fkind", param["fkind"]) + monkeypatch.setattr(costs.data.costs, "c229", 0) # Return the expected result for the given parameter list return param["expected"] @@ -385,7 +384,7 @@ def test_acc229(acc229_fix, costs): # Run acc229() with the current fixture, # then assert the result is the expected one costs.acc229() - assert cost_variables.c229 == acc229_fix + assert costs.data.costs.c229 == acc229_fix def acc23_param(**kwargs): @@ -435,7 +434,7 @@ def acc23_fix(request, monkeypatch, costs): fwbs_variables, "i_blkt_coolant_type", param["i_blkt_coolant_type"] ) monkeypatch.setattr(heat_transport_variables, "p_plant_electric_gross_mw", 1200.0) - monkeypatch.setattr(cost_variables, "c23", 0) + monkeypatch.setattr(costs.data.costs, "c23", 0) # Return the expected result for the given parameter list return param["expected"] @@ -450,7 +449,7 @@ def test_acc23(acc23_fix, costs): # Run acc23() with the current fixture, # then assert the result is the expected one costs.acc23() - assert cost_variables.c23 == acc23_fix + assert costs.data.costs.c23 == acc23_fix def test_acc241(monkeypatch, costs): @@ -459,11 +458,11 @@ def test_acc241(monkeypatch, costs): :param monkeypatch: Mock fixture :type monkeypatch: object """ - monkeypatch.setattr(cost_variables, "lsa", 4) - monkeypatch.setattr(cost_variables, "c241", 0) + monkeypatch.setattr(costs.data.costs, "lsa", 4) + monkeypatch.setattr(costs.data.costs, "c241", 0) costs.acc241() - assert cost_variables.c241 == pytest.approx(18.4, abs=0.01) + assert costs.data.costs.c241 == pytest.approx(18.4, abs=0.01) def test_acc242(monkeypatch, costs): @@ -472,13 +471,13 @@ def test_acc242(monkeypatch, costs): :param monkeypatch: Mock fixture :type monkeypatch: object """ - monkeypatch.setattr(cost_variables, "lsa", 4) + 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(cost_variables, "c242", 0) + monkeypatch.setattr(costs.data.costs, "c242", 0) costs.acc242() - assert cost_variables.c242 == pytest.approx(9.06, abs=0.01) + assert costs.data.costs.c242 == pytest.approx(9.06, abs=0.01) def test_acc243(monkeypatch, costs): @@ -487,12 +486,12 @@ def test_acc243(monkeypatch, costs): :param monkeypatch: Mock fixture :type monkeypatch: object """ - monkeypatch.setattr(cost_variables, "lsa", 4) + monkeypatch.setattr(costs.data.costs, "lsa", 4) monkeypatch.setattr(heat_transport_variables, "tlvpmw", 403.8) - monkeypatch.setattr(cost_variables, "c243", 0) + monkeypatch.setattr(costs.data.costs, "c243", 0) costs.acc243() - assert cost_variables.c243 == pytest.approx(8.08, abs=0.01) + assert costs.data.costs.c243 == pytest.approx(8.08, abs=0.01) def test_acc244(monkeypatch, costs): @@ -501,11 +500,11 @@ def test_acc244(monkeypatch, costs): :param monkeypatch: Mock fixture :type monkeypatch: object """ - monkeypatch.setattr(cost_variables, "lsa", 4) - monkeypatch.setattr(cost_variables, "c244", 0) + monkeypatch.setattr(costs.data.costs, "lsa", 4) + monkeypatch.setattr(costs.data.costs, "c244", 0) costs.acc244() - assert cost_variables.c244 == pytest.approx(6.80, abs=0.01) + assert costs.data.costs.c244 == pytest.approx(6.80, abs=0.01) def test_acc245(monkeypatch, costs): @@ -514,11 +513,11 @@ def test_acc245(monkeypatch, costs): :param monkeypatch: Mock fixture :type monkeypatch: object """ - monkeypatch.setattr(cost_variables, "lsa", 4) - monkeypatch.setattr(cost_variables, "c245", 0) + monkeypatch.setattr(costs.data.costs, "lsa", 4) + monkeypatch.setattr(costs.data.costs, "c245", 0) costs.acc245() - assert cost_variables.c245 == pytest.approx(1.5, abs=0.01) + assert costs.data.costs.c245 == pytest.approx(1.5, abs=0.01) def acc25_param(**kwargs): @@ -561,9 +560,9 @@ def acc25_fix(request, monkeypatch, costs): # Mock variables used by acc25() # Some may be parameterised - monkeypatch.setattr(cost_variables, "ucmisc", 2.5e7) - monkeypatch.setattr(cost_variables, "lsa", param["lsa"]) - monkeypatch.setattr(cost_variables, "c25", 0) + monkeypatch.setattr(costs.data.costs, "ucmisc", 2.5e7) + monkeypatch.setattr(costs.data.costs, "lsa", param["lsa"]) + monkeypatch.setattr(costs.data.costs, "c25", 0) # Return the expected result for the given parameter list return param["expected"] @@ -578,7 +577,7 @@ def test_acc25(acc25_fix, costs): # Run acc25() with the current fixture, # then assert the result is the expected one costs.acc25() - assert cost_variables.c25 == acc25_fix + assert costs.data.costs.c25 == acc25_fix def acc26_param(**kwargs): @@ -639,8 +638,8 @@ def acc26_fix(request, monkeypatch, costs): # Mock variables used by acc26() # Some may be parameterised - monkeypatch.setattr(cost_variables, "lsa", 4) - monkeypatch.setattr(cost_variables, "ireactor", param["ireactor"]) + monkeypatch.setattr(costs.data.costs, "lsa", 4) + monkeypatch.setattr(costs.data.costs, "ireactor", param["ireactor"]) monkeypatch.setattr( physics_variables, "p_fusion_total_mw", @@ -662,7 +661,7 @@ def acc26_fix(request, monkeypatch, costs): "p_plant_electric_gross_mw", param["p_plant_electric_gross_mw"], ) - monkeypatch.setattr(cost_variables, "c26", 0) + monkeypatch.setattr(costs.data.costs, "c26", 0) # Return the expected result for the given parameter list return param["expected"] @@ -677,7 +676,7 @@ def test_acc26(acc26_fix, costs): # Run acc26() with the current fixture, # then assert the result is the expected one costs.acc26() - assert cost_variables.c26 == acc26_fix + assert costs.data.costs.c26 == acc26_fix def test_acc9(monkeypatch, costs): @@ -686,15 +685,15 @@ def test_acc9(monkeypatch, costs): :param monkeypatch: Mock fixture :type monkeypatch: object """ - monkeypatch.setattr(cost_variables, "lsa", 4) - monkeypatch.setattr(cost_variables, "cdirt", 30e3) - monkeypatch.setattr(cost_variables, "cowner", 0.15) - monkeypatch.setattr(cost_variables, "fcontng", 0.195) - monkeypatch.setattr(cost_variables, "cindrt", 0) + monkeypatch.setattr(costs.data.costs, "lsa", 4) + monkeypatch.setattr(costs.data.costs, "cdirt", 30e3) + monkeypatch.setattr(costs.data.costs, "cowner", 0.15) + monkeypatch.setattr(costs.data.costs, "fcontng", 0.195) + monkeypatch.setattr(costs.data.costs, "cindrt", 0) costs.acc9() - assert cost_variables.cindrt == pytest.approx(10005.0, abs=0.1) - assert cost_variables.ccont == pytest.approx(7800.98, abs=0.1) + assert costs.data.costs.cindrt == pytest.approx(10005.0, abs=0.1) + assert costs.data.costs.ccont == pytest.approx(7800.98, abs=0.1) class Acc21Param(NamedTuple): @@ -911,75 +910,75 @@ def test_acc21(acc21param, monkeypatch, costs): monkeypatch.setattr(buildings_variables, "wsvol", acc21param.wsvol) - monkeypatch.setattr(cost_variables, "ucrb", acc21param.ucrb) + monkeypatch.setattr(costs.data.costs, "ucrb", acc21param.ucrb) - monkeypatch.setattr(cost_variables, "ireactor", acc21param.ireactor) + monkeypatch.setattr(costs.data.costs, "ireactor", acc21param.ireactor) - monkeypatch.setattr(cost_variables, "cturbb", acc21param.cturbb) + monkeypatch.setattr(costs.data.costs, "cturbb", acc21param.cturbb) - monkeypatch.setattr(cost_variables, "lsa", acc21param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc21param.lsa) - monkeypatch.setattr(cost_variables, "csi", acc21param.csi) + monkeypatch.setattr(costs.data.costs, "csi", acc21param.csi) - monkeypatch.setattr(cost_variables, "cland", acc21param.cland) + monkeypatch.setattr(costs.data.costs, "cland", acc21param.cland) - monkeypatch.setattr(cost_variables, "c21", acc21param.c21) + monkeypatch.setattr(costs.data.costs, "c21", acc21param.c21) - monkeypatch.setattr(cost_variables, "c211", acc21param.c211) + monkeypatch.setattr(costs.data.costs, "c211", acc21param.c211) - monkeypatch.setattr(cost_variables, "c212", acc21param.c212) + monkeypatch.setattr(costs.data.costs, "c212", acc21param.c212) - monkeypatch.setattr(cost_variables, "c213", acc21param.c213) + monkeypatch.setattr(costs.data.costs, "c213", acc21param.c213) - monkeypatch.setattr(cost_variables, "c214", acc21param.c214) + monkeypatch.setattr(costs.data.costs, "c214", acc21param.c214) - monkeypatch.setattr(cost_variables, "c2141", acc21param.c2141) + monkeypatch.setattr(costs.data.costs, "c2141", acc21param.c2141) - monkeypatch.setattr(cost_variables, "c2142", acc21param.c2142) + monkeypatch.setattr(costs.data.costs, "c2142", acc21param.c2142) - monkeypatch.setattr(cost_variables, "c215", acc21param.c215) + monkeypatch.setattr(costs.data.costs, "c215", acc21param.c215) - monkeypatch.setattr(cost_variables, "c216", acc21param.c216) + monkeypatch.setattr(costs.data.costs, "c216", acc21param.c216) - monkeypatch.setattr(cost_variables, "c217", acc21param.c217) + monkeypatch.setattr(costs.data.costs, "c217", acc21param.c217) - monkeypatch.setattr(cost_variables, "c2171", acc21param.c2171) + monkeypatch.setattr(costs.data.costs, "c2171", acc21param.c2171) - monkeypatch.setattr(cost_variables, "c2172", acc21param.c2172) + monkeypatch.setattr(costs.data.costs, "c2172", acc21param.c2172) - monkeypatch.setattr(cost_variables, "c2173", acc21param.c2173) + monkeypatch.setattr(costs.data.costs, "c2173", acc21param.c2173) - monkeypatch.setattr(cost_variables, "c2174", acc21param.c2174) + monkeypatch.setattr(costs.data.costs, "c2174", acc21param.c2174) costs.acc21() - assert cost_variables.c21 == pytest.approx(acc21param.expected_c21) + assert costs.data.costs.c21 == pytest.approx(acc21param.expected_c21) - assert cost_variables.c211 == pytest.approx(acc21param.expected_c211) + assert costs.data.costs.c211 == pytest.approx(acc21param.expected_c211) - assert cost_variables.c212 == pytest.approx(acc21param.expected_c212) + assert costs.data.costs.c212 == pytest.approx(acc21param.expected_c212) - assert cost_variables.c213 == pytest.approx(acc21param.expected_c213) + assert costs.data.costs.c213 == pytest.approx(acc21param.expected_c213) - assert cost_variables.c214 == pytest.approx(acc21param.expected_c214) + assert costs.data.costs.c214 == pytest.approx(acc21param.expected_c214) - assert cost_variables.c2141 == pytest.approx(acc21param.expected_c2141) + assert costs.data.costs.c2141 == pytest.approx(acc21param.expected_c2141) - assert cost_variables.c2142 == pytest.approx(acc21param.expected_c2142) + assert costs.data.costs.c2142 == pytest.approx(acc21param.expected_c2142) - assert cost_variables.c215 == pytest.approx(acc21param.expected_c215) + assert costs.data.costs.c215 == pytest.approx(acc21param.expected_c215) - assert cost_variables.c216 == pytest.approx(acc21param.expected_c216) + assert costs.data.costs.c216 == pytest.approx(acc21param.expected_c216) - assert cost_variables.c217 == pytest.approx(acc21param.expected_c217) + assert costs.data.costs.c217 == pytest.approx(acc21param.expected_c217) - assert cost_variables.c2171 == pytest.approx(acc21param.expected_c2171) + assert costs.data.costs.c2171 == pytest.approx(acc21param.expected_c2171) - assert cost_variables.c2172 == pytest.approx(acc21param.expected_c2172) + assert costs.data.costs.c2172 == pytest.approx(acc21param.expected_c2172) - assert cost_variables.c2173 == pytest.approx(acc21param.expected_c2173) + assert costs.data.costs.c2173 == pytest.approx(acc21param.expected_c2173) - assert cost_variables.c2174 == pytest.approx(acc21param.expected_c2174) + assert costs.data.costs.c2174 == pytest.approx(acc21param.expected_c2174) class Acc2211Param(NamedTuple): @@ -1090,17 +1089,17 @@ def test_acc2211(acc2211param, monkeypatch, costs): monkeypatch.setattr(first_wall_variables, "a_fw_total", acc2211param.a_fw_total) - monkeypatch.setattr(cost_variables, "ucblss", acc2211param.ucblss) + monkeypatch.setattr(costs.data.costs, "ucblss", acc2211param.ucblss) - monkeypatch.setattr(cost_variables, "fkind", acc2211param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2211param.fkind) - monkeypatch.setattr(cost_variables, "fwallcst", acc2211param.fwallcst) + monkeypatch.setattr(costs.data.costs, "fwallcst", acc2211param.fwallcst) - monkeypatch.setattr(cost_variables, "ucblli2o", acc2211param.ucblli2o) + monkeypatch.setattr(costs.data.costs, "ucblli2o", acc2211param.ucblli2o) - monkeypatch.setattr(cost_variables, "ifueltyp", acc2211param.ifueltyp) + monkeypatch.setattr(costs.data.costs, "ifueltyp", acc2211param.ifueltyp) - monkeypatch.setattr(cost_variables, "lsa", acc2211param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc2211param.lsa) monkeypatch.setattr(ife_variables, "fwmatm", acc2211param.fwmatm) @@ -1110,13 +1109,13 @@ def test_acc2211(acc2211param, monkeypatch, costs): monkeypatch.setattr(ife_variables, "ucconc", acc2211param.ucconc) - monkeypatch.setattr(cost_variables, "c22", acc2211param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2211param.c22) - monkeypatch.setattr(cost_variables, "c2211", acc2211param.c2211) + monkeypatch.setattr(costs.data.costs, "c2211", acc2211param.c2211) costs.acc2211() - assert cost_variables.fwallcst == pytest.approx(acc2211param.expected_fwallcst) + assert costs.data.costs.fwallcst == pytest.approx(acc2211param.expected_fwallcst) class Acc2212Param(NamedTuple): @@ -1325,27 +1324,27 @@ def test_acc2212(acc2212param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ucblss", acc2212param.ucblss) + monkeypatch.setattr(costs.data.costs, "ucblss", acc2212param.ucblss) - monkeypatch.setattr(cost_variables, "ucblbreed", acc2212param.ucblbreed) + monkeypatch.setattr(costs.data.costs, "ucblbreed", acc2212param.ucblbreed) - monkeypatch.setattr(cost_variables, "ucblbe", acc2212param.ucblbe) + monkeypatch.setattr(costs.data.costs, "ucblbe", acc2212param.ucblbe) - monkeypatch.setattr(cost_variables, "ucblli", acc2212param.ucblli) + monkeypatch.setattr(costs.data.costs, "ucblli", acc2212param.ucblli) - monkeypatch.setattr(cost_variables, "ucblvd", acc2212param.ucblvd) + monkeypatch.setattr(costs.data.costs, "ucblvd", acc2212param.ucblvd) - monkeypatch.setattr(cost_variables, "ucblli2o", acc2212param.ucblli2o) + monkeypatch.setattr(costs.data.costs, "ucblli2o", acc2212param.ucblli2o) - monkeypatch.setattr(cost_variables, "blkcst", acc2212param.blkcst) + monkeypatch.setattr(costs.data.costs, "blkcst", acc2212param.blkcst) - monkeypatch.setattr(cost_variables, "ucbllipb", acc2212param.ucbllipb) + monkeypatch.setattr(costs.data.costs, "ucbllipb", acc2212param.ucbllipb) - monkeypatch.setattr(cost_variables, "ifueltyp", acc2212param.ifueltyp) + monkeypatch.setattr(costs.data.costs, "ifueltyp", acc2212param.ifueltyp) - monkeypatch.setattr(cost_variables, "lsa", acc2212param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc2212param.lsa) - monkeypatch.setattr(cost_variables, "fkind", acc2212param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2212param.fkind) monkeypatch.setattr(fwbs_variables, "i_blanket_type", acc2212param.i_blanket_type) @@ -1379,35 +1378,35 @@ def test_acc2212(acc2212param, monkeypatch, costs): monkeypatch.setattr(ife_variables, "uccarb", acc2212param.uccarb) - monkeypatch.setattr(cost_variables, "c22", acc2212param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2212param.c22) - monkeypatch.setattr(cost_variables, "c2212", acc2212param.c2212) + monkeypatch.setattr(costs.data.costs, "c2212", acc2212param.c2212) - monkeypatch.setattr(cost_variables, "c22121", acc2212param.c22121) + monkeypatch.setattr(costs.data.costs, "c22121", acc2212param.c22121) - monkeypatch.setattr(cost_variables, "c22122", acc2212param.c22122) + monkeypatch.setattr(costs.data.costs, "c22122", acc2212param.c22122) - monkeypatch.setattr(cost_variables, "c22123", acc2212param.c22123) + monkeypatch.setattr(costs.data.costs, "c22123", acc2212param.c22123) - monkeypatch.setattr(cost_variables, "c22124", acc2212param.c22124) + monkeypatch.setattr(costs.data.costs, "c22124", acc2212param.c22124) - monkeypatch.setattr(cost_variables, "c22125", acc2212param.c22125) + monkeypatch.setattr(costs.data.costs, "c22125", acc2212param.c22125) - monkeypatch.setattr(cost_variables, "c22126", acc2212param.c22126) + monkeypatch.setattr(costs.data.costs, "c22126", acc2212param.c22126) - monkeypatch.setattr(cost_variables, "c22127", acc2212param.c22127) + monkeypatch.setattr(costs.data.costs, "c22127", acc2212param.c22127) - monkeypatch.setattr(cost_variables, "c22128", acc2212param.c22128) + monkeypatch.setattr(costs.data.costs, "c22128", acc2212param.c22128) costs.acc2212() - assert cost_variables.blkcst == pytest.approx(acc2212param.expected_blkcst) + assert costs.data.costs.blkcst == pytest.approx(acc2212param.expected_blkcst) - assert cost_variables.c22121 == pytest.approx(acc2212param.expected_c22121) + assert costs.data.costs.c22121 == pytest.approx(acc2212param.expected_c22121) - assert cost_variables.c22122 == pytest.approx(acc2212param.expected_c22122) + assert costs.data.costs.c22122 == pytest.approx(acc2212param.expected_c22122) - assert cost_variables.c22123 == pytest.approx(acc2212param.expected_c22123) + assert costs.data.costs.c22123 == pytest.approx(acc2212param.expected_c22123) class Acc2213Param(NamedTuple): @@ -1532,15 +1531,15 @@ def test_acc2213(acc2213param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ucpens", acc2213param.ucpens) + monkeypatch.setattr(costs.data.costs, "ucpens", acc2213param.ucpens) - monkeypatch.setattr(cost_variables, "ucshld", acc2213param.ucshld) + monkeypatch.setattr(costs.data.costs, "ucshld", acc2213param.ucshld) - monkeypatch.setattr(cost_variables, "fkind", acc2213param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2213param.fkind) - monkeypatch.setattr(cost_variables, "ucblli2o", acc2213param.ucblli2o) + monkeypatch.setattr(costs.data.costs, "ucblli2o", acc2213param.ucblli2o) - monkeypatch.setattr(cost_variables, "lsa", acc2213param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc2213param.lsa) monkeypatch.setattr(fwbs_variables, "wpenshld", acc2213param.wpenshld) @@ -1554,21 +1553,21 @@ def test_acc2213(acc2213param, monkeypatch, costs): monkeypatch.setattr(ife_variables, "ucconc", acc2213param.ucconc) - monkeypatch.setattr(cost_variables, "c22", acc2213param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2213param.c22) - monkeypatch.setattr(cost_variables, "c2213", acc2213param.c2213) + monkeypatch.setattr(costs.data.costs, "c2213", acc2213param.c2213) - monkeypatch.setattr(cost_variables, "c22131", acc2213param.c22131) + monkeypatch.setattr(costs.data.costs, "c22131", acc2213param.c22131) - monkeypatch.setattr(cost_variables, "c22132", acc2213param.c22132) + monkeypatch.setattr(costs.data.costs, "c22132", acc2213param.c22132) costs.acc2213() - assert cost_variables.c2213 == pytest.approx(acc2213param.expected_c2213) + assert costs.data.costs.c2213 == pytest.approx(acc2213param.expected_c2213) - assert cost_variables.c22131 == pytest.approx(acc2213param.expected_c22131) + assert costs.data.costs.c22131 == pytest.approx(acc2213param.expected_c22131) - assert cost_variables.c22132 == pytest.approx(acc2213param.expected_c22132) + assert costs.data.costs.c22132 == pytest.approx(acc2213param.expected_c22132) class Acc2214Param(NamedTuple): @@ -1619,19 +1618,19 @@ def test_acc2214(acc2214param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "fkind", acc2214param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2214param.fkind) - monkeypatch.setattr(cost_variables, "lsa", acc2214param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc2214param.lsa) monkeypatch.setattr(structure_variables, "gsmass", acc2214param.gsmass) - monkeypatch.setattr(cost_variables, "c22", acc2214param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2214param.c22) - monkeypatch.setattr(cost_variables, "c2214", acc2214param.c2214) + monkeypatch.setattr(costs.data.costs, "c2214", acc2214param.c2214) costs.acc2214() - assert cost_variables.c2214 == pytest.approx(acc2214param.expected_c2214) + assert costs.data.costs.c2214 == pytest.approx(acc2214param.expected_c2214) class Acc2215Param(NamedTuple): @@ -1694,13 +1693,13 @@ def test_acc2215(acc2215param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ifueltyp", acc2215param.ifueltyp) + monkeypatch.setattr(costs.data.costs, "ifueltyp", acc2215param.ifueltyp) - monkeypatch.setattr(cost_variables, "divcst", acc2215param.divcst) + monkeypatch.setattr(costs.data.costs, "divcst", acc2215param.divcst) - monkeypatch.setattr(cost_variables, "fkind", acc2215param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2215param.fkind) - monkeypatch.setattr(cost_variables, "ucdiv", acc2215param.ucdiv) + monkeypatch.setattr(costs.data.costs, "ucdiv", acc2215param.ucdiv) monkeypatch.setattr( divertor_variables, "a_div_surface_total", acc2215param.a_div_surface_total @@ -1708,13 +1707,13 @@ def test_acc2215(acc2215param, monkeypatch, costs): monkeypatch.setattr(ife_variables, "ife", acc2215param.ife) - monkeypatch.setattr(cost_variables, "c22", acc2215param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2215param.c22) - monkeypatch.setattr(cost_variables, "c2215", acc2215param.c2215) + monkeypatch.setattr(costs.data.costs, "c2215", acc2215param.c2215) costs.acc2215() - assert cost_variables.divcst == pytest.approx(acc2215param.expected_divcst) + assert costs.data.costs.divcst == pytest.approx(acc2215param.expected_divcst) class Acc2221Param(NamedTuple): @@ -1932,29 +1931,29 @@ def test_acc2221(acc2221param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "uccpclb", acc2221param.uccpclb) + monkeypatch.setattr(costs.data.costs, "uccpclb", acc2221param.uccpclb) - monkeypatch.setattr(cost_variables, "uccase", acc2221param.uccase) + monkeypatch.setattr(costs.data.costs, "uccase", acc2221param.uccase) - monkeypatch.setattr(cost_variables, "uccu", acc2221param.uccu) + monkeypatch.setattr(costs.data.costs, "uccu", acc2221param.uccu) - monkeypatch.setattr(cost_variables, "fkind", acc2221param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2221param.fkind) - monkeypatch.setattr(cost_variables, "cconshtf", acc2221param.cconshtf) + monkeypatch.setattr(costs.data.costs, "cconshtf", acc2221param.cconshtf) - monkeypatch.setattr(cost_variables, "ucsc", acc2221param.ucsc) + monkeypatch.setattr(costs.data.costs, "ucsc", acc2221param.ucsc) - monkeypatch.setattr(cost_variables, "ifueltyp", acc2221param.ifueltyp) + monkeypatch.setattr(costs.data.costs, "ifueltyp", acc2221param.ifueltyp) - monkeypatch.setattr(cost_variables, "uccpcl1", acc2221param.uccpcl1) + monkeypatch.setattr(costs.data.costs, "uccpcl1", acc2221param.uccpcl1) - monkeypatch.setattr(cost_variables, "ucwindtf", acc2221param.ucwindtf) + monkeypatch.setattr(costs.data.costs, "ucwindtf", acc2221param.ucwindtf) - monkeypatch.setattr(cost_variables, "cpstcst", acc2221param.cpstcst) + monkeypatch.setattr(costs.data.costs, "cpstcst", acc2221param.cpstcst) - monkeypatch.setattr(cost_variables, "lsa", acc2221param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc2221param.lsa) - monkeypatch.setattr(cost_variables, "cconfix", acc2221param.cconfix) + monkeypatch.setattr(costs.data.costs, "cconfix", acc2221param.cconfix) monkeypatch.setattr(physics_variables, "itart", acc2221param.itart) @@ -1983,7 +1982,7 @@ def test_acc2221(acc2221param, monkeypatch, costs): monkeypatch.setattr(tfcoil_variables, "i_tf_sup", acc2221param.i_tf_sup) monkeypatch.setattr( - cost_variables, "supercond_cost_model", acc2221param.supercond_cost_model + costs.data.costs, "supercond_cost_model", acc2221param.supercond_cost_model ) monkeypatch.setattr(tfcoil_variables, "j_crit_str_tf", acc2221param.j_crit_str_tf) @@ -1996,25 +1995,25 @@ def test_acc2221(acc2221param, monkeypatch, costs): monkeypatch.setattr(tfcoil_variables, "i_tf_sc_mat", acc2221param.i_tf_sc_mat) - monkeypatch.setattr(cost_variables, "c22", acc2221param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2221param.c22) - monkeypatch.setattr(cost_variables, "c2221", acc2221param.c2221) + monkeypatch.setattr(costs.data.costs, "c2221", acc2221param.c2221) - monkeypatch.setattr(cost_variables, "c22211", acc2221param.c22211) + monkeypatch.setattr(costs.data.costs, "c22211", acc2221param.c22211) - monkeypatch.setattr(cost_variables, "c22212", acc2221param.c22212) + monkeypatch.setattr(costs.data.costs, "c22212", acc2221param.c22212) - monkeypatch.setattr(cost_variables, "c22213", acc2221param.c22213) + monkeypatch.setattr(costs.data.costs, "c22213", acc2221param.c22213) - monkeypatch.setattr(cost_variables, "c22214", acc2221param.c22214) + monkeypatch.setattr(costs.data.costs, "c22214", acc2221param.c22214) - monkeypatch.setattr(cost_variables, "c22215", acc2221param.c22215) + monkeypatch.setattr(costs.data.costs, "c22215", acc2221param.c22215) costs.acc2221() - assert cost_variables.c22211 == pytest.approx(acc2221param.expected_c22211) + assert costs.data.costs.c22211 == pytest.approx(acc2221param.expected_c22211) - assert cost_variables.c22212 == pytest.approx(acc2221param.expected_c22212) + assert costs.data.costs.c22212 == pytest.approx(acc2221param.expected_c22212) class Acc2222Param(NamedTuple): @@ -2707,30 +2706,30 @@ def test_acc2222(acc2222param, monkeypatch, costs): monkeypatch.setattr(build_variables, "iohcl", acc2222param.iohcl) - monkeypatch.setattr(cost_variables, "uccase", acc2222param.uccase) + monkeypatch.setattr(costs.data.costs, "uccase", acc2222param.uccase) - monkeypatch.setattr(cost_variables, "uccu", acc2222param.uccu) + monkeypatch.setattr(costs.data.costs, "uccu", acc2222param.uccu) - monkeypatch.setattr(cost_variables, "cconshpf", acc2222param.cconshpf) + monkeypatch.setattr(costs.data.costs, "cconshpf", acc2222param.cconshpf) - monkeypatch.setattr(cost_variables, "ucfnc", acc2222param.ucfnc) + monkeypatch.setattr(costs.data.costs, "ucfnc", acc2222param.ucfnc) - monkeypatch.setattr(cost_variables, "cconfix", acc2222param.cconfix) + monkeypatch.setattr(costs.data.costs, "cconfix", acc2222param.cconfix) - monkeypatch.setattr(cost_variables, "ucsc", acc2222param.ucsc) + monkeypatch.setattr(costs.data.costs, "ucsc", acc2222param.ucsc) - monkeypatch.setattr(cost_variables, "ucwindpf", acc2222param.ucwindpf) + monkeypatch.setattr(costs.data.costs, "ucwindpf", acc2222param.ucwindpf) - monkeypatch.setattr(cost_variables, "lsa", acc2222param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc2222param.lsa) - monkeypatch.setattr(cost_variables, "fkind", acc2222param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2222param.fkind) monkeypatch.setattr( pfcoil_variables, "j_pf_coil_wp_peak", acc2222param.j_pf_coil_wp_peak ) monkeypatch.setattr( - cost_variables, "supercond_cost_model", acc2222param.supercond_cost_model + costs.data.costs, "supercond_cost_model", acc2222param.supercond_cost_model ) monkeypatch.setattr(pfcoil_variables, "j_crit_str_cs", acc2222param.j_crit_str_cs) @@ -2783,29 +2782,29 @@ def test_acc2222(acc2222param, monkeypatch, costs): monkeypatch.setattr(tfcoil_variables, "dcond", acc2222param.dcond) - monkeypatch.setattr(cost_variables, "c22", acc2222param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2222param.c22) - monkeypatch.setattr(cost_variables, "c2222", acc2222param.c2222) + monkeypatch.setattr(costs.data.costs, "c2222", acc2222param.c2222) - monkeypatch.setattr(cost_variables, "c22221", acc2222param.c22221) + monkeypatch.setattr(costs.data.costs, "c22221", acc2222param.c22221) - monkeypatch.setattr(cost_variables, "c22222", acc2222param.c22222) + monkeypatch.setattr(costs.data.costs, "c22222", acc2222param.c22222) - monkeypatch.setattr(cost_variables, "c22223", acc2222param.c22223) + monkeypatch.setattr(costs.data.costs, "c22223", acc2222param.c22223) - monkeypatch.setattr(cost_variables, "c22224", acc2222param.c22224) + monkeypatch.setattr(costs.data.costs, "c22224", acc2222param.c22224) costs.acc2222() - assert cost_variables.c2222 == pytest.approx(acc2222param.expected_c2222) + assert costs.data.costs.c2222 == pytest.approx(acc2222param.expected_c2222) - assert cost_variables.c22221 == pytest.approx(acc2222param.expected_c22221) + assert costs.data.costs.c22221 == pytest.approx(acc2222param.expected_c22221) - assert cost_variables.c22222 == pytest.approx(acc2222param.expected_c22222) + assert costs.data.costs.c22222 == pytest.approx(acc2222param.expected_c22222) - assert cost_variables.c22223 == pytest.approx(acc2222param.expected_c22223) + assert costs.data.costs.c22223 == pytest.approx(acc2222param.expected_c22223) - assert cost_variables.c22224 == pytest.approx(acc2222param.expected_c22224) + assert costs.data.costs.c22224 == pytest.approx(acc2222param.expected_c22224) class Acc2223Param(NamedTuple): @@ -2860,21 +2859,21 @@ def test_acc2223(acc2223param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "uccryo", acc2223param.uccryo) + monkeypatch.setattr(costs.data.costs, "uccryo", acc2223param.uccryo) - monkeypatch.setattr(cost_variables, "lsa", acc2223param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc2223param.lsa) - monkeypatch.setattr(cost_variables, "fkind", acc2223param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2223param.fkind) monkeypatch.setattr(fwbs_variables, "m_vv", acc2223param.m_vv) - monkeypatch.setattr(cost_variables, "c22", acc2223param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2223param.c22) - monkeypatch.setattr(cost_variables, "c2223", acc2223param.c2223) + monkeypatch.setattr(costs.data.costs, "c2223", acc2223param.c2223) costs.acc2223() - assert cost_variables.c2223 == pytest.approx(acc2223param.expected_c2223) + assert costs.data.costs.c2223 == pytest.approx(acc2223param.expected_c2223) class Acc223Param(NamedTuple): @@ -3033,21 +3032,21 @@ def test_acc223(acc223param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ucich", acc223param.ucich) + monkeypatch.setattr(costs.data.costs, "ucich", acc223param.ucich) - monkeypatch.setattr(cost_variables, "fkind", acc223param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc223param.fkind) - monkeypatch.setattr(cost_variables, "ucnbi", acc223param.ucnbi) + monkeypatch.setattr(costs.data.costs, "ucnbi", acc223param.ucnbi) - monkeypatch.setattr(cost_variables, "ucech", acc223param.ucech) + monkeypatch.setattr(costs.data.costs, "ucech", acc223param.ucech) - monkeypatch.setattr(cost_variables, "uclh", acc223param.uclh) + monkeypatch.setattr(costs.data.costs, "uclh", acc223param.uclh) - monkeypatch.setattr(cost_variables, "ifueltyp", acc223param.ifueltyp) + monkeypatch.setattr(costs.data.costs, "ifueltyp", acc223param.ifueltyp) - monkeypatch.setattr(cost_variables, "cdcost", acc223param.cdcost) + monkeypatch.setattr(costs.data.costs, "cdcost", acc223param.cdcost) - monkeypatch.setattr(cost_variables, "fcdfuel", acc223param.fcdfuel) + monkeypatch.setattr(costs.data.costs, "fcdfuel", acc223param.fcdfuel) monkeypatch.setattr( current_drive_variables, @@ -3093,25 +3092,25 @@ def test_acc223(acc223param, monkeypatch, costs): monkeypatch.setattr(ife_variables, "cdriv0", acc223param.cdriv0) - monkeypatch.setattr(cost_variables, "c22", acc223param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc223param.c22) - monkeypatch.setattr(cost_variables, "c223", acc223param.c223) + monkeypatch.setattr(costs.data.costs, "c223", acc223param.c223) - monkeypatch.setattr(cost_variables, "c2231", acc223param.c2231) + monkeypatch.setattr(costs.data.costs, "c2231", acc223param.c2231) - monkeypatch.setattr(cost_variables, "c2232", acc223param.c2232) + monkeypatch.setattr(costs.data.costs, "c2232", acc223param.c2232) - monkeypatch.setattr(cost_variables, "c2233", acc223param.c2233) + monkeypatch.setattr(costs.data.costs, "c2233", acc223param.c2233) - monkeypatch.setattr(cost_variables, "c2234", acc223param.c2234) + monkeypatch.setattr(costs.data.costs, "c2234", acc223param.c2234) costs.acc223() - assert cost_variables.cdcost == pytest.approx(acc223param.expected_cdcost) + assert costs.data.costs.cdcost == pytest.approx(acc223param.expected_cdcost) - assert cost_variables.c223 == pytest.approx(acc223param.expected_c223) + assert costs.data.costs.c223 == pytest.approx(acc223param.expected_c223) - assert cost_variables.c2231 == pytest.approx(acc223param.expected_c2231) + assert costs.data.costs.c2231 == pytest.approx(acc223param.expected_c2231) class Acc224Param(NamedTuple): @@ -3222,7 +3221,7 @@ def test_acc224(acc224param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "fkind", acc224param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc224param.fkind) monkeypatch.setattr( costs.data.vacuum, @@ -3260,35 +3259,35 @@ def test_acc224(acc224param, monkeypatch, costs): acc224param.n_vv_vacuum_ducts, ) - monkeypatch.setattr(cost_variables, "c22", acc224param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc224param.c22) - monkeypatch.setattr(cost_variables, "c224", acc224param.c224) + monkeypatch.setattr(costs.data.costs, "c224", acc224param.c224) - monkeypatch.setattr(cost_variables, "c2241", acc224param.c2241) + monkeypatch.setattr(costs.data.costs, "c2241", acc224param.c2241) - monkeypatch.setattr(cost_variables, "c2242", acc224param.c2242) + monkeypatch.setattr(costs.data.costs, "c2242", acc224param.c2242) - monkeypatch.setattr(cost_variables, "c2243", acc224param.c2243) + monkeypatch.setattr(costs.data.costs, "c2243", acc224param.c2243) - monkeypatch.setattr(cost_variables, "c2244", acc224param.c2244) + monkeypatch.setattr(costs.data.costs, "c2244", acc224param.c2244) - monkeypatch.setattr(cost_variables, "c2245", acc224param.c2245) + monkeypatch.setattr(costs.data.costs, "c2245", acc224param.c2245) - monkeypatch.setattr(cost_variables, "c2246", acc224param.c2246) + monkeypatch.setattr(costs.data.costs, "c2246", acc224param.c2246) costs.acc224() - assert cost_variables.c224 == pytest.approx(acc224param.expected_c224) + assert costs.data.costs.c224 == pytest.approx(acc224param.expected_c224) - assert cost_variables.c2241 == pytest.approx(acc224param.expected_c2241) + assert costs.data.costs.c2241 == pytest.approx(acc224param.expected_c2241) - assert cost_variables.c2242 == pytest.approx(acc224param.expected_c2242) + assert costs.data.costs.c2242 == pytest.approx(acc224param.expected_c2242) - assert cost_variables.c2243 == pytest.approx(acc224param.expected_c2243) + assert costs.data.costs.c2243 == pytest.approx(acc224param.expected_c2243) - assert cost_variables.c2244 == pytest.approx(acc224param.expected_c2244) + assert costs.data.costs.c2244 == pytest.approx(acc224param.expected_c2244) - assert cost_variables.c2246 == pytest.approx(acc224param.expected_c2246) + assert costs.data.costs.c2246 == pytest.approx(acc224param.expected_c2246) class Acc2251Param(NamedTuple): @@ -3431,17 +3430,17 @@ def test_acc2251(acc2251param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "uctfsw", acc2251param.uctfsw) + monkeypatch.setattr(costs.data.costs, "uctfsw", acc2251param.uctfsw) - monkeypatch.setattr(cost_variables, "fkind", acc2251param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2251param.fkind) - monkeypatch.setattr(cost_variables, "ucbus", acc2251param.ucbus) + monkeypatch.setattr(costs.data.costs, "ucbus", acc2251param.ucbus) - monkeypatch.setattr(cost_variables, "uctfbr", acc2251param.uctfbr) + monkeypatch.setattr(costs.data.costs, "uctfbr", acc2251param.uctfbr) - monkeypatch.setattr(cost_variables, "uctfps", acc2251param.uctfps) + monkeypatch.setattr(costs.data.costs, "uctfps", acc2251param.uctfps) - monkeypatch.setattr(cost_variables, "uctfbus", acc2251param.uctfbus) + monkeypatch.setattr(costs.data.costs, "uctfbus", acc2251param.uctfbus) monkeypatch.setattr( tfcoil_variables, @@ -3469,35 +3468,35 @@ def test_acc2251(acc2251param, monkeypatch, costs): monkeypatch.setattr(tfcoil_variables, "c_tf_turn", acc2251param.c_tf_turn) - monkeypatch.setattr(cost_variables, "c22", acc2251param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2251param.c22) - monkeypatch.setattr(cost_variables, "c225", acc2251param.c225) + monkeypatch.setattr(costs.data.costs, "c225", acc2251param.c225) - monkeypatch.setattr(cost_variables, "c2251", acc2251param.c2251) + monkeypatch.setattr(costs.data.costs, "c2251", acc2251param.c2251) - monkeypatch.setattr(cost_variables, "c22511", acc2251param.c22511) + monkeypatch.setattr(costs.data.costs, "c22511", acc2251param.c22511) - monkeypatch.setattr(cost_variables, "c22512", acc2251param.c22512) + monkeypatch.setattr(costs.data.costs, "c22512", acc2251param.c22512) - monkeypatch.setattr(cost_variables, "c22513", acc2251param.c22513) + monkeypatch.setattr(costs.data.costs, "c22513", acc2251param.c22513) - monkeypatch.setattr(cost_variables, "c22514", acc2251param.c22514) + monkeypatch.setattr(costs.data.costs, "c22514", acc2251param.c22514) - monkeypatch.setattr(cost_variables, "c22515", acc2251param.c22515) + monkeypatch.setattr(costs.data.costs, "c22515", acc2251param.c22515) costs.acc2251() - assert cost_variables.c2251 == pytest.approx(acc2251param.expected_c2251) + assert costs.data.costs.c2251 == pytest.approx(acc2251param.expected_c2251) - assert cost_variables.c22511 == pytest.approx(acc2251param.expected_c22511) + assert costs.data.costs.c22511 == pytest.approx(acc2251param.expected_c22511) - assert cost_variables.c22512 == pytest.approx(acc2251param.expected_c22512) + assert costs.data.costs.c22512 == pytest.approx(acc2251param.expected_c22512) - assert cost_variables.c22513 == pytest.approx(acc2251param.expected_c22513) + assert costs.data.costs.c22513 == pytest.approx(acc2251param.expected_c22513) - assert cost_variables.c22514 == pytest.approx(acc2251param.expected_c22514) + assert costs.data.costs.c22514 == pytest.approx(acc2251param.expected_c22514) - assert cost_variables.c22515 == pytest.approx(acc2251param.expected_c22515) + assert costs.data.costs.c22515 == pytest.approx(acc2251param.expected_c22515) class Acc2252Param(NamedTuple): @@ -3640,21 +3639,21 @@ def test_acc2252(acc2252param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ucpfcb", acc2252param.ucpfcb) + monkeypatch.setattr(costs.data.costs, "ucpfcb", acc2252param.ucpfcb) - monkeypatch.setattr(cost_variables, "ucpfbk", acc2252param.ucpfbk) + monkeypatch.setattr(costs.data.costs, "ucpfbk", acc2252param.ucpfbk) - monkeypatch.setattr(cost_variables, "fkind", acc2252param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2252param.fkind) - monkeypatch.setattr(cost_variables, "ucpfb", acc2252param.ucpfb) + monkeypatch.setattr(costs.data.costs, "ucpfb", acc2252param.ucpfb) - monkeypatch.setattr(cost_variables, "ucpfdr1", acc2252param.ucpfdr1) + monkeypatch.setattr(costs.data.costs, "ucpfdr1", acc2252param.ucpfdr1) - monkeypatch.setattr(cost_variables, "ucpfic", acc2252param.ucpfic) + monkeypatch.setattr(costs.data.costs, "ucpfic", acc2252param.ucpfic) - monkeypatch.setattr(cost_variables, "ucpfbs", acc2252param.ucpfbs) + monkeypatch.setattr(costs.data.costs, "ucpfbs", acc2252param.ucpfbs) - monkeypatch.setattr(cost_variables, "ucpfps", acc2252param.ucpfps) + monkeypatch.setattr(costs.data.costs, "ucpfps", acc2252param.ucpfps) monkeypatch.setattr(heat_transport_variables, "peakmva", acc2252param.peakmva) @@ -3670,35 +3669,35 @@ def test_acc2252(acc2252param, monkeypatch, costs): monkeypatch.setattr(pf_power_variables, "acptmax", acc2252param.acptmax) - monkeypatch.setattr(cost_variables, "c22", acc2252param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2252param.c22) - monkeypatch.setattr(cost_variables, "c225", acc2252param.c225) + monkeypatch.setattr(costs.data.costs, "c225", acc2252param.c225) - monkeypatch.setattr(cost_variables, "c2252", acc2252param.c2252) + monkeypatch.setattr(costs.data.costs, "c2252", acc2252param.c2252) - monkeypatch.setattr(cost_variables, "c22521", acc2252param.c22521) + monkeypatch.setattr(costs.data.costs, "c22521", acc2252param.c22521) - monkeypatch.setattr(cost_variables, "c22522", acc2252param.c22522) + monkeypatch.setattr(costs.data.costs, "c22522", acc2252param.c22522) - monkeypatch.setattr(cost_variables, "c22523", acc2252param.c22523) + monkeypatch.setattr(costs.data.costs, "c22523", acc2252param.c22523) - monkeypatch.setattr(cost_variables, "c22524", acc2252param.c22524) + monkeypatch.setattr(costs.data.costs, "c22524", acc2252param.c22524) - monkeypatch.setattr(cost_variables, "c22525", acc2252param.c22525) + monkeypatch.setattr(costs.data.costs, "c22525", acc2252param.c22525) - monkeypatch.setattr(cost_variables, "c22526", acc2252param.c22526) + monkeypatch.setattr(costs.data.costs, "c22526", acc2252param.c22526) - monkeypatch.setattr(cost_variables, "c22527", acc2252param.c22527) + monkeypatch.setattr(costs.data.costs, "c22527", acc2252param.c22527) costs.acc2252() - assert cost_variables.c22521 == pytest.approx(acc2252param.expected_c22521) + assert costs.data.costs.c22521 == pytest.approx(acc2252param.expected_c22521) - assert cost_variables.c22522 == pytest.approx(acc2252param.expected_c22522) + assert costs.data.costs.c22522 == pytest.approx(acc2252param.expected_c22522) - assert cost_variables.c22523 == pytest.approx(acc2252param.expected_c22523) + assert costs.data.costs.c22523 == pytest.approx(acc2252param.expected_c22523) - assert cost_variables.c22524 == pytest.approx(acc2252param.expected_c22524) + assert costs.data.costs.c22524 == pytest.approx(acc2252param.expected_c22524) class Acc2253Param(NamedTuple): @@ -3773,9 +3772,9 @@ def test_acc2253(acc2253param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ucblss", acc2253param.ucblss) + monkeypatch.setattr(costs.data.costs, "ucblss", acc2253param.ucblss) - monkeypatch.setattr(cost_variables, "fkind", acc2253param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2253param.fkind) monkeypatch.setattr( heat_transport_variables, @@ -3799,15 +3798,15 @@ def test_acc2253(acc2253param, monkeypatch, costs): times_variables, "t_plant_pulse_no_burn", acc2253param.t_plant_pulse_no_burn ) - monkeypatch.setattr(cost_variables, "c22", acc2253param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2253param.c22) - monkeypatch.setattr(cost_variables, "c225", acc2253param.c225) + monkeypatch.setattr(costs.data.costs, "c225", acc2253param.c225) - monkeypatch.setattr(cost_variables, "c2253", acc2253param.c2253) + monkeypatch.setattr(costs.data.costs, "c2253", acc2253param.c2253) costs.acc2253() - assert cost_variables.c2253 == pytest.approx(acc2253param.expected_c2253) + assert costs.data.costs.c2253 == pytest.approx(acc2253param.expected_c2253) class Acc226Param(NamedTuple): @@ -3858,19 +3857,19 @@ def test_acc226(acc226param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "c226", acc226param.c226) + monkeypatch.setattr(costs.data.costs, "c226", acc226param.c226) - monkeypatch.setattr(cost_variables, "c2261", acc226param.c2261) + monkeypatch.setattr(costs.data.costs, "c2261", acc226param.c2261) - monkeypatch.setattr(cost_variables, "c2262", acc226param.c2262) + monkeypatch.setattr(costs.data.costs, "c2262", acc226param.c2262) - monkeypatch.setattr(cost_variables, "c2263", acc226param.c2263) + monkeypatch.setattr(costs.data.costs, "c2263", acc226param.c2263) - monkeypatch.setattr(cost_variables, "c22", acc226param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc226param.c22) costs.acc226() - assert cost_variables.c226 == pytest.approx(acc226param.expected_c226) + assert costs.data.costs.c226 == pytest.approx(acc226param.expected_c226) class Acc2261Param(NamedTuple): @@ -3971,11 +3970,11 @@ def test_acc2261_rut(acc2261param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "uchts", acc2261param.uchts) + monkeypatch.setattr(costs.data.costs, "uchts", acc2261param.uchts) - monkeypatch.setattr(cost_variables, "lsa", acc2261param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc2261param.lsa) - monkeypatch.setattr(cost_variables, "fkind", acc2261param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2261param.fkind) monkeypatch.setattr( fwbs_variables, "i_blkt_coolant_type", acc2261param.i_blkt_coolant_type @@ -4009,23 +4008,23 @@ def test_acc2261_rut(acc2261param, monkeypatch, costs): acc2261param.n_primary_heat_exchangers, ) - monkeypatch.setattr(cost_variables, "c226", acc2261param.c226) + monkeypatch.setattr(costs.data.costs, "c226", acc2261param.c226) - monkeypatch.setattr(cost_variables, "c2261", acc2261param.c2261) + monkeypatch.setattr(costs.data.costs, "c2261", acc2261param.c2261) - monkeypatch.setattr(cost_variables, "c22", acc2261param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2261param.c22) - monkeypatch.setattr(cost_variables, "chx", acc2261param.chx) + monkeypatch.setattr(costs.data.costs, "chx", acc2261param.chx) - monkeypatch.setattr(cost_variables, "cpp", acc2261param.cpp) + monkeypatch.setattr(costs.data.costs, "cpp", acc2261param.cpp) costs.acc2261() - assert cost_variables.c2261 == pytest.approx(acc2261param.expected_c2261) + assert costs.data.costs.c2261 == pytest.approx(acc2261param.expected_c2261) - assert cost_variables.chx == pytest.approx(acc2261param.expected_chx) + assert costs.data.costs.chx == pytest.approx(acc2261param.expected_chx) - assert cost_variables.cpp == pytest.approx(acc2261param.expected_cpp) + assert costs.data.costs.cpp == pytest.approx(acc2261param.expected_cpp) class Acc2262Param(NamedTuple): @@ -4120,9 +4119,9 @@ def test_acc2262_rut(acc2262param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "lsa", acc2262param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc2262param.lsa) - monkeypatch.setattr(cost_variables, "fkind", acc2262param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2262param.fkind) monkeypatch.setattr(ife_variables, "tfacmw", acc2262param.tfacmw) @@ -4152,21 +4151,21 @@ def test_acc2262_rut(acc2262param, monkeypatch, costs): acc2262param.p_cryo_plant_electric_mw, ) - monkeypatch.setattr(cost_variables, "c226", acc2262param.c226) + monkeypatch.setattr(costs.data.costs, "c226", acc2262param.c226) - monkeypatch.setattr(cost_variables, "c2262", acc2262param.c2262) + monkeypatch.setattr(costs.data.costs, "c2262", acc2262param.c2262) - monkeypatch.setattr(cost_variables, "c22", acc2262param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2262param.c22) - monkeypatch.setattr(cost_variables, "cpp", acc2262param.cpp) + monkeypatch.setattr(costs.data.costs, "cpp", acc2262param.cpp) - monkeypatch.setattr(cost_variables, "cppa", acc2262param.cppa) + monkeypatch.setattr(costs.data.costs, "cppa", acc2262param.cppa) costs.acc2262() - assert cost_variables.c2262 == pytest.approx(acc2262param.expected_c2262) + assert costs.data.costs.c2262 == pytest.approx(acc2262param.expected_c2262) - assert cost_variables.cppa == pytest.approx(acc2262param.expected_cppa) + assert costs.data.costs.cppa == pytest.approx(acc2262param.expected_cppa) class Acc2263Param(NamedTuple): @@ -4229,25 +4228,25 @@ def test_acc2263_rut(acc2263param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "uccry", acc2263param.uccry) + monkeypatch.setattr(costs.data.costs, "uccry", acc2263param.uccry) - monkeypatch.setattr(cost_variables, "lsa", acc2263param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc2263param.lsa) - monkeypatch.setattr(cost_variables, "fkind", acc2263param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2263param.fkind) monkeypatch.setattr(heat_transport_variables, "helpow", acc2263param.helpow) monkeypatch.setattr(tfcoil_variables, "temp_tf_cryo", acc2263param.temp_tf_cryo) - monkeypatch.setattr(cost_variables, "c226", acc2263param.c226) + monkeypatch.setattr(costs.data.costs, "c226", acc2263param.c226) - monkeypatch.setattr(cost_variables, "c2263", acc2263param.c2263) + monkeypatch.setattr(costs.data.costs, "c2263", acc2263param.c2263) - monkeypatch.setattr(cost_variables, "c22", acc2263param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2263param.c22) costs.acc2263() - assert cost_variables.c2263 == pytest.approx(acc2263param.expected_c2263) + assert costs.data.costs.c2263 == pytest.approx(acc2263param.expected_c2263) class Acc227Param(NamedTuple): @@ -4302,21 +4301,21 @@ def test_acc227(acc227param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "c227", acc227param.c227) + monkeypatch.setattr(costs.data.costs, "c227", acc227param.c227) - monkeypatch.setattr(cost_variables, "c2271", acc227param.c2271) + monkeypatch.setattr(costs.data.costs, "c2271", acc227param.c2271) - monkeypatch.setattr(cost_variables, "c2272", acc227param.c2272) + monkeypatch.setattr(costs.data.costs, "c2272", acc227param.c2272) - monkeypatch.setattr(cost_variables, "c2273", acc227param.c2273) + monkeypatch.setattr(costs.data.costs, "c2273", acc227param.c2273) - monkeypatch.setattr(cost_variables, "c2274", acc227param.c2274) + monkeypatch.setattr(costs.data.costs, "c2274", acc227param.c2274) - monkeypatch.setattr(cost_variables, "c22", acc227param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc227param.c22) costs.acc227() - assert cost_variables.c227 == pytest.approx(acc227param.expected_c227) + assert costs.data.costs.c227 == pytest.approx(acc227param.expected_c227) class Acc2271Param(NamedTuple): @@ -4367,19 +4366,19 @@ def test_acc2271_rut(acc2271param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ucf1", acc2271param.ucf1) + monkeypatch.setattr(costs.data.costs, "ucf1", acc2271param.ucf1) - monkeypatch.setattr(cost_variables, "fkind", acc2271param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2271param.fkind) - monkeypatch.setattr(cost_variables, "c227", acc2271param.c227) + monkeypatch.setattr(costs.data.costs, "c227", acc2271param.c227) - monkeypatch.setattr(cost_variables, "c2271", acc2271param.c2271) + monkeypatch.setattr(costs.data.costs, "c2271", acc2271param.c2271) - monkeypatch.setattr(cost_variables, "c22", acc2271param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2271param.c22) costs.acc2271() - assert cost_variables.c2271 == pytest.approx(acc2271param.expected_c2271) + assert costs.data.costs.c2271 == pytest.approx(acc2271param.expected_c2271) class Acc2272Param(NamedTuple): @@ -4462,7 +4461,7 @@ def test_acc2272_rut(acc2272param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "fkind", acc2272param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2272param.fkind) monkeypatch.setattr(ife_variables, "fburn", acc2272param.fburn) @@ -4480,17 +4479,17 @@ def test_acc2272_rut(acc2272param, monkeypatch, costs): monkeypatch.setattr(physics_variables, "m_fuel_amu", acc2272param.m_fuel_amu) - monkeypatch.setattr(cost_variables, "c227", acc2272param.c227) + monkeypatch.setattr(costs.data.costs, "c227", acc2272param.c227) - monkeypatch.setattr(cost_variables, "c2272", acc2272param.c2272) + monkeypatch.setattr(costs.data.costs, "c2272", acc2272param.c2272) - monkeypatch.setattr(cost_variables, "c22", acc2272param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2272param.c22) costs.acc2272() assert physics_variables.wtgpd == pytest.approx(acc2272param.expected_wtgpd) - assert cost_variables.c2272 == pytest.approx(acc2272param.expected_c2272) + assert costs.data.costs.c2272 == pytest.approx(acc2272param.expected_c2272) class Acc2273Param(NamedTuple): @@ -4553,21 +4552,21 @@ def test_acc2273_rut(acc2273param, monkeypatch, costs): monkeypatch.setattr(buildings_variables, "volrci", acc2273param.volrci) - monkeypatch.setattr(cost_variables, "fkind", acc2273param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2273param.fkind) monkeypatch.setattr( physics_variables, "f_plasma_fuel_tritium", acc2273param.f_plasma_fuel_tritium ) - monkeypatch.setattr(cost_variables, "c227", acc2273param.c227) + monkeypatch.setattr(costs.data.costs, "c227", acc2273param.c227) - monkeypatch.setattr(cost_variables, "c2273", acc2273param.c2273) + monkeypatch.setattr(costs.data.costs, "c2273", acc2273param.c2273) - monkeypatch.setattr(cost_variables, "c22", acc2273param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2273param.c22) costs.acc2273() - assert cost_variables.c2273 == pytest.approx(acc2273param.expected_c2273) + assert costs.data.costs.c2273 == pytest.approx(acc2273param.expected_c2273) class Acc2274Param(NamedTuple): @@ -4626,17 +4625,17 @@ def test_acc2274_rut(acc2274param, monkeypatch, costs): monkeypatch.setattr(buildings_variables, "volrci", acc2274param.volrci) - monkeypatch.setattr(cost_variables, "fkind", acc2274param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2274param.fkind) - monkeypatch.setattr(cost_variables, "c227", acc2274param.c227) + monkeypatch.setattr(costs.data.costs, "c227", acc2274param.c227) - monkeypatch.setattr(cost_variables, "c2274", acc2274param.c2274) + monkeypatch.setattr(costs.data.costs, "c2274", acc2274param.c2274) - monkeypatch.setattr(cost_variables, "c22", acc2274param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2274param.c22) costs.acc2274() - assert cost_variables.c2274 == pytest.approx(acc2274param.expected_c2274) + assert costs.data.costs.c2274 == pytest.approx(acc2274param.expected_c2274) class Acc228Param(NamedTuple): @@ -4683,17 +4682,17 @@ def test_acc228_rut(acc228param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "uciac", acc228param.uciac) + monkeypatch.setattr(costs.data.costs, "uciac", acc228param.uciac) - monkeypatch.setattr(cost_variables, "fkind", acc228param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc228param.fkind) - monkeypatch.setattr(cost_variables, "c228", acc228param.c228) + monkeypatch.setattr(costs.data.costs, "c228", acc228param.c228) - monkeypatch.setattr(cost_variables, "c22", acc228param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc228param.c22) costs.acc228() - assert cost_variables.c228 == pytest.approx(acc228param.expected_c228) + assert costs.data.costs.c228 == pytest.approx(acc228param.expected_c228) class Acc229Param(NamedTuple): @@ -4740,17 +4739,17 @@ def test_acc229_rut(acc229param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ucme", acc229param.ucme) + monkeypatch.setattr(costs.data.costs, "ucme", acc229param.ucme) - monkeypatch.setattr(cost_variables, "fkind", acc229param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc229param.fkind) - monkeypatch.setattr(cost_variables, "c229", acc229param.c229) + monkeypatch.setattr(costs.data.costs, "c229", acc229param.c229) - monkeypatch.setattr(cost_variables, "c22", acc229param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc229param.c22) costs.acc229() - assert cost_variables.c229 == pytest.approx(acc229param.expected_c229) + assert costs.data.costs.c229 == pytest.approx(acc229param.expected_c229) class Acc23Param(NamedTuple): @@ -4805,9 +4804,9 @@ def test_acc23_rut(acc23param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ucturb", acc23param.ucturb) + monkeypatch.setattr(costs.data.costs, "ucturb", acc23param.ucturb) - monkeypatch.setattr(cost_variables, "ireactor", acc23param.ireactor) + monkeypatch.setattr(costs.data.costs, "ireactor", acc23param.ireactor) monkeypatch.setattr( fwbs_variables, "i_blkt_coolant_type", acc23param.i_blkt_coolant_type @@ -4819,11 +4818,11 @@ def test_acc23_rut(acc23param, monkeypatch, costs): acc23param.p_plant_electric_gross_mw, ) - monkeypatch.setattr(cost_variables, "c23", acc23param.c23) + monkeypatch.setattr(costs.data.costs, "c23", acc23param.c23) costs.acc23() - assert cost_variables.c23 == pytest.approx(acc23param.expected_c23) + assert costs.data.costs.c23 == pytest.approx(acc23param.expected_c23) class Acc24Param(NamedTuple): @@ -4878,21 +4877,21 @@ def test_acc24(acc24param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "c24", acc24param.c24) + monkeypatch.setattr(costs.data.costs, "c24", acc24param.c24) - monkeypatch.setattr(cost_variables, "c241", acc24param.c241) + monkeypatch.setattr(costs.data.costs, "c241", acc24param.c241) - monkeypatch.setattr(cost_variables, "c242", acc24param.c242) + monkeypatch.setattr(costs.data.costs, "c242", acc24param.c242) - monkeypatch.setattr(cost_variables, "c243", acc24param.c243) + monkeypatch.setattr(costs.data.costs, "c243", acc24param.c243) - monkeypatch.setattr(cost_variables, "c244", acc24param.c244) + monkeypatch.setattr(costs.data.costs, "c244", acc24param.c244) - monkeypatch.setattr(cost_variables, "c245", acc24param.c245) + monkeypatch.setattr(costs.data.costs, "c245", acc24param.c245) costs.acc24() - assert cost_variables.c24 == pytest.approx(acc24param.expected_c24) + assert costs.data.costs.c24 == pytest.approx(acc24param.expected_c24) class Acc241Param(NamedTuple): @@ -4935,15 +4934,15 @@ def test_acc241_rut(acc241param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "lsa", acc241param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc241param.lsa) - monkeypatch.setattr(cost_variables, "c24", acc241param.c24) + monkeypatch.setattr(costs.data.costs, "c24", acc241param.c24) - monkeypatch.setattr(cost_variables, "c241", acc241param.c241) + monkeypatch.setattr(costs.data.costs, "c241", acc241param.c241) costs.acc241() - assert cost_variables.c241 == pytest.approx(acc241param.expected_c241) + assert costs.data.costs.c241 == pytest.approx(acc241param.expected_c241) class Acc242Param(NamedTuple): @@ -4998,7 +4997,7 @@ def test_acc242_rut(acc242param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "lsa", acc242param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc242param.lsa) monkeypatch.setattr(heat_transport_variables, "pacpmw", acc242param.pacpmw) @@ -5008,15 +5007,15 @@ def test_acc242_rut(acc242param, monkeypatch, costs): acc242param.p_plant_electric_base_total_mw, ) - monkeypatch.setattr(cost_variables, "c24", acc242param.c24) + monkeypatch.setattr(costs.data.costs, "c24", acc242param.c24) - monkeypatch.setattr(cost_variables, "c242", acc242param.c242) + monkeypatch.setattr(costs.data.costs, "c242", acc242param.c242) - monkeypatch.setattr(cost_variables, "cpp", acc242param.cpp) + monkeypatch.setattr(costs.data.costs, "cpp", acc242param.cpp) costs.acc242() - assert cost_variables.c242 == pytest.approx(acc242param.expected_c242) + assert costs.data.costs.c242 == pytest.approx(acc242param.expected_c242) class Acc243Param(NamedTuple): @@ -5063,17 +5062,17 @@ def test_acc243_rut(acc243param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "lsa", acc243param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc243param.lsa) monkeypatch.setattr(heat_transport_variables, "tlvpmw", acc243param.tlvpmw) - monkeypatch.setattr(cost_variables, "c24", acc243param.c24) + monkeypatch.setattr(costs.data.costs, "c24", acc243param.c24) - monkeypatch.setattr(cost_variables, "c243", acc243param.c243) + monkeypatch.setattr(costs.data.costs, "c243", acc243param.c243) costs.acc243() - assert cost_variables.c243 == pytest.approx(acc243param.expected_c243) + assert costs.data.costs.c243 == pytest.approx(acc243param.expected_c243) class Acc244Param(NamedTuple): @@ -5116,15 +5115,15 @@ def test_acc244_rut(acc244param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "lsa", acc244param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc244param.lsa) - monkeypatch.setattr(cost_variables, "c24", acc244param.c24) + monkeypatch.setattr(costs.data.costs, "c24", acc244param.c24) - monkeypatch.setattr(cost_variables, "c244", acc244param.c244) + monkeypatch.setattr(costs.data.costs, "c244", acc244param.c244) costs.acc244() - assert cost_variables.c244 == pytest.approx(acc244param.expected_c244) + assert costs.data.costs.c244 == pytest.approx(acc244param.expected_c244) class Acc245Param(NamedTuple): @@ -5167,15 +5166,15 @@ def test_acc245_rut(acc245param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "lsa", acc245param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc245param.lsa) - monkeypatch.setattr(cost_variables, "c24", acc245param.c24) + monkeypatch.setattr(costs.data.costs, "c24", acc245param.c24) - monkeypatch.setattr(cost_variables, "c245", acc245param.c245) + monkeypatch.setattr(costs.data.costs, "c245", acc245param.c245) costs.acc245() - assert cost_variables.c245 == pytest.approx(acc245param.expected_c245) + assert costs.data.costs.c245 == pytest.approx(acc245param.expected_c245) class Acc25Param(NamedTuple): @@ -5218,15 +5217,15 @@ def test_acc25_rut(acc25param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ucmisc", acc25param.ucmisc) + monkeypatch.setattr(costs.data.costs, "ucmisc", acc25param.ucmisc) - monkeypatch.setattr(cost_variables, "lsa", acc25param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc25param.lsa) - monkeypatch.setattr(cost_variables, "c25", acc25param.c25) + monkeypatch.setattr(costs.data.costs, "c25", acc25param.c25) costs.acc25() - assert cost_variables.c25 == pytest.approx(acc25param.expected_c25) + assert costs.data.costs.c25 == pytest.approx(acc25param.expected_c25) class Acc26Param(NamedTuple): @@ -5293,11 +5292,11 @@ def test_acc26_rut(acc26param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ireactor", acc26param.ireactor) + monkeypatch.setattr(costs.data.costs, "ireactor", acc26param.ireactor) - monkeypatch.setattr(cost_variables, "uchrs", acc26param.uchrs) + monkeypatch.setattr(costs.data.costs, "uchrs", acc26param.uchrs) - monkeypatch.setattr(cost_variables, "lsa", acc26param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc26param.lsa) monkeypatch.setattr( heat_transport_variables, @@ -5325,11 +5324,11 @@ def test_acc26_rut(acc26param, monkeypatch, costs): monkeypatch.setattr(tfcoil_variables, "tfcmw", acc26param.tfcmw) - monkeypatch.setattr(cost_variables, "c26", acc26param.c26) + monkeypatch.setattr(costs.data.costs, "c26", acc26param.c26) costs.acc26() - assert cost_variables.c26 == pytest.approx(acc26param.expected_c26) + assert costs.data.costs.c26 == pytest.approx(acc26param.expected_c26) class Acc9Param(NamedTuple): @@ -5414,25 +5413,25 @@ def test_acc9_rut(acc9param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "fcontng", acc9param.fcontng) + monkeypatch.setattr(costs.data.costs, "fcontng", acc9param.fcontng) - monkeypatch.setattr(cost_variables, "lsa", acc9param.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", acc9param.lsa) - monkeypatch.setattr(cost_variables, "cowner", acc9param.cowner) + monkeypatch.setattr(costs.data.costs, "cowner", acc9param.cowner) - monkeypatch.setattr(cost_variables, "cdirt", acc9param.cdirt) + monkeypatch.setattr(costs.data.costs, "cdirt", acc9param.cdirt) - monkeypatch.setattr(cost_variables, "cfind", acc9param.cfind) + monkeypatch.setattr(costs.data.costs, "cfind", acc9param.cfind) - monkeypatch.setattr(cost_variables, "cindrt", acc9param.cindrt) + monkeypatch.setattr(costs.data.costs, "cindrt", acc9param.cindrt) - monkeypatch.setattr(cost_variables, "ccont", acc9param.ccont) + monkeypatch.setattr(costs.data.costs, "ccont", acc9param.ccont) costs.acc9() - assert cost_variables.cindrt == pytest.approx(acc9param.expected_cindrt) + assert costs.data.costs.cindrt == pytest.approx(acc9param.expected_cindrt) - assert cost_variables.ccont == pytest.approx(acc9param.expected_ccont) + assert costs.data.costs.ccont == pytest.approx(acc9param.expected_ccont) class Acc2253Param(NamedTuple): @@ -5507,9 +5506,9 @@ def test_acc2253_urt(acc2253param, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ucblss", acc2253param.ucblss) + monkeypatch.setattr(costs.data.costs, "ucblss", acc2253param.ucblss) - monkeypatch.setattr(cost_variables, "fkind", acc2253param.fkind) + monkeypatch.setattr(costs.data.costs, "fkind", acc2253param.fkind) monkeypatch.setattr( heat_transport_variables, @@ -5533,15 +5532,15 @@ def test_acc2253_urt(acc2253param, monkeypatch, costs): times_variables, "t_plant_pulse_no_burn", acc2253param.t_plant_pulse_no_burn ) - monkeypatch.setattr(cost_variables, "c22", acc2253param.c22) + monkeypatch.setattr(costs.data.costs, "c22", acc2253param.c22) - monkeypatch.setattr(cost_variables, "c225", acc2253param.c225) + monkeypatch.setattr(costs.data.costs, "c225", acc2253param.c225) - monkeypatch.setattr(cost_variables, "c2253", acc2253param.c2253) + monkeypatch.setattr(costs.data.costs, "c2253", acc2253param.c2253) costs.acc2253() - assert cost_variables.c2253 == pytest.approx(acc2253param.expected_c2253) + assert costs.data.costs.c2253 == pytest.approx(acc2253param.expected_c2253) class CoelcParam(NamedTuple): @@ -5840,79 +5839,79 @@ def test_coelc(coelcparam, monkeypatch, costs): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "fcdfuel", coelcparam.fcdfuel) + monkeypatch.setattr(costs.data.costs, "fcdfuel", coelcparam.fcdfuel) - monkeypatch.setattr(cost_variables, "uche3", coelcparam.uche3) + monkeypatch.setattr(costs.data.costs, "uche3", coelcparam.uche3) - monkeypatch.setattr(cost_variables, "life_plant", coelcparam.life_plant) + monkeypatch.setattr(costs.data.costs, "life_plant", coelcparam.life_plant) - monkeypatch.setattr(cost_variables, "ifueltyp", coelcparam.ifueltyp) + monkeypatch.setattr(costs.data.costs, "ifueltyp", coelcparam.ifueltyp) - monkeypatch.setattr(cost_variables, "cpstcst", coelcparam.cpstcst) + monkeypatch.setattr(costs.data.costs, "cpstcst", coelcparam.cpstcst) - monkeypatch.setattr(cost_variables, "coeoam", coelcparam.coeoam) + monkeypatch.setattr(costs.data.costs, "coeoam", coelcparam.coeoam) - monkeypatch.setattr(cost_variables, "coecap", coelcparam.coecap) + monkeypatch.setattr(costs.data.costs, "coecap", coelcparam.coecap) - monkeypatch.setattr(cost_variables, "output_costs", coelcparam.output_costs) + monkeypatch.setattr(costs.data.costs, "output_costs", coelcparam.output_costs) - monkeypatch.setattr(cost_variables, "coe", coelcparam.coe) + monkeypatch.setattr(costs.data.costs, "coe", coelcparam.coe) - monkeypatch.setattr(cost_variables, "lsa", coelcparam.lsa) + monkeypatch.setattr(costs.data.costs, "lsa", coelcparam.lsa) monkeypatch.setattr( - cost_variables, "f_t_plant_available", coelcparam.f_t_plant_available + costs.data.costs, "f_t_plant_available", coelcparam.f_t_plant_available ) - monkeypatch.setattr(cost_variables, "divcst", coelcparam.divcst) + monkeypatch.setattr(costs.data.costs, "divcst", coelcparam.divcst) - monkeypatch.setattr(cost_variables, "ucfuel", coelcparam.ucfuel) + monkeypatch.setattr(costs.data.costs, "ucfuel", coelcparam.ucfuel) - monkeypatch.setattr(cost_variables, "life_div_fpy", coelcparam.life_div_fpy) + monkeypatch.setattr(costs.data.costs, "life_div_fpy", coelcparam.life_div_fpy) - monkeypatch.setattr(cost_variables, "life_div", coelcparam.life_div) + monkeypatch.setattr(costs.data.costs, "life_div", coelcparam.life_div) - monkeypatch.setattr(cost_variables, "coefuelt", coelcparam.coefuelt) + monkeypatch.setattr(costs.data.costs, "coefuelt", coelcparam.coefuelt) - monkeypatch.setattr(cost_variables, "moneyint", coelcparam.moneyint) + monkeypatch.setattr(costs.data.costs, "moneyint", coelcparam.moneyint) - monkeypatch.setattr(cost_variables, "life_hcd_fpy", coelcparam.life_hcd_fpy) + monkeypatch.setattr(costs.data.costs, "life_hcd_fpy", coelcparam.life_hcd_fpy) - monkeypatch.setattr(cost_variables, "cdrlife_cal", coelcparam.cdrlife_cal) + monkeypatch.setattr(costs.data.costs, "cdrlife_cal", coelcparam.cdrlife_cal) - monkeypatch.setattr(cost_variables, "capcost", coelcparam.capcost) + monkeypatch.setattr(costs.data.costs, "capcost", coelcparam.capcost) - monkeypatch.setattr(cost_variables, "cplife", coelcparam.cplife) + monkeypatch.setattr(costs.data.costs, "cplife", coelcparam.cplife) - monkeypatch.setattr(cost_variables, "cplife_cal", coelcparam.cplife_cal) + monkeypatch.setattr(costs.data.costs, "cplife_cal", coelcparam.cplife_cal) - monkeypatch.setattr(cost_variables, "fwallcst", coelcparam.fwallcst) + monkeypatch.setattr(costs.data.costs, "fwallcst", coelcparam.fwallcst) - monkeypatch.setattr(cost_variables, "fcr0", coelcparam.fcr0) + monkeypatch.setattr(costs.data.costs, "fcr0", coelcparam.fcr0) - monkeypatch.setattr(cost_variables, "discount_rate", coelcparam.discount_rate) + monkeypatch.setattr(costs.data.costs, "discount_rate", coelcparam.discount_rate) - monkeypatch.setattr(cost_variables, "decomf", coelcparam.decomf) + monkeypatch.setattr(costs.data.costs, "decomf", coelcparam.decomf) - monkeypatch.setattr(cost_variables, "cdcost", coelcparam.cdcost) + monkeypatch.setattr(costs.data.costs, "cdcost", coelcparam.cdcost) - monkeypatch.setattr(cost_variables, "fcap0", coelcparam.fcap0) + monkeypatch.setattr(costs.data.costs, "fcap0", coelcparam.fcap0) - monkeypatch.setattr(cost_variables, "fcap0cp", coelcparam.fcap0cp) + monkeypatch.setattr(costs.data.costs, "fcap0cp", coelcparam.fcap0cp) - monkeypatch.setattr(cost_variables, "ucwst", coelcparam.ucwst) + monkeypatch.setattr(costs.data.costs, "ucwst", coelcparam.ucwst) - monkeypatch.setattr(cost_variables, "ucoam", coelcparam.ucoam) + monkeypatch.setattr(costs.data.costs, "ucoam", coelcparam.ucoam) - monkeypatch.setattr(cost_variables, "dtlife", coelcparam.dtlife) + monkeypatch.setattr(costs.data.costs, "dtlife", coelcparam.dtlife) - monkeypatch.setattr(cost_variables, "blkcst", coelcparam.blkcst) + monkeypatch.setattr(costs.data.costs, "blkcst", coelcparam.blkcst) - monkeypatch.setattr(cost_variables, "dintrt", coelcparam.dintrt) + monkeypatch.setattr(costs.data.costs, "dintrt", coelcparam.dintrt) - monkeypatch.setattr(cost_variables, "concost", coelcparam.concost) + monkeypatch.setattr(costs.data.costs, "concost", coelcparam.concost) - monkeypatch.setattr(cost_variables, "cfind", coelcparam.cfind) + monkeypatch.setattr(costs.data.costs, "cfind", coelcparam.cfind) monkeypatch.setattr(fwbs_variables, "life_blkt_fpy", coelcparam.life_blkt_fpy) @@ -5948,14 +5947,14 @@ def test_coelc(coelcparam, monkeypatch, costs): costs.coelc() - assert cost_variables.coeoam == pytest.approx(coelcparam.expected_coeoam) + assert costs.data.costs.coeoam == pytest.approx(coelcparam.expected_coeoam) - assert cost_variables.coecap == pytest.approx(coelcparam.expected_coecap) + assert costs.data.costs.coecap == pytest.approx(coelcparam.expected_coecap) - assert cost_variables.coe == pytest.approx(coelcparam.expected_coe) + assert costs.data.costs.coe == pytest.approx(coelcparam.expected_coe) - assert cost_variables.coefuelt == pytest.approx(coelcparam.expected_coefuelt) + assert costs.data.costs.coefuelt == pytest.approx(coelcparam.expected_coefuelt) - assert cost_variables.moneyint == pytest.approx(coelcparam.expected_moneyint) + assert costs.data.costs.moneyint == pytest.approx(coelcparam.expected_moneyint) - assert cost_variables.capcost == pytest.approx(coelcparam.expected_capcost) + assert costs.data.costs.capcost == pytest.approx(coelcparam.expected_capcost) diff --git a/tests/unit/models/test_costs_2015.py b/tests/unit/models/test_costs_2015.py index 6dd68bf0e7..bdd5eca932 100644 --- a/tests/unit/models/test_costs_2015.py +++ b/tests/unit/models/test_costs_2015.py @@ -7,7 +7,6 @@ from process.data_structure import ( build_variables, - cost_variables, current_drive_variables, fwbs_variables, heat_transport_variables, @@ -20,7 +19,7 @@ @pytest.fixture def costs2015(process_models): - """Provides Costs2015 object for testing. + """Fixture to get the Costs2015 instance from process_models. :return costs2015: initialised costs2015 object :type costs2015: process.costs2015.Costs2015 @@ -2255,7 +2254,9 @@ class CalcBuildingCostsParam: ), ], ) -def test_calc_building_costs(calcbuildingcostsparam, monkeypatch, costs2015): +def test_calc_building_costs( + calcbuildingcostsparam, monkeypatch, costs2015, process_models +): """ Automatically generated Regression Unit Test for calc_building_costs. @@ -2317,19 +2318,19 @@ def test_calc_building_costs(calcbuildingcostsparam, monkeypatch, costs2015): ) monkeypatch.setattr( - cost_variables, + costs2015.data.costs, "cost_factor_buildings", calcbuildingcostsparam.cost_factor_buildings, ) monkeypatch.setattr( - cost_variables, + costs2015.data.costs, "light_build_cost_per_vol", calcbuildingcostsparam.light_build_cost_per_vol, ) monkeypatch.setattr( - cost_variables, + costs2015.data.costs, "tok_build_cost_per_vol", calcbuildingcostsparam.tok_build_cost_per_vol, ) @@ -4562,7 +4563,7 @@ class CalcLandCostsParam: ), ], ) -def test_calc_land_costs(calclandcostsparam, monkeypatch, costs2015): +def test_calc_land_costs(calclandcostsparam, monkeypatch, costs2015, process_models): """ Automatically generated Regression Unit Test for calc_land_costs. @@ -4592,10 +4593,12 @@ def test_calc_land_costs(calclandcostsparam, monkeypatch, costs2015): ) monkeypatch.setattr( - cost_variables, "cost_factor_land", calclandcostsparam.cost_factor_land + costs2015.data.costs, + "cost_factor_land", + calclandcostsparam.cost_factor_land, ) - monkeypatch.setattr(cost_variables, "costexp", calclandcostsparam.costexp) + monkeypatch.setattr(costs2015.data.costs, "costexp", calclandcostsparam.costexp) for field in ["s_kref", "s_k", "s_cref", "s_cost", "s_cost_factor"]: monkeypatch.setattr( costs2015.data.costs_2015, field, getattr(calclandcostsparam, field) @@ -6828,7 +6831,9 @@ class CalcTfCoilCostsParam: ), ], ) -def test_calc_tf_coil_costs(calctfcoilcostsparam, monkeypatch, costs2015): +def test_calc_tf_coil_costs( + calctfcoilcostsparam, monkeypatch, costs2015, process_models +): """ Automatically generated Regression Unit Test for calc_tf_coil_costs. @@ -6862,12 +6867,12 @@ def test_calc_tf_coil_costs(calctfcoilcostsparam, monkeypatch, costs2015): ) monkeypatch.setattr( - cost_variables, + costs2015.data.costs, "cost_factor_tf_coils", calctfcoilcostsparam.cost_factor_tf_coils, ) - monkeypatch.setattr(cost_variables, "costexp", calctfcoilcostsparam.costexp) + monkeypatch.setattr(costs2015.data.costs, "costexp", calctfcoilcostsparam.costexp) for field in ["s_kref", "s_k", "s_cref", "s_cost", "s_cost_factor"]: monkeypatch.setattr( @@ -9093,7 +9098,7 @@ class CalcRemoteHandlingCostsParam: ], ) def test_calc_remote_handling_costs( - calcremotehandlingcostsparam, monkeypatch, costs2015 + calcremotehandlingcostsparam, monkeypatch, costs2015, process_models ): """ Automatically generated Regression Unit Test for calc_remote_handling_costs. @@ -9114,13 +9119,19 @@ def test_calc_remote_handling_costs( ) monkeypatch.setattr( - cost_variables, "cost_factor_rh", calcremotehandlingcostsparam.cost_factor_rh + costs2015.data.costs, + "cost_factor_rh", + calcremotehandlingcostsparam.cost_factor_rh, ) - monkeypatch.setattr(cost_variables, "costexp", calcremotehandlingcostsparam.costexp) + monkeypatch.setattr( + costs2015.data.costs, "costexp", calcremotehandlingcostsparam.costexp + ) monkeypatch.setattr( - cost_variables, "num_rh_systems", calcremotehandlingcostsparam.num_rh_systems + costs2015.data.costs, + "num_rh_systems", + calcremotehandlingcostsparam.num_rh_systems, ) for field in ["s_kref", "s_k", "s_cref", "s_cost", "s_cost_factor"]: monkeypatch.setattr( @@ -11350,7 +11361,9 @@ class CalcNPlantAndVvCostsParam: ), ], ) -def test_calc_n_plant_and_vv_costs(calcnplantandvvcostsparam, monkeypatch, costs2015): +def test_calc_n_plant_and_vv_costs( + calcnplantandvvcostsparam, monkeypatch, costs2015, process_models +): """ Automatically generated Regression Unit Test for calc_n_plant_and_vv_costs. @@ -11378,10 +11391,14 @@ def test_calc_n_plant_and_vv_costs(calcnplantandvvcostsparam, monkeypatch, costs ) monkeypatch.setattr( - cost_variables, "cost_factor_vv", calcnplantandvvcostsparam.cost_factor_vv + costs2015.data.costs, + "cost_factor_vv", + calcnplantandvvcostsparam.cost_factor_vv, ) - monkeypatch.setattr(cost_variables, "costexp", calcnplantandvvcostsparam.costexp) + monkeypatch.setattr( + costs2015.data.costs, "costexp", calcnplantandvvcostsparam.costexp + ) for field in ["s_kref", "s_k", "s_cref", "s_cost", "s_cost_factor"]: monkeypatch.setattr( @@ -13606,7 +13623,7 @@ class CalcEnergyConversionSystemParam: ], ) def test_calc_energy_conversion_system( - calcenergyconversionsystemparam, monkeypatch, costs2015 + calcenergyconversionsystemparam, monkeypatch, costs2015, process_models ): """ Automatically generated Regression Unit Test for calc_energy_conversion_system. @@ -13627,13 +13644,15 @@ def test_calc_energy_conversion_system( ) monkeypatch.setattr( - cost_variables, + costs2015.data.costs, "cost_factor_bop", calcenergyconversionsystemparam.cost_factor_bop, ) monkeypatch.setattr( - cost_variables, "costexp", calcenergyconversionsystemparam.costexp + costs2015.data.costs, + "costexp", + calcenergyconversionsystemparam.costexp, ) for field in ["s_kref", "s_k", "s_cref", "s_cost", "s_cost_factor"]: monkeypatch.setattr( @@ -15890,7 +15909,9 @@ class CalcRemainingSubsystemsParam: ), ], ) -def test_calc_remaining_subsystems(calcremainingsubsystemsparam, monkeypatch, costs2015): +def test_calc_remaining_subsystems( + calcremainingsubsystemsparam, monkeypatch, costs2015, process_models +): """ Automatically generated Regression Unit Test for calc_remaining_subsystems. @@ -15968,12 +15989,14 @@ def test_calc_remaining_subsystems(calcremainingsubsystemsparam, monkeypatch, co ) monkeypatch.setattr( - cost_variables, + costs2015.data.costs, "cost_factor_misc", calcremainingsubsystemsparam.cost_factor_misc, ) - monkeypatch.setattr(cost_variables, "costexp", calcremainingsubsystemsparam.costexp) + monkeypatch.setattr( + costs2015.data.costs, "costexp", calcremainingsubsystemsparam.costexp + ) for field in ["s_kref", "s_k", "s_cref", "s_cost", "s_cost_factor"]: monkeypatch.setattr( diff --git a/tests/unit/models/test_ife.py b/tests/unit/models/test_ife.py index f46c02fa7a..ec15e7f531 100644 --- a/tests/unit/models/test_ife.py +++ b/tests/unit/models/test_ife.py @@ -7,26 +7,22 @@ from process.data_structure import ( buildings_variables, - cost_variables, first_wall_variables, fwbs_variables, heat_transport_variables, ife_variables, physics_variables, ) -from process.models.availability import Availability -from process.models.costs.costs import Costs -from process.models.ife import IFE @pytest.fixture -def ife(): - """Provides IFE object for testing. +def ife(process_models): + """Fixture to get the IFE instance from process_models. :returns: initialised IFE object :rtype: process.ife.IFE """ - return IFE(Availability(), Costs()) + return process_models.ife def test_ifetgt(monkeypatch, ife): @@ -1569,7 +1565,7 @@ class IfefbsParam(NamedTuple): ), ], ) -def test_ifefbs(ifefbsparam, monkeypatch, ife): +def test_ifefbs(ifefbsparam, monkeypatch, ife, process_models): """ Automatically generated Regression Unit Test for ifefbs. @@ -1582,10 +1578,12 @@ def test_ifefbs(ifefbsparam, monkeypatch, ife): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ monkeypatch.setattr(first_wall_variables, "a_fw_total", ifefbsparam.a_fw_total) - monkeypatch.setattr(cost_variables, "life_plant", ifefbsparam.life_plant) - monkeypatch.setattr(cost_variables, "abktflnc", ifefbsparam.abktflnc) + monkeypatch.setattr(ife.data.costs, "life_plant", ifefbsparam.life_plant) + monkeypatch.setattr(ife.data.costs, "abktflnc", ifefbsparam.abktflnc) monkeypatch.setattr( - cost_variables, "f_t_plant_available", ifefbsparam.f_t_plant_available + ife.data.costs, + "f_t_plant_available", + ifefbsparam.f_t_plant_available, ) monkeypatch.setattr(fwbs_variables, "den_steel", ifefbsparam.den_steel) monkeypatch.setattr(fwbs_variables, "m_fw_total", ifefbsparam.m_fw_total) @@ -3106,7 +3104,7 @@ class Ifepw2Param(NamedTuple): ), ], ) -def test_ifepw2(ifepw2param, monkeypatch, ife): +def test_ifepw2(ifepw2param, monkeypatch, ife, process_models): """ Automatically generated Regression Unit Test for ifepw2. @@ -3118,7 +3116,7 @@ def test_ifepw2(ifepw2param, monkeypatch, ife): :param monkeypatch: pytest fixture used to mock module/class variables :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(cost_variables, "ireactor", ifepw2param.ireactor) + monkeypatch.setattr(ife.data.costs, "ireactor", ifepw2param.ireactor) monkeypatch.setattr(fwbs_variables, "pnucloss", ifepw2param.pnucloss) monkeypatch.setattr( fwbs_variables, "f_p_blkt_multiplication", ifepw2param.f_p_blkt_multiplication diff --git a/tests/unit/models/test_power.py b/tests/unit/models/test_power.py index ede3d2bd18..231fd5b263 100644 --- a/tests/unit/models/test_power.py +++ b/tests/unit/models/test_power.py @@ -7,7 +7,6 @@ build_variables, buildings_variables, constraint_variables, - cost_variables, current_drive_variables, divertor_variables, fwbs_variables, @@ -21,17 +20,16 @@ times_variables, ) from process.data_structure import primary_pumping_variables as ppv -from process.models.power import Power @pytest.fixture -def power(): - """Provides power object for testing. +def power(process_models): + """Fixture to get the Power instance from process_models. :returns: initialised power object :rtype: process.power.Power """ - return Power() + return process_models.power class CryoParam(NamedTuple): @@ -2491,7 +2489,7 @@ class Power2Param(NamedTuple): ), ], ) -def test_power2(power2param, monkeypatch, power): +def test_power2(power2param, monkeypatch, power, process_models): """ Automatically generated Regression Unit Test for power2. @@ -2510,9 +2508,9 @@ def test_power2(power2param, monkeypatch, power): power2param.p_plant_electric_net_required_mw, ) - monkeypatch.setattr(cost_variables, "ipnet", power2param.ipnet) + monkeypatch.setattr(power.data.costs, "ipnet", power2param.ipnet) - monkeypatch.setattr(cost_variables, "ireactor", power2param.ireactor) + monkeypatch.setattr(power.data.costs, "ireactor", power2param.ireactor) monkeypatch.setattr( current_drive_variables, From 5ae17bf26533951e286587a82fcc0ab51d4de918 Mon Sep 17 00:00:00 2001 From: Clair Mould <86794332+clmould@users.noreply.github.com> Date: Thu, 16 Apr 2026 11:40:16 +0100 Subject: [PATCH 2/2] f --- process/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/process/main.py b/process/main.py index c74bb2dbfe..2f20db2a28 100644 --- a/process/main.py +++ b/process/main.py @@ -720,6 +720,7 @@ def models(self) -> tuple[Model, ...]: self.buildings, self.power, self.stellarator, + self.ccfe_hcpb, ) def setup_data_structure(self):