From f12bf7030cc183172289e161cfd4fef4593b70ee Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Wed, 22 Oct 2025 09:43:36 +0100 Subject: [PATCH 01/17] Add simple unit test for constraint functions --- process/constraints.py | 7 ++--- process/data_structure/rebco_variables.py | 6 ++--- .../data_structure/stellarator_variables.py | 4 +++ .../superconducting_tf_coil_variables.py | 2 ++ process/tf_coil.py | 2 +- tests/unit/test_constraints.py | 27 +++++++++++++++++++ 6 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 tests/unit/test_constraints.py diff --git a/process/constraints.py b/process/constraints.py index 0001be1c0f..a64ef6ca2f 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -698,11 +698,8 @@ def constraint_equation_19(): + data_structure.tfcoil_variables.p_tf_leg_resistive_mw ) - cc = ( - totmva / data_structure.constraint_variables.mvalim - - 1.0 * data_structure.constraint_variables.fmva - ) - return ConstraintManager( + cc = totmva / data_structure.constraint_variables.mvalim - 1.0 + return ConstraintResult( cc, data_structure.constraint_variables.mvalim * (1.0 - cc), totmva * cc ) diff --git a/process/data_structure/rebco_variables.py b/process/data_structure/rebco_variables.py index 420999564d..ff21427e04 100644 --- a/process/data_structure/rebco_variables.py +++ b/process/data_structure/rebco_variables.py @@ -25,7 +25,7 @@ copper_rrr: float = None """residual resistivity ratio copper in TF superconducting cable""" -copperA_m2: float = None # noqa: N816 +coppera_m2: float = None """TF coil current / copper area (A/m2)""" coppera_m2_max: float = None @@ -85,7 +85,7 @@ def init_rebco_variables(): global a_croco_strand_hastelloy global a_croco_strand_solder global a_croco_strand - global copperA_m2 + global coppera_m2 global copperaoh_m2_max global f_copperaoh_m2 global copperaoh_m2 @@ -109,7 +109,7 @@ def init_rebco_variables(): a_croco_strand_solder = 0.0 a_croco_strand = 0.0 - copperA_m2 = 0.0 + coppera_m2 = 0.0 copperaoh_m2_max = 1.0e8 f_copperaoh_m2 = 1.0 copperaoh_m2 = 0.0 diff --git a/process/data_structure/stellarator_variables.py b/process/data_structure/stellarator_variables.py index 0fd7eeb161..889b23205c 100644 --- a/process/data_structure/stellarator_variables.py +++ b/process/data_structure/stellarator_variables.py @@ -121,6 +121,8 @@ def init_stellarator_variables(): global vporttmax global max_gyrotron_frequency global te0_ecrh_achievable + global powerht_constraint + global powerscaling_constraint first_call = True first_call_stfwbs = True @@ -149,3 +151,5 @@ def init_stellarator_variables(): vporttmax = 0.0 max_gyrotron_frequency = 1.0e9 te0_ecrh_achievable = 1.0e2 + powerht_constraint = 0.0 + powerscaling_constraint = 0.0 diff --git a/process/data_structure/superconducting_tf_coil_variables.py b/process/data_structure/superconducting_tf_coil_variables.py index af280c4243..43d8c2a99c 100644 --- a/process/data_structure/superconducting_tf_coil_variables.py +++ b/process/data_structure/superconducting_tf_coil_variables.py @@ -320,6 +320,7 @@ def init_superconducting_tf_coil_variables(): global f_a_tf_turn_cable_space_cooling global c_tf_turn_cables_critical global j_tf_superconductor + global vv_stress_quench is_leg_cp_temp_same = 0 tf_fit_t = 0.0 @@ -380,3 +381,4 @@ def init_superconducting_tf_coil_variables(): f_a_tf_turn_cable_space_cooling = 0.0 c_tf_turn_cables_critical = 0.0 j_tf_superconductor = 0.0 + vv_stress_quench = 0.0 diff --git a/process/tf_coil.py b/process/tf_coil.py index 9927b2e541..afc4708262 100644 --- a/process/tf_coil.py +++ b/process/tf_coil.py @@ -1847,7 +1847,7 @@ def outtf(self): self.outfile, "Actual TF coil current / copper area (A/m2)", "(copperA_m2)", - rebco_variables.copperA_m2, + rebco_variables.coppera_m2, ) # TF coil radial build diff --git a/tests/unit/test_constraints.py b/tests/unit/test_constraints.py new file mode 100644 index 0000000000..a4585094d4 --- /dev/null +++ b/tests/unit/test_constraints.py @@ -0,0 +1,27 @@ +import contextlib + +import pytest + +from process.constraints import ConstraintManager +from process.exceptions import ProcessValueError +from process.init import init_all_module_vars + + +@pytest.mark.parametrize( + "constraint_registration", + ConstraintManager._constraint_registry.values(), # noqa: SLF001 + ids=[f"constraint_{i}" for i in ConstraintManager._constraint_registry], # noqa: SLF001 +) +def test_constraint_functions(constraint_registration): + """A simple test that runs a constraint with PROCESS' default initialisation to check + that no attribute or type errors (etc) occur. + """ + init_all_module_vars() + + # Allow zero division errors because this means all of the attributes exist + # and are initialised with a number. + # Allow ProcessValueError because that happens when a constraint is incompatible with the + # default flags (i_pulsed_plant=0 or itart=0). + with contextlib.suppress(ZeroDivisionError, ProcessValueError): + # call the constraint equation and check no error occurs + constraint_registration.constraint_equation() From f0cccbb95fba6151c6f63c71be56ab49334d8501 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Tue, 21 Oct 2025 17:29:45 +0100 Subject: [PATCH 02/17] Remove F-values from constraint equations --- process/constraints.py | 420 ++++++----------- .../data_structure/constraint_variables.py | 427 ------------------ 2 files changed, 130 insertions(+), 717 deletions(-) diff --git a/process/constraints.py b/process/constraints.py index a64ef6ca2f..437f289359 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -355,7 +355,6 @@ def constraint_equation_5(): """Equation for density upper limit author: P B Lloyd, CCFE, Culham Science Centre - fdene: f-value for density limit nd_plasma_electrons_vol_avg: electron density (/m3) nd_plasma_electrons_max: density limit (/m3) nd_plasma_electron_line: line averaged electron density (m-3) @@ -374,18 +373,16 @@ def constraint_equation_5(): return ConstraintResult( data_structure.physics_variables.nd_plasma_electron_line / data_structure.physics_variables.nd_plasma_electrons_max - - 1.0 * data_structure.constraint_variables.fdene, - data_structure.constraint_variables.fdene - * data_structure.physics_variables.nd_plasma_electrons_max, - data_structure.constraint_variables.fdene - * data_structure.physics_variables.nd_plasma_electrons_max + - 1.0, + data_structure.physics_variables.nd_plasma_electrons_max, + data_structure.physics_variables.nd_plasma_electrons_max - data_structure.physics_variables.nd_plasma_electron_line, ) cc = ( data_structure.physics_variables.nd_plasma_electrons_vol_avg / data_structure.physics_variables.nd_plasma_electrons_max - - 1.0 * data_structure.constraint_variables.fdene + - 1.0 ) return ConstraintResult( cc, @@ -399,19 +396,14 @@ def constraint_equation_6(): """Equation for epsilon beta-poloidal upper limit author: P B Lloyd, CCFE, Culham Science Centre - fbeta_poloidal_eps: f-value for epsilon beta-poloidal beta_poloidal_eps_max: maximum (eps*beta_poloidal) eps: inverse aspect ratio beta_poloidal: poloidal beta """ cc = ( - ( - data_structure.physics_variables.eps - * data_structure.physics_variables.beta_poloidal_vol_avg - ) - / data_structure.physics_variables.beta_poloidal_eps_max - - 1.0 * data_structure.constraint_variables.fbeta_poloidal_eps - ) + data_structure.physics_variables.eps + * data_structure.physics_variables.beta_poloidal_vol_avg + ) / data_structure.physics_variables.beta_poloidal_eps_max - 1.0 return ConstraintResult( cc, data_structure.physics_variables.beta_poloidal_eps_max * (1.0 - cc), @@ -430,8 +422,7 @@ def constraint_equation_7(): i_plasma_ignited: switch for ignition assumption: - 0 do not assume plasma ignition - 1 assume ignited (but include auxiliary power in costs) - O - bviously, i_plasma_ignited must be zero if current drive is required. + Obviously, i_plasma_ignited must be zero if current drive is required. If i_plasma_ignited=1, any auxiliary power is assumed to be used only during plasma start-up, and is excluded from all steady-state power balance calculations. @@ -459,7 +450,6 @@ def constraint_equation_7(): def constraint_equation_8(): """Equation for neutron wall load upper limit - fpflux_fw_neutron_max_mw: f-value for maximum wall load pflux_fw_neutron_max_mw: allowable wall-load (MW/m2) pflux_fw_neutron_mw: average neutron wall load (MW/m2) """ @@ -467,12 +457,10 @@ def constraint_equation_8(): ( data_structure.physics_variables.pflux_fw_neutron_mw / data_structure.constraint_variables.pflux_fw_neutron_max_mw - - 1.0 * data_structure.constraint_variables.fpflux_fw_neutron_max_mw + - 1.0 ), - data_structure.constraint_variables.fpflux_fw_neutron_max_mw - * data_structure.constraint_variables.pflux_fw_neutron_max_mw, - data_structure.constraint_variables.fpflux_fw_neutron_max_mw - * data_structure.constraint_variables.pflux_fw_neutron_max_mw + data_structure.constraint_variables.pflux_fw_neutron_max_mw, + data_structure.constraint_variables.pflux_fw_neutron_max_mw - data_structure.physics_variables.pflux_fw_neutron_mw, ) @@ -481,14 +469,13 @@ def constraint_equation_8(): def constraint_equation_9(): """Equation for fusion power upper limit - fp_fusion_total_max_mw: f-value for maximum fusion power p_fusion_total_max_mw: maximum fusion power (MW) p_fusion_total_mw: fusion power (MW) """ cc = ( data_structure.physics_variables.p_fusion_total_mw / data_structure.constraint_variables.p_fusion_total_max_mw - - 1.0 * data_structure.constraint_variables.fp_fusion_total_max_mw + - 1.0 ) return ConstraintResult( cc, @@ -523,14 +510,12 @@ def constraint_equation_12(): vs_plasma_total_required: total V-s needed (Wb) vs_plasma_total_required (lower limit) is positive; vs_cs_pf_total_pulse (available) is negative - fvs_plasma_total_required: f-value for flux-swing (V-s) requirement (STEADY STATE) vs_cs_pf_total_pulse: total flux swing for pulse (Wb) """ # vs_cs_pf_total_pulse is negative, requires sign change cc = ( 1.0 - - data_structure.constraint_variables.fvs_plasma_total_required - * (-data_structure.pfcoil_variables.vs_cs_pf_total_pulse) + - (-data_structure.pfcoil_variables.vs_cs_pf_total_pulse) / data_structure.physics_variables.vs_plasma_total_required ) @@ -547,19 +532,15 @@ def constraint_equation_13(): author: P B Lloyd, CCFE, Culham Science Centre - ft_burn_min: f-value for minimum burn time t_plant_pulse_burn: burn time (s) (calculated if i_pulsed_plant=1) t_burn_min: minimum burn time (s) """ return ConstraintResult( 1.0 - - data_structure.constraint_variables.ft_burn_min - * data_structure.times_variables.t_plant_pulse_burn + - data_structure.times_variables.t_plant_pulse_burn / data_structure.constraint_variables.t_burn_min, + data_structure.constraint_variables.t_burn_min, data_structure.constraint_variables.t_burn_min - / data_structure.constraint_variables.ft_burn_min, - data_structure.constraint_variables.t_burn_min - / data_structure.constraint_variables.ft_burn_min - data_structure.times_variables.t_plant_pulse_burn, ) @@ -569,19 +550,16 @@ def constraint_equation_15(): """Equation for L-H power threshold limit author: P B Lloyd, CCFE, Culham Science Centre - fl_h_threshold: f-value for L-H power threshold p_l_h_threshold_mw: L-H mode power threshold (MW) p_plasma_separatrix_mw: power to conducted to the divertor region (MW) """ return ConstraintResult( 1.0 - - data_structure.constraint_variables.fl_h_threshold - * data_structure.physics_variables.p_plasma_separatrix_mw + - data_structure.physics_variables.p_plasma_separatrix_mw / data_structure.physics_variables.p_l_h_threshold_mw, data_structure.physics_variables.p_l_h_threshold_mw, data_structure.physics_variables.p_l_h_threshold_mw - - data_structure.physics_variables.p_plasma_separatrix_mw - / data_structure.constraint_variables.fl_h_threshold, + - data_structure.physics_variables.p_plasma_separatrix_mw, ) @@ -590,19 +568,16 @@ def constraint_equation_16(): """Equation for net electric power lower limit author: P B Lloyd, CCFE, Culham Science Centre - fp_plant_electric_net_required_mw: f-value for net electric power p_plant_electric_net_mw: net electric power (MW) p_plant_electric_net_required_mw: required net electric power (MW) """ return ConstraintResult( 1.0 - - data_structure.constraint_variables.fp_plant_electric_net_required_mw - * data_structure.heat_transport_variables.p_plant_electric_net_mw + - data_structure.heat_transport_variables.p_plant_electric_net_mw / data_structure.constraint_variables.p_plant_electric_net_required_mw, data_structure.constraint_variables.p_plant_electric_net_required_mw, data_structure.heat_transport_variables.p_plant_electric_net_mw - - data_structure.constraint_variables.p_plant_electric_net_required_mw - / data_structure.constraint_variables.fp_plant_electric_net_required_mw, + - data_structure.constraint_variables.p_plant_electric_net_required_mw, ) @@ -638,7 +613,6 @@ def constraint_equation_17(): pden_alpha_total_mw: alpha power per volume (MW/m3) pden_non_alpha_charged_mw: non-alpha charged particle fusion power per volume (MW/m3) pden_plasma_ohmic_mw: ohmic heating power per volume (MW/m3) - fradpwr: f-value for core radiation power limit pden_plasma_rad_mw: total radiation power per volume (MW/m3) """ # Maximum possible power/vol_plasma that can be radiated (local) @@ -651,10 +625,7 @@ def constraint_equation_17(): + data_structure.physics_variables.pden_plasma_ohmic_mw ) - cc = ( - data_structure.physics_variables.pden_plasma_rad_mw / pradmaxpv - - 1.0 * data_structure.constraint_variables.fradpwr - ) + cc = data_structure.physics_variables.pden_plasma_rad_mw / pradmaxpv - 1.0 return ConstraintResult( cc, pradmaxpv * (1.0 - cc), @@ -674,7 +645,7 @@ def constraint_equation_18(): cc = ( data_structure.divertor_variables.pflux_div_heat_load_mw / data_structure.divertor_variables.pflux_div_heat_load_max_mw - - 1.0 * data_structure.constraint_variables.fpflux_div_heat_load_mw + - 1.0 ) return ConstraintResult( cc, @@ -690,7 +661,6 @@ def constraint_equation_19(): p_cp_resistive_mw: peak resistive TF coil inboard leg power (total) (MW) p_tf_leg_resistive_mw: TF coil outboard leg resistive power (total) (MW) - fmva: f-value for maximum MVA mvalim: MVA limit for resistive TF coil set (total) (MW) """ totmva = ( @@ -709,14 +679,13 @@ def constraint_equation_20(): """Equation for neutral beam tangency radius upper limit author: P B Lloyd, CCFE, Culham Science Centre - fradius_beam_tangency: f-value for neutral beam tangency radius limit radius_beam_tangency_max: maximum tangency radius for centreline of beam (m) radius_beam_tangency: neutral beam centreline tangency radius (m) """ cc = ( data_structure.current_drive_variables.radius_beam_tangency / data_structure.current_drive_variables.radius_beam_tangency_max - - 1.0 * data_structure.constraint_variables.fradius_beam_tangency + - 1.0 ) return ConstraintResult( cc, @@ -730,14 +699,12 @@ def constraint_equation_21(): """Equation for minor radius lower limit author: P B Lloyd, CCFE, Culham Science Centre - frminor: f-value for minor radius limit rminor: plasma minor radius (m) aplasmin: minimum minor radius (m) """ cc = ( 1.0 - - data_structure.constraint_variables.frminor - * data_structure.physics_variables.rminor + - data_structure.physics_variables.rminor / data_structure.build_variables.aplasmin ) return ConstraintResult( @@ -756,7 +723,6 @@ def constraint_equation_23(): dr_fw_plasma_gap_outboard: gap between plasma and first wall, outboard side (m) dr_fw_outboard: outboard first wall thickness, initial estimate (m) dr_blkt_outboard: outboard blanket thickness (m) - fr_conducting_wall: f-value for conducting wall radius / rminor limit f_r_conducting_wall: maximum ratio of conducting wall distance to plasma minor radius for vertical stability """ # conducting shell radius (m) @@ -773,7 +739,7 @@ def constraint_equation_23(): data_structure.physics_variables.f_r_conducting_wall * data_structure.physics_variables.rminor ) - - 1.0 * data_structure.constraint_variables.fr_conducting_wall + - 1.0 ) return ConstraintManager( cc, @@ -794,10 +760,9 @@ def constraint_equation_24(): - 1 apply limit to thermal beta; - 2 apply limit to thermal + neutral beam beta - 3 apply limit to toroidal beta - istell: switch for stellarator option (set via device.dat): + istell: switch for stellarator option: - 0 use tokamak model; - 1 use stellarator model - fbeta_max: f-value for beta limit beta_vol_avg_max: allowable beta beta_total_vol_avg: total plasma beta (calculated if i_plasma_pedestal =3) beta_fast_alpha: fast alpha beta component @@ -813,45 +778,32 @@ def constraint_equation_24(): cc = ( data_structure.physics_variables.beta_total_vol_avg / data_structure.physics_variables.beta_vol_avg_max - - 1.0 * data_structure.constraint_variables.fbeta_max + - 1.0 ) con = data_structure.physics_variables.beta_vol_avg_max err = ( data_structure.physics_variables.beta_vol_avg_max - data_structure.physics_variables.beta_total_vol_avg - / data_structure.constraint_variables.fbeta_max ) # Here, the beta limit applies to only the thermal component, not the fast alpha or neutral beam parts elif data_structure.physics_variables.i_beta_component == 1: cc = ( - ( - data_structure.physics_variables.beta_total_vol_avg - - data_structure.physics_variables.beta_fast_alpha - - data_structure.physics_variables.beta_beam - ) - / data_structure.physics_variables.beta_vol_avg_max - - 1.0 * data_structure.constraint_variables.fbeta_max - ) + data_structure.physics_variables.beta_total_vol_avg + - data_structure.physics_variables.beta_fast_alpha + - data_structure.physics_variables.beta_beam + ) / data_structure.physics_variables.beta_vol_avg_max - 1.0 con = data_structure.physics_variables.beta_vol_avg_max - err = ( - data_structure.physics_variables.beta_vol_avg_max - - ( - data_structure.physics_variables.beta_total_vol_avg - - data_structure.physics_variables.beta_fast_alpha - - data_structure.physics_variables.beta_beam - ) - / data_structure.constraint_variables.fbeta_max + err = data_structure.physics_variables.beta_vol_avg_max - ( + data_structure.physics_variables.beta_total_vol_avg + - data_structure.physics_variables.beta_fast_alpha + - data_structure.physics_variables.beta_beam ) # Beta limit applies to thermal + neutral beam: components of the total beta, i.e. excludes alphas elif data_structure.physics_variables.i_beta_component == 2: cc = ( - ( - data_structure.physics_variables.beta_total_vol_avg - - data_structure.physics_variables.beta_fast_alpha - ) - / data_structure.physics_variables.beta_vol_avg_max - - 1.0 * data_structure.constraint_variables.fbeta_max - ) + data_structure.physics_variables.beta_total_vol_avg + - data_structure.physics_variables.beta_fast_alpha + ) / data_structure.physics_variables.beta_vol_avg_max - 1.0 con = data_structure.physics_variables.beta_vol_avg_max * (1.0 - cc) err = ( data_structure.physics_variables.beta_total_vol_avg @@ -872,17 +824,13 @@ def constraint_equation_24(): - 1.0 * data_structure.constraint_variables.fbeta_max ) con = data_structure.physics_variables.beta_vol_avg_max - err = ( - data_structure.physics_variables.beta_vol_avg_max - - ( - data_structure.physics_variables.beta_total_vol_avg - * ( - data_structure.physics_variables.b_plasma_total - / data_structure.physics_variables.b_plasma_toroidal_on_axis - ) - ** 2 + err = data_structure.physics_variables.beta_vol_avg_max - ( + data_structure.physics_variables.beta_total_vol_avg + * ( + data_structure.physics_variables.b_plasma_total + / data_structure.physics_variables.b_plasma_toroidal_on_axis ) - / data_structure.constraint_variables.fbeta_max + ** 2 ) return ConstraintResult(cc, con, err) @@ -893,14 +841,13 @@ def constraint_equation_25(): """Equation for peak toroidal field upper limit author: P B Lloyd, CCFE, Culham Science Centre - fb_tf_inboard_max: f-value for maximum toroidal field b_tf_inboard_max: maximum peak toroidal field (T) b_tf_inboard_peak_symmetric: mean peak field at TF coil (T) """ cc = ( data_structure.tfcoil_variables.b_tf_inboard_peak_symmetric / data_structure.constraint_variables.b_tf_inboard_max - - 1.0 * data_structure.constraint_variables.fb_tf_inboard_max + - 1.0 ) return ConstraintResult( cc, @@ -914,18 +861,16 @@ def constraint_equation_26(): """Equation for Central Solenoid current density upper limit at EOF author: P B Lloyd, CCFE, Culham Science Centre - fjohcreal: f-value for central solenoid current at end-of-flattop j_cs_critical_flat_top_end: allowable central solenoid current density at end of flat-top (A/m2) j_cs_flat_top_end: central solenoid overall current density at end of flat-top (A/m2) """ return ConstraintResult( data_structure.pfcoil_variables.j_cs_flat_top_end / data_structure.pfcoil_variables.j_cs_critical_flat_top_end - - 1.0 * data_structure.constraint_variables.fjohc, + - 1.0, data_structure.pfcoil_variables.j_cs_critical_flat_top_end, data_structure.pfcoil_variables.j_cs_critical_flat_top_end - - data_structure.pfcoil_variables.j_cs_flat_top_end - / data_structure.constraint_variables.fjohc, + - data_structure.pfcoil_variables.j_cs_flat_top_end, ) @@ -934,18 +879,16 @@ def constraint_equation_27(): """Equation for Central Solenoid current density upper limit at BOP author: P B Lloyd, CCFE, Culham Science Centre - fjohc0: f-value for central solenoid current at beginning of pulse j_cs_critical_pulse_start: allowable central solenoid current density at beginning of pulse (A/m2) j_cs_pulse_start: central solenoid overall current density at beginning of pulse (A/m2) """ return ConstraintResult( data_structure.pfcoil_variables.j_cs_pulse_start / data_structure.pfcoil_variables.j_cs_critical_pulse_start - - 1.0 * data_structure.constraint_variables.fjohc0, + - 1.0, data_structure.pfcoil_variables.j_cs_critical_pulse_start, data_structure.pfcoil_variables.j_cs_critical_pulse_start - - data_structure.pfcoil_variables.j_cs_pulse_start - / data_structure.constraint_variables.fjohc0, + - data_structure.pfcoil_variables.j_cs_pulse_start, ) @@ -954,7 +897,6 @@ def constraint_equation_28(): """Equation for fusion gain (big Q) lower limit author: P B Lloyd, CCFE, Culham Science Centre - fbig_q_plasma_min: pf-value for Q big_q_plasma: Fusion gain; P_fusion / (P_injection + P_ohmic) big_q_plasma_min: minimum fusion gain Q i_plasma_ignited : input integer : switch for ignition assumption: @@ -970,8 +912,7 @@ def constraint_equation_28(): cc = ( 1.0 - - data_structure.constraint_variables.fbig_q_plasma_min - * data_structure.current_drive_variables.big_q_plasma + - data_structure.current_drive_variables.big_q_plasma / data_structure.constraint_variables.big_q_plasma_min ) return ConstraintResult( @@ -1011,17 +952,15 @@ def constraint_equation_30(): author: P B Lloyd, CCFE, Culham Science Centre p_hcd_injected_total_mw: total auxiliary injected power (MW) - fp_hcd_injected_max: f-value for injection power p_hcd_injected_max: Maximum allowable value for injected power (MW) """ return ConstraintResult( data_structure.current_drive_variables.p_hcd_injected_total_mw / data_structure.current_drive_variables.p_hcd_injected_max - - 1.0 * data_structure.constraint_variables.fp_hcd_injected_max, + - 1.0, data_structure.current_drive_variables.p_hcd_injected_max, data_structure.current_drive_variables.p_hcd_injected_max - - data_structure.current_drive_variables.p_hcd_injected_total_mw - / data_structure.constraint_variables.fp_hcd_injected_max, + - data_structure.current_drive_variables.p_hcd_injected_total_mw, ) @@ -1030,18 +969,16 @@ def constraint_equation_31(): """Equation for TF coil case stress upper limit (SCTF) author: P B Lloyd, CCFE, Culham Science Centre - fstrcase: f-value for TF coil case stress sig_tf_case_max: Allowable maximum shear stress in TF coil case (Tresca criterion) (Pa) sig_tf_case: Constrained stress in TF coil case (Pa) """ return ConstraintResult( data_structure.tfcoil_variables.sig_tf_case / data_structure.tfcoil_variables.sig_tf_case_max - - 1.0 * data_structure.constraint_variables.fstrcase, + - 1.0, data_structure.tfcoil_variables.sig_tf_case_max, data_structure.tfcoil_variables.sig_tf_case_max - - data_structure.tfcoil_variables.sig_tf_case - / data_structure.constraint_variables.fstrcase, + - data_structure.tfcoil_variables.sig_tf_case, ) @@ -1050,18 +987,16 @@ def constraint_equation_32(): """Equation for TF coil conduit stress upper limit (SCTF) author: P B Lloyd, CCFE, Culham Science Centre - fstrcond: f-value for TF coil conduit stress sig_tf_wp_max: Allowable maximum shear stress in TF coil conduit (Tresca criterion) (Pa) sig_tf_wp: Constrained stress in TF conductor conduit (Pa) """ return ConstraintResult( data_structure.tfcoil_variables.sig_tf_wp / data_structure.tfcoil_variables.sig_tf_wp_max - - 1.0 * data_structure.constraint_variables.fstrcond, + - 1.0, data_structure.tfcoil_variables.sig_tf_wp_max, data_structure.tfcoil_variables.sig_tf_wp_max - - data_structure.tfcoil_variables.sig_tf_wp - / data_structure.constraint_variables.fstrcond, + - data_structure.tfcoil_variables.sig_tf_wp, ) @@ -1071,17 +1006,14 @@ def constraint_equation_33(): author: P B Lloyd, CCFE, Culham Science Centre args : output structure : residual error; constraint value; - fiooic: f-value for TF coil operating current / critical j_tf_wp_critical: critical current density for winding pack (A/m2) j_tf_wp: winding pack current density (A/m2) """ - if data_structure.constraint_variables.fiooic > 0.7: - logger.error("fiooic shouldn't be above 0.7 for engineering reliability") cc = ( data_structure.tfcoil_variables.j_tf_wp / data_structure.tfcoil_variables.j_tf_wp_critical - - 1.0 * data_structure.constraint_variables.fiooic + - 1.0 ) return ConstraintResult( cc, @@ -1095,14 +1027,13 @@ def constraint_equation_34(): """Equation for TF coil dump voltage upper limit (SCTF) author: P B Lloyd, CCFE, Culham Science Centre - fvdump: f-value for dump voltage v_tf_coil_dump_quench_max_kv: max voltage across TF coil during quench (kV) v_tf_coil_dump_quench_kv: voltage across a TF coil during quench (kV) """ return ConstraintResult( data_structure.tfcoil_variables.v_tf_coil_dump_quench_kv / data_structure.tfcoil_variables.v_tf_coil_dump_quench_max_kv - - 1.0 * data_structure.constraint_variables.fvdump, + - 1.0, data_structure.tfcoil_variables.v_tf_coil_dump_quench_max_kv, data_structure.tfcoil_variables.v_tf_coil_dump_quench_max_kv - data_structure.tfcoil_variables.v_tf_coil_dump_quench_kv, @@ -1114,7 +1045,6 @@ def constraint_equation_35(): """Equation for TF coil J_wp/J_prot upper limit (SCTF) author: P B Lloyd, CCFE, Culham Science Centre - fjprot: f-value for TF coil winding pack current density j_tf_wp_quench_heat_max: allowable TF coil winding pack current density, for dump temperature rise protection (A/m2) j_tf_wp: winding pack current density (A/m2) @@ -1122,7 +1052,7 @@ def constraint_equation_35(): return ConstraintResult( data_structure.tfcoil_variables.j_tf_wp / data_structure.tfcoil_variables.j_tf_wp_quench_heat_max - - 1.0 * data_structure.constraint_variables.fjprot, + - 1.0, data_structure.tfcoil_variables.j_tf_wp_quench_heat_max, data_structure.tfcoil_variables.j_tf_wp - data_structure.tfcoil_variables.j_tf_wp_quench_heat_max, @@ -1134,14 +1064,12 @@ def constraint_equation_36(): """Equation for TF coil s/c temperature margin lower limit (SCTF) author: P B Lloyd, CCFE, Culham Science Centre - ftmargtf: f-value for TF coil temperature margin temp_tf_superconductor_margin: TF coil temperature margin (K) temp_tf_superconductor_margin_min: minimum allowable temperature margin : TF coils (K) """ return ConstraintResult( 1.0 - - data_structure.constraint_variables.ftmargtf - * data_structure.tfcoil_variables.temp_tf_superconductor_margin + - data_structure.tfcoil_variables.temp_tf_superconductor_margin / data_structure.tfcoil_variables.temp_tf_superconductor_margin_min, data_structure.tfcoil_variables.temp_tf_superconductor_margin_min, data_structure.tfcoil_variables.temp_tf_superconductor_margin_min @@ -1154,14 +1082,13 @@ def constraint_equation_37(): """Equation for current drive gamma upper limit author: P B Lloyd, CCFE, Culham Science Centre - feta_cd_norm_hcd_primary_max: f-value for current drive gamma eta_cd_norm_hcd_primary_max: maximum current drive gamma eta_cd_norm_hcd_primary: normalised current drive efficiency (1.0e20 A/W-m2) """ cc = ( data_structure.current_drive_variables.eta_cd_norm_hcd_primary / data_structure.constraint_variables.eta_cd_norm_hcd_primary_max - - 1.0 * data_structure.constraint_variables.feta_cd_norm_hcd_primary_max + - 1.0 ) return ConstraintResult( cc, @@ -1175,7 +1102,6 @@ def constraint_equation_39(): """Equation for first wall temperature upper limit author: P B Lloyd, CCFE, Culham Science Centre - ftemp_fw_max: f-value for first wall peak temperature temp_fw_max: maximum temperature of first wall material (K) (i_thermal_electric_conversion>1) temp_fw_peak: peak first wall temperature (K) """ @@ -1186,7 +1112,7 @@ def constraint_equation_39(): cc = ( data_structure.fwbs_variables.temp_fw_peak / data_structure.fwbs_variables.temp_fw_max - - 1.0 * data_structure.constraint_variables.ftemp_fw_max + - 1.0 ) return ConstraintResult( cc, @@ -1200,14 +1126,12 @@ def constraint_equation_40(): """Equation for auxiliary power lower limit author: P B Lloyd, CCFE, Culham Science Centre - fp_hcd_injected_min_mw: f-value for minimum auxiliary power p_hcd_injected_total_mw: total auxiliary injected power (MW) p_hcd_injected_min_mw: minimum auxiliary power (MW) """ cc = ( 1.0 - - data_structure.constraint_variables.fp_hcd_injected_min_mw - * data_structure.current_drive_variables.p_hcd_injected_total_mw + - data_structure.current_drive_variables.p_hcd_injected_total_mw / data_structure.constraint_variables.p_hcd_injected_min_mw ) return ConstraintResult( @@ -1222,14 +1146,12 @@ def constraint_equation_41(): """Equation for plasma current ramp-up time lower limit author: P B Lloyd, CCFE, Culham Science Centre - ft_current_ramp_up: f-value for plasma current ramp-up time t_plant_pulse_plasma_current_ramp_up: plasma current ramp-up time for current initiation (s) t_current_ramp_up_min: minimum plasma current ramp-up time (s) """ cc = ( 1.0 - - data_structure.constraint_variables.ft_current_ramp_up - * data_structure.times_variables.t_plant_pulse_plasma_current_ramp_up + - data_structure.times_variables.t_plant_pulse_plasma_current_ramp_up / data_structure.constraint_variables.t_current_ramp_up_min ) return ConstraintResult( @@ -1244,7 +1166,6 @@ def constraint_equation_42(): """Equation for cycle time lower limit author: P B Lloyd, CCFE, Culham Science Centre - ft_cycle_min: f-value for cycle time t_plant_pulse_total: full cycle time (s) t_cycle_min: minimum cycle time (s) """ @@ -1255,8 +1176,7 @@ def constraint_equation_42(): cc = ( 1.0 - - data_structure.constraint_variables.ft_cycle_min - * data_structure.times_variables.t_plant_pulse_total + - data_structure.times_variables.t_plant_pulse_total / data_structure.constraint_variables.t_cycle_min ) return ConstraintResult( @@ -1297,7 +1217,6 @@ def constraint_equation_44(): """Equation for centrepost temperature upper limit (TART) author: P B Lloyd, CCFE, Culham Science Centre - fptemp: f-value for peak centrepost temperature temp_cp_max: maximum peak centrepost temperature (K) temp_cp_peak: peak centrepost temperature (K) itart: switch for spherical tokamak (ST) models: @@ -1314,7 +1233,7 @@ def constraint_equation_44(): temp_cp_max = data_structure.tfcoil_variables.temp_cp_max temp_cp_peak = data_structure.tfcoil_variables.temp_cp_peak - cc = temp_cp_peak / temp_cp_max - 1.0 * data_structure.constraint_variables.fptemp + cc = temp_cp_peak / temp_cp_max - 1.0 return ConstraintResult(cc, temp_cp_max * (1.0 - cc), temp_cp_peak * cc) @@ -1323,7 +1242,6 @@ def constraint_manager_45(): """Equation for edge safety factor lower limit (TART) author: P B Lloyd, CCFE, Culham Science Centre - fq95_min: f-value for edge safety factor q95 : safety factor 'near' plasma edge (unless i_plasma_current = 2 (ST current scaling), in which case q = mean edge safety factor qbar) q95_min: lower limit for edge safety factor @@ -1335,8 +1253,7 @@ def constraint_manager_45(): cc = ( 1.0 - - data_structure.constraint_variables.fq95_min - * data_structure.physics_variables.q95 + - data_structure.physics_variables.q95 / data_structure.physics_variables.q95_min ) return ConstraintResult( @@ -1352,7 +1269,6 @@ def constraint_equation_46(): author: P B Lloyd, CCFE, Culham Science Centre eps: inverse aspect ratio - fipir: f-value for Ip/Irod upper limit c_tf_total: total (summed) current in TF coils (A) plasma_current: plasma current (A) itart: switch for spherical tokamak (ST) models: @@ -1367,7 +1283,7 @@ def constraint_equation_46(): cc = ( data_structure.physics_variables.plasma_current / data_structure.tfcoil_variables.c_tf_total - ) / cratmx - 1.0 * data_structure.constraint_variables.fipir + ) / cratmx - 1.0 return ConstraintResult( cc, @@ -1383,14 +1299,13 @@ def constraint_equation_48(): """Equation for poloidal beta upper limit author: P B Lloyd, CCFE, Culham Science Centre - fbeta_poloidal: rf-value for poloidal beta beta_poloidal_max: maximum poloidal beta beta_poloidal: poloidal beta """ cc = ( data_structure.physics_variables.beta_poloidal_vol_avg / data_structure.constraint_variables.beta_poloidal_max - - 1.0 * data_structure.constraint_variables.fbeta_poloidal + - 1.0 ) return ConstraintResult( cc, @@ -1405,10 +1320,7 @@ def constraint_equation_50(): author: P B Lloyd, CCFE, Culham Science Centre author: S I Muldrew, CCFE, Culham Science Centre """ - cc = ( - data_structure.ife_variables.reprat / data_structure.ife_variables.rrmax - - 1.0 * data_structure.ife_variables.frrmax - ) + cc = data_structure.ife_variables.reprat / data_structure.ife_variables.rrmax - 1.0 return ConstraintResult( cc, data_structure.ife_variables.rrmax * (1.0 - cc), @@ -1425,7 +1337,7 @@ def constraint_equation_51(): vs_plasma_ind_ramp: internal and external plasma inductance V-s (Wb)) vs_cs_pf_total_ramp: total flux swing for startup (Wb) """ - cc = 1.0 - data_structure.pfcoil_variables.fvs_cs_pf_total_ramp * abs( + cc = 1.0 - abs( ( data_structure.physics_variables.vs_plasma_res_ramp + data_structure.physics_variables.vs_plasma_ind_ramp @@ -1444,15 +1356,12 @@ def constraint_equation_52(): """Equation for tritium breeding ratio lower limit author: P B Lloyd, CCFE, Culham Science Centre - ftbr: f-value for minimum tritium breeding ratio tbr: tritium breeding ratio (i_blanket_type=2,3 (KIT HCPB/HCLL)) tbrmin: minimum tritium breeding ratio (If i_blanket_type=1, tbrmin=minimum 5-year time-averaged tritium breeding ratio) """ cc = ( 1.0 - - data_structure.constraint_variables.ftbr - * data_structure.fwbs_variables.tbr - / data_structure.constraint_variables.tbrmin + - data_structure.fwbs_variables.tbr / data_structure.constraint_variables.tbrmin ) return ConstraintResult( cc, @@ -1466,14 +1375,13 @@ def constraint_equation_53(): """Equation for fast neutron fluence on TF coil upper limit author: P B Lloyd, CCFE, Culham Science Centre - fflutf: f-value for maximum TF coil nuclear heating nflutfmax: max fast neutron fluence on TF coil (n/m2) nflutf: peak fast neutron fluence on TF coil superconductor (n/m2) """ cc = ( data_structure.fwbs_variables.nflutf / data_structure.constraint_variables.nflutfmax - - 1.0 * data_structure.constraint_variables.fflutf + - 1.0 ) return ConstraintResult( cc, @@ -1487,14 +1395,13 @@ def constraint_equation_54(): """Equation for peak TF coil nuclear heating upper limit author: P B Lloyd, CCFE, Culham Science Centre - fptfnuc: f-value for maximum TF coil nuclear heating ptfnucmax: maximum nuclear heating in TF coil (MW/m3) ptfnucpm3: nuclear heating in the TF coil (MW/m3) (blktmodel>0) """ cc = ( data_structure.fwbs_variables.ptfnucpm3 / data_structure.constraint_variables.ptfnucmax - - 1.0 * data_structure.constraint_variables.fptfnuc + - 1.0 ) return ConstraintResult( cc, @@ -1508,19 +1415,14 @@ def constraint_equation_56(): """Equation for power through separatrix / major radius upper limit author: P B Lloyd, CCFE, Culham Science Centre - fpsepr: f-value for maximum Psep/R limit pseprmax: maximum ratio of power crossing the separatrix to plasma major radius (Psep/R) (MW/m) p_plasma_separatrix_mw: power to be conducted to the divertor region (MW) rmajor: plasma major radius (m) """ cc = ( - ( - data_structure.physics_variables.p_plasma_separatrix_mw - / data_structure.physics_variables.rmajor - ) - / data_structure.constraint_variables.pseprmax - - 1.0 * data_structure.constraint_variables.fpsepr - ) + data_structure.physics_variables.p_plasma_separatrix_mw + / data_structure.physics_variables.rmajor + ) / data_structure.constraint_variables.pseprmax - 1.0 return ConstraintResult( cc, data_structure.constraint_variables.pseprmax * (1.0 - cc), @@ -1537,14 +1439,13 @@ def constraint_equation_59(): """Equation for neutral beam shine-through fraction upper limit author: P B Lloyd, CCFE, Culham Science Centre - fnbshinef: f-value for maximum neutral beam shine-through fraction f_p_beam_shine_through_max: maximum neutral beam shine-through fraction f_p_beam_shine_through: neutral beam shine-through fraction """ cc = ( data_structure.current_drive_variables.f_p_beam_shine_through / data_structure.constraint_variables.f_p_beam_shine_through_max - - 1.0 * data_structure.constraint_variables.fnbshinef + - 1.0 ) return ConstraintResult( cc, @@ -1558,14 +1459,12 @@ def constraint_equation_60(): """Equation for Central Solenoid s/c temperature margin lower limit author: P B Lloyd, CCFE, Culham Science Centre - ftmargoh: f-value for central solenoid temperature margin temp_cs_superconductor_margin: Central solenoid temperature margin (K) temp_cs_superconductor_margin_min: Minimum allowable temperature margin : CS (K) """ return ConstraintResult( 1.0 - - data_structure.constraint_variables.ftmargoh - * data_structure.pfcoil_variables.temp_cs_superconductor_margin + - data_structure.pfcoil_variables.temp_cs_superconductor_margin / data_structure.tfcoil_variables.temp_cs_superconductor_margin_min, data_structure.tfcoil_variables.temp_cs_superconductor_margin_min, data_structure.tfcoil_variables.temp_cs_superconductor_margin_min @@ -1578,15 +1477,12 @@ def constraint_equation_61(): """Equation for availability lower limit author: P B Lloyd, CCFE, Culham Science Centre - favail: F-value for minimum availability cfactr: Total plant availability fraction avail_min: Minimum availability """ cc = ( 1.0 - - data_structure.cost_variables.favail - * data_structure.cost_variables.cfactr - / data_structure.cost_variables.avail_min + - data_structure.cost_variables.cfactr / data_structure.cost_variables.avail_min ) return ConstraintResult( cc, @@ -1600,15 +1496,13 @@ def constraint_equation_62(): """Lower limit on f_alpha_energy_confinement the ratio of alpha particle to energy confinement times author: P B Lloyd, CCFE, Culham Science Centre - falpha_energy_confinement: f-value for lower limit on f_alpha_energy_confinement the ratio of alpha particle to energy confinement t_alpha_confinement: alpha particle confinement time (s) t_energy_confinement: global thermal energy confinement time (sec) f_alpha_energy_confinement_min: Lower limit on f_alpha_energy_confinement the ratio of alpha particle to energy confinement times """ cc = ( 1.0 - - data_structure.constraint_variables.falpha_energy_confinement - * ( + - ( data_structure.physics_variables.t_alpha_confinement / data_structure.physics_variables.t_energy_confinement ) @@ -1630,14 +1524,13 @@ def constraint_equation_63(): """Upper limit on n_iter_vacuum_pumps (i_vacuum_pumping = simple) author: P B Lloyd, CCFE, Culham Science Centre - fniterpump: f-value for constraint that number of pumps < tfno tfno: number of TF coils (default = 50 for stellarators) n_iter_vacuum_pumps: number of high vacuum pumps (real number), each with the throughput """ cc = ( data_structure.vacuum_variables.n_iter_vacuum_pumps / data_structure.tfcoil_variables.n_tf_coils - - 1.0 * data_structure.constraint_variables.fniterpump + - 1.0 ) return ConstraintResult( cc, @@ -1651,19 +1544,18 @@ def constraint_equation_64(): """Upper limit on Zeff author: P B Lloyd, CCFE, Culham Science Centre - fzeff_max: f-value for maximum n_charge_plasma_effective_vol_avg zeff_max: maximum value for Zeff n_charge_plasma_effective_vol_avg: plasma effective charge """ cc = ( data_structure.physics_variables.n_charge_plasma_effective_vol_avg / data_structure.constraint_variables.zeff_max - - 1.0 * data_structure.constraint_variables.fzeff_max + - 1.0 ) return ConstraintResult( cc, - data_structure.constraint_variables.fzeff_max, - data_structure.constraint_variables.fzeff_max * cc, + data_structure.constraint_variables.zeff_max, + data_structure.constraint_variables.zeff_max * cc, ) @@ -1672,14 +1564,13 @@ def constraint_equation_65(): """Upper limit on stress of the vacuum vessel that occurs when the TF coil quenches. author: Timothy Nunn, UKAEA - fmaxvvstress: f-value for constraint on maximum VV stress max_vv_stress: Maximum permitted stress of the VV (Pa) vv_stress_quench: Stress of the VV (Pa) """ cc = ( data_structure.superconducting_tf_coil_variables.vv_stress_quench / data_structure.tfcoil_variables.max_vv_stress - - 1.0 * data_structure.constraint_variables.fmaxvvstress + - 1.0 ) return ConstraintResult( cc, @@ -1693,14 +1584,13 @@ def constrain_equation_66(): """Upper limit on rate of change of energy in poloidal field author: P B Lloyd, CCFE, Culham Science Centre - fpoloidalpower: f-value for constraint on rate of change of energy in poloidal field maxpoloidalpower: Maximum permitted absolute rate of change of stored energy in poloidal field (MW) peakpoloidalpower: Peak absolute rate of change of stored energy in poloidal field (MW) (11/01/16) """ cc = ( data_structure.pf_power_variables.peakpoloidalpower / data_structure.pf_power_variables.maxpoloidalpower - - 1.0 * data_structure.constraint_variables.fpoloidalpower + - 1.0 ) return ConstraintResult( cc, @@ -1714,14 +1604,13 @@ def constraint_equation_67(): """Simple upper limit on radiation wall load author: P B Lloyd, CCFE, Culham Science Centre - fpflux_fw_rad_max: f-value for upper limit on radiation wall load pflux_fw_rad_max: Maximum permitted radiation wall load (MW/m^2) pflux_fw_rad_max_mw: Peak radiation wall load (MW/m^2) """ cc = ( data_structure.constraint_variables.pflux_fw_rad_max_mw / data_structure.constraint_variables.pflux_fw_rad_max - - 1.0 * data_structure.constraint_variables.fpflux_fw_rad_max + - 1.0 ) return ConstraintResult( cc, @@ -1735,7 +1624,6 @@ def constraint_equation_68(): """Upper limit on Psep scaling (PsepB/qAR) author: P B Lloyd, CCFE, Culham Science Centre - fpsepbqar: f-value for upper limit on psepbqar, maximum Psep*Bt/qAR limit psepbqarmax: maximum permitted value of ratio of Psep*Bt/qAR (MWT/m) p_plasma_separatrix_mw: Power to conducted to the divertor region (MW) b_plasma_toroidal_on_axis: toroidal field on axis (T) (iteration variable 2) @@ -1748,19 +1636,15 @@ def constraint_equation_68(): if data_structure.constraint_variables.i_q95_fixed == 1: cc = ( ( - ( - data_structure.physics_variables.p_plasma_separatrix_mw - * data_structure.physics_variables.b_plasma_toroidal_on_axis - ) - / ( - data_structure.constraint_variables.q95_fixed - * data_structure.physics_variables.aspect - * data_structure.physics_variables.rmajor - ) + data_structure.physics_variables.p_plasma_separatrix_mw + * data_structure.physics_variables.b_plasma_toroidal_on_axis ) - / data_structure.constraint_variables.psepbqarmax - - 1.0 * data_structure.constraint_variables.fpsepbqar - ) + / ( + data_structure.constraint_variables.q95_fixed + * data_structure.physics_variables.aspect + * data_structure.physics_variables.rmajor + ) + ) / data_structure.constraint_variables.psepbqarmax - 1.0 err = ( data_structure.physics_variables.p_plasma_separatrix_mw * data_structure.physics_variables.b_plasma_toroidal_on_axis @@ -1772,19 +1656,15 @@ def constraint_equation_68(): else: cc = ( ( - ( - data_structure.physics_variables.p_plasma_separatrix_mw - * data_structure.physics_variables.b_plasma_toroidal_on_axis - ) - / ( - data_structure.physics_variables.q95 - * data_structure.physics_variables.aspect - * data_structure.physics_variables.rmajor - ) + data_structure.physics_variables.p_plasma_separatrix_mw + * data_structure.physics_variables.b_plasma_toroidal_on_axis ) - / data_structure.constraint_variables.psepbqarmax - - 1.0 * data_structure.constraint_variables.fpsepbqar - ) + / ( + data_structure.physics_variables.q95 + * data_structure.physics_variables.aspect + * data_structure.physics_variables.rmajor + ) + ) / data_structure.constraint_variables.psepbqarmax - 1.0 err = ( data_structure.physics_variables.p_plasma_separatrix_mw * data_structure.physics_variables.b_plasma_toroidal_on_axis @@ -1812,7 +1692,6 @@ def constraint_equation_72(): Reverse the sign so it works as an inequality constraint (tmp_cc > 0) This will have no effect if it is used as an equality constraint because it will be squared. - foh_stress: f-value for Tresca yield criterion in Central Solenoid alstroh: allowable hoop stress in Central Solenoid structural material (Pa) s_shear_cs_peak: Maximum shear stress coils/central solenoid (Pa) sig_tf_cs_bucked: Maximum shear stress in CS case at flux swing (no current in CS) @@ -1830,7 +1709,7 @@ def constraint_equation_72(): data_structure.tfcoil_variables.sig_tf_cs_bucked, ) / data_structure.pfcoil_variables.alstroh - - 1.0 * data_structure.constraint_variables.foh_stress + - 1.0 ) err = data_structure.pfcoil_variables.alstroh - max( data_structure.pfcoil_variables.s_shear_cs_peak, @@ -1841,7 +1720,7 @@ def constraint_equation_72(): cc = ( data_structure.pfcoil_variables.s_shear_cs_peak / data_structure.pfcoil_variables.alstroh - - 1.0 * data_structure.constraint_variables.foh_stress + - 1.0 ) err = ( data_structure.pfcoil_variables.alstroh @@ -1857,19 +1736,13 @@ def constraint_equation_73(): Related to constraint 15 author: P B Lloyd, CCFE, Culham Science Centre - fplhsep: F-value for Psep >= Plh + Paux : for consistency of two values of separatrix power p_l_h_threshold_mw: L-H mode power threshold (MW) p_plasma_separatrix_mw: power to be conducted to the divertor region (MW) p_hcd_injected_total_mw : inout real : total auxiliary injected power (MW) """ - cc = ( - 1.0 - - data_structure.physics_variables.fplhsep - * data_structure.physics_variables.p_plasma_separatrix_mw - / ( - data_structure.physics_variables.p_l_h_threshold_mw - + data_structure.current_drive_variables.p_hcd_injected_total_mw - ) + cc = 1.0 - data_structure.physics_variables.p_plasma_separatrix_mw / ( + data_structure.physics_variables.p_l_h_threshold_mw + + data_structure.current_drive_variables.p_hcd_injected_total_mw ) return ConstraintResult( cc, @@ -1884,14 +1757,13 @@ def constraint_equation_74(): ONLY used for croco HTS coil author: P B Lloyd, CCFE, Culham Science Centre - ftemp_croco_quench_max: f-value: TF coil quench temparature remains below temp_croco_quench_max temp_croco_quench: CroCo strand: Actual temp reached during a quench (K) temp_croco_quench_max: CroCo strand: maximum permitted temp during a quench (K) """ cc = ( data_structure.tfcoil_variables.temp_croco_quench / data_structure.tfcoil_variables.temp_croco_quench_max - - 1.0 * data_structure.constraint_variables.ftemp_croco_quench_max + - 1.0 ) return ConstraintResult( cc, @@ -1908,12 +1780,11 @@ def constraint_equation_75(): copperA_m2: TF coil current / copper area (A/m2) copperA_m2_max: Maximum TF coil current / copper area (A/m2) - f_coppera_m2: f-value for TF coil current / copper area < copperA_m2_max """ cc = ( data_structure.rebco_variables.coppera_m2 / data_structure.rebco_variables.coppera_m2_max - - 1.0 * data_structure.rebco_variables.f_coppera_m2 + - 1.0 ) return ConstraintResult( cc, @@ -1937,7 +1808,6 @@ def constraint_equation_76(): aspect: aspect ratio (iteration variable 1) p_plasma_separatrix_mw: power to conducted to the divertor region (MW) nd_plasma_electron_max_array(7)array : density limit (/m3) as calculated using various models - fnesep: f-value for Eich critical separatrix density """ # TODO: why on earth are these variables being set here!? Should they be local? data_structure.physics_variables.alpha_crit = ( @@ -1961,7 +1831,7 @@ def constraint_equation_76(): cc = ( data_structure.physics_variables.nd_plasma_separatrix_electron / data_structure.physics_variables.nd_plasma_separatrix_electron_eich_max - - 1.0 * data_structure.constraint_variables.fnesep + - 1.0 ) return ConstraintResult( cc, @@ -1975,14 +1845,13 @@ def constraint_equation_77(): """Equation for maximum TF current per turn upper limit author: P B Lloyd, CCFE, Culham Science Centre - fc_tf_turn_max: f-value for TF coil current per turn c_tf_turn_max : allowable TF coil current per turn [A/turn] c_tf_turn : TF coil current per turn [A/turn] """ cc = ( data_structure.tfcoil_variables.c_tf_turn / data_structure.tfcoil_variables.c_tf_turn_max - - 1.0 * data_structure.constraint_variables.fc_tf_turn_max + - 1.0 ) return ConstraintResult( cc, @@ -1996,14 +1865,12 @@ def constraint_equation_78(): """Equation for Reinke criterion, divertor impurity fraction lower limit author: P B Lloyd, CCFE, Culham Science Centre - freinke : input : f-value for Reinke criterion (itv 147) fzmin : input : minimum impurity fraction from Reinke model fzactual : input : actual impurity fraction """ cc = ( 1.0 - - data_structure.constraint_variables.freinke - * data_structure.reinke_variables.fzactual + - data_structure.reinke_variables.fzactual / data_structure.reinke_variables.fzmin ) return ConstraintResult( @@ -2018,7 +1885,6 @@ def constraint_equation_79(): """Equation for maximum CS field author: P B Lloyd, CCFE, Culham Science Centre - fb_cs_limit_max: F-value for CS mmax field (cons. 79, itvar 149) b_cs_limit_max: Central solenoid max field limit [T] b_cs_peak_pulse_start: maximum field in central solenoid at beginning of pulse (T) b_cs_peak_flat_top_end: maximum field in central solenoid at end of flat-top (EoF) (T) @@ -2030,7 +1896,7 @@ def constraint_equation_79(): data_structure.pfcoil_variables.b_cs_peak_pulse_start, ) / data_structure.pfcoil_variables.b_cs_limit_max - - 1.0 * data_structure.pfcoil_variables.fb_cs_limit_max + - 1.0 ) return ConstraintResult( cc, @@ -2050,17 +1916,13 @@ def constraint_equation_80(): args : output structure : residual error; constraint value; residual error in physical units; output string; units string Lower limit p_plasma_separatrix_mw - #=# physics - #=#=# fp_plasma_separatrix_min_mw, p_plasma_separatrix_mw - Logic change during pre-factoring: err, symbol, units will be assigned only if present. - fp_plasma_separatrix_min_mw : input : F-value for lower limit on p_plasma_separatrix_mw (cons. 80, itvar 153) + p_plasma_separatrix_min_mw : input : Minimum power crossing separatrix p_plasma_separatrix_mw [MW] p_plasma_separatrix_mw : input : Power crossing separatrix [MW] """ cc = ( 1.0 - - data_structure.physics_variables.fp_plasma_separatrix_min_mw - * data_structure.physics_variables.p_plasma_separatrix_mw + - data_structure.physics_variables.p_plasma_separatrix_mw / data_structure.constraint_variables.p_plasma_separatrix_min_mw ) return ConstraintResult( @@ -2077,18 +1939,13 @@ def constraint_equation_81(): args : output structure : residual error; constraint value; residual error in physical units; output string; units string Lower limit nd_plasma_electron_on_axis > nd_plasma_pedestal_electron - !#=# physics - !#=#=# nd_plasma_electron_on_axis, nd_plasma_pedestal_electron - Logic change during pre-factoring: err, symbol, units will be - assigned only if present. - fne0 : input : F-value for constraint on nd_plasma_electron_on_axis > nd_plasma_pedestal_electron + nd_plasma_electron_on_axis : input : Central electron density [m-3] nd_plasma_pedestal_electron : input : Electron density at pedestal [m-3] """ cc = ( 1.0 - - data_structure.physics_variables.fne0 - * data_structure.physics_variables.nd_plasma_electron_on_axis + - data_structure.physics_variables.nd_plasma_electron_on_axis / data_structure.physics_variables.nd_plasma_pedestal_electron ) return ConstraintResult( @@ -2103,19 +1960,16 @@ def constraint_equation_82(): """Equation for toroidal consistency of stellarator build author: J Lion, IPP Greifswald - ftoroidalgap: f-value for constraint toroidalgap > dx_tf_inboard_out_toroidal toroidalgap: minimal gap between two stellarator coils dx_tf_inboard_out_toroidal: total toroidal width of a tf coil """ return ConstraintResult( 1.0 - - data_structure.tfcoil_variables.ftoroidalgap - * data_structure.tfcoil_variables.toroidalgap + - data_structure.tfcoil_variables.toroidalgap / data_structure.tfcoil_variables.dx_tf_inboard_out_toroidal, data_structure.tfcoil_variables.toroidalgap, data_structure.tfcoil_variables.toroidalgap - - data_structure.tfcoil_variables.dx_tf_inboard_out_toroidal - / data_structure.tfcoil_variables.ftoroidalgap, + - data_structure.tfcoil_variables.dx_tf_inboard_out_toroidal, ) @@ -2124,14 +1978,12 @@ def constraint_equation_83(): """Equation for radial consistency of stellarator build author: J Lion, IPP Greifswald - f_avspace: f-value for constraint available_radial_space > required_radial_space available_radial_space: avaible space in radial direction as given by each s.-configuration required_radial_space: required space in radial direction """ cc = ( 1.0 - - data_structure.build_variables.f_avspace - * data_structure.build_variables.available_radial_space + - data_structure.build_variables.available_radial_space / data_structure.build_variables.required_radial_space ) return ConstraintResult( @@ -2146,14 +1998,12 @@ def constraint_equation_84(): """Equation for the lower limit of beta author: J Lion, IPP Greifswald - fbeta_min: f-value for constraint beta-beta_fast_alpha > beta_vol_avg_min beta_vol_avg_min: Lower limit for beta beta: plasma beta """ cc = ( 1.0 - - data_structure.constraint_variables.fbeta_min - * data_structure.physics_variables.beta_total_vol_avg + - data_structure.physics_variables.beta_total_vol_avg / data_structure.physics_variables.beta_vol_avg_min ) return ConstraintResult( @@ -2222,13 +2072,12 @@ def constraint_equation_86(): Author : S Kahn dx_tf_turn_general: TF coil turn edge length including turn insulation [m] - f_t_turn_tf: f-value for TF turn edge length constraint t_turn_tf_max: TF turn edge length including turn insulation upper limit [m] """ cc = ( data_structure.tfcoil_variables.dx_tf_turn_general / data_structure.tfcoil_variables.t_turn_tf_max - - 1.0 * data_structure.tfcoil_variables.f_t_turn_tf + - 1.0 ) return ConstraintResult( cc, @@ -2243,13 +2092,12 @@ def constraint_equation_87(): author: S. Kahn, CCFE, Culham Science Centre p_cryo_plant_electric_mw: cryogenic plant power (MW) - f_crypmw: f-value for maximum cryogenic plant power p_cryo_plant_electric_max_mw: Maximum cryogenic plant power (MW) """ cc = ( data_structure.heat_transport_variables.p_cryo_plant_electric_mw / data_structure.heat_transport_variables.p_cryo_plant_electric_max_mw - - 1.0 * data_structure.heat_transport_variables.f_crypmw + - 1.0 ) return ConstraintResult( cc, @@ -2264,18 +2112,16 @@ def constraint_equation_88(): """Equation for TF coil vertical strain upper limit (absolute value) author: CPS Swanson, PPPL, USA - fstr_wp: f-value for TF coil strain str_wp_max: Allowable maximum TF coil vertical strain str_wp: Constrained TF coil vertical strain """ return ConstraintResult( abs(data_structure.tfcoil_variables.str_wp) / data_structure.tfcoil_variables.str_wp_max - - 1.0 * data_structure.constraint_variables.fstr_wp, + - 1.0, data_structure.tfcoil_variables.str_wp_max, data_structure.tfcoil_variables.str_wp_max - - abs(data_structure.tfcoil_variables.str_wp) - / data_structure.constraint_variables.fstr_wp, + - abs(data_structure.tfcoil_variables.str_wp), ) @@ -2286,12 +2132,11 @@ def constraint_equation_89(): copperaoh_m2: CS coil current at EOF / copper area [A/m2] copperaoh_m2_max: maximum coil current / copper area [A/m2] - f_copperaoh_m2: f-value for CS coil current / copper area """ cc = ( data_structure.rebco_variables.copperaoh_m2 / data_structure.rebco_variables.copperaoh_m2_max - - 1.0 * data_structure.rebco_variables.f_copperaoh_m2 + - 1.0 ) return ConstraintResult( cc, @@ -2305,7 +2150,6 @@ def constraint_equation_90(): """Lower limit for CS coil stress load cycles author: A. Pearce, G Turkington CCFE, Culham Science Centre - fncycle: f-value for constraint n_cycle > n_cycle_min n_cycle: Allowable number of cycles for CS n_cycle_min: Minimum required cycles for CS """ @@ -2319,8 +2163,7 @@ def constraint_equation_90(): cc = ( 1.0 - - data_structure.constraint_variables.fncycle - * data_structure.cs_fatigue_variables.n_cycle + - data_structure.cs_fatigue_variables.n_cycle / data_structure.cs_fatigue_variables.n_cycle_min ) return ConstraintResult( @@ -2337,7 +2180,6 @@ def constraint_equation_91(): stellarators only (but in principle usable also for tokamaks). author: J Lion, IPP Greifswald - fecrh_ignition: f-value for constraint powerht_local > powerscaling max_gyrotron_frequency: Max. av. gyrotron frequency te0_ecrh_achievable: Max. achievable electron temperature at ignition point """ @@ -2345,8 +2187,7 @@ def constraint_equation_91(): if data_structure.physics_variables.i_plasma_ignited == 0: cc = ( 1.0 - - data_structure.constraint_variables.fecrh_ignition - * ( + - ( data_structure.stellarator_variables.powerht_constraint + data_structure.current_drive_variables.p_hcd_primary_extra_heat_mw ) @@ -2355,8 +2196,7 @@ def constraint_equation_91(): else: cc = ( 1.0 - - data_structure.constraint_variables.fecrh_ignition - * data_structure.stellarator_variables.powerht_constraint + - data_structure.stellarator_variables.powerht_constraint / data_structure.stellarator_variables.powerscaling_constraint ) diff --git a/process/data_structure/constraint_variables.py b/process/data_structure/constraint_variables.py index 267c86c9ad..5d48da11d3 100644 --- a/process/data_structure/constraint_variables.py +++ b/process/data_structure/constraint_variables.py @@ -14,277 +14,11 @@ """maximum peak toroidal field (T) (`constraint equation 25`)""" -fp_hcd_injected_min_mw: float = None -"""f-value for minimum auxiliary power (`constraint equation 40`, `iteration variable 64`)""" - - -fbeta_poloidal_eps: float = None -"""f-value for epsilon beta-poloidal (`constraint equation 6`, `iteration variable 8`)""" - - -fbeta_poloidal: float = None -"""f-value for poloidal beta (`constraint equation 48`, `iteration variable 79`)""" - - -fbeta_max: float = None -"""f-value for beta limit (`constraint equation 24`, `iteration variable 36`)""" - - -fbeta_min: float = None -"""f-value for (lower) beta limit (`constraint equation 84`, `iteration variable 173`)""" - - -fc_tf_turn_max: float = None -"""f-value for TF coil current per turn upper limit -(`constraint equation 77`, `iteration variable 146`) -""" - - -fr_conducting_wall: float = None -"""f-value for conducting wall radius / rminor limit -(`constraint equation 23`, `iteration variable 104`) -""" - - -fdene: float = None -"""f-value for density limit (`constraint equation 5`, `iteration variable 9`) -(invalid if `i_plasma_pedestal=3`) -""" - - -fdtmp: float = None -"""f-value for first wall coolant temperature rise -(`constraint equation 38`, `iteration variable 62`) -""" - - -fecrh_ignition: float = None -"""f-value for ecrh ignition constraint -(`constraint equation 91`, `iteration variable 168`) -""" - - -fflutf: float = None -"""f-value for neutron fluence on TF coil (`constraint equation 53`, `iteration variable 92`)""" - - -fp_fusion_total_max_mw: float = None -"""f-value for maximum fusion power (`constraint equation 9`, `iteration variable 26`)""" - - -feta_cd_norm_hcd_primary_max: float = None -"""f-value for current drive gamma (`constraint equation 37`, `iteration variable 40`)""" - - -fpflux_div_heat_load_mw: float = None -"""f-value for divertor heat load (`constraint equation 18`, `iteration variable 27`)""" - - -fiooic: float = None -"""f-value for TF coil operating current / critical current ratio -(`constraint equation 33`, `iteration variable 50`) -""" - - -fipir: float = None -"""f-value for Ip/Irod upper limit -constraint equation icc = 46 -iteration variable ixc = 72 -""" - - q95_fixed: float = None """fixed safety factor q at 95% flux surface (`constraint equation 68`) """ - -fjohc: float = None -"""f-value for central solenoid current at end-of-flattop -(`constraint equation 26`, `iteration variable 38`) -""" - - -fjohc0: float = None -"""f-value for central solenoid current at beginning of pulse -(`constraint equation 27`, `iteration variable 39`) -""" - - -fjprot: float = None -"""f-value for TF coil winding pack current density -(`constraint equation 35`, `iteration variable 53`) -""" - - -fl_h_threshold: float = None -"""f-value for L-H power threshold (`constraint equation 15`, `iteration variable 103`)""" - - -fmva: float = None -"""f-value for maximum MVA (`constraint equation 19`, `iteration variable 30`)""" - - -fnbshinef: float = None -"""f-value for maximum neutral beam shine-through fraction -(`constraint equation 59`, `iteration variable 105`) -""" - - -fncycle: float = None -"""f-value for minimum CS coil stress load cycles -(`constraint equation 90`, `iteration variable 167`) -""" - - -fnesep: float = None -"""f-value for Eich critical separatrix density -(`constraint equation 76`, `iteration variable 144`) -""" - - -foh_stress: float = None -"""f-value for Tresca yield criterion in Central Solenoid -(`constraint equation 72`, `iteration variable 123`) -""" - - -fb_tf_inboard_max: float = None -"""f-value for maximum toroidal field (`constraint equation 25`, `iteration variable 35`)""" - - -fp_hcd_injected_max: float = None -"""f-value for injection power (`constraint equation 30`, `iteration variable 46`)""" - - -fp_plant_electric_net_required_mw: float = None -"""f-value for net electric power (`constraint equation 16`, `iteration variable 25`)""" - - -fradius_beam_tangency: float = None -"""f-value for neutral beam tangency radius limit -(`constraint equation 20`, `iteration variable 33`) -""" - - -fpsepbqar: float = None -"""f-value for maximum Psep*Bt/qAR limit (`constraint equation 68`, `iteration variable 117`)""" - - -fpsepr: float = None -"""f-value for maximum Psep/R limit (`constraint equation 56`, `iteration variable 97`)""" - - -fptemp: float = None -"""f-value for peak centrepost temperature (`constraint equation 44`, `iteration variable 68`)""" - - -fptfnuc: float = None -"""f-value for maximum TF coil nuclear heating (`constraint equation 54`, `iteration variable 95`)""" - - -fq95_min: float = None -"""f-value for edge safety factor (`constraint equation 45`, `iteration variable 71`)""" - - -fbig_q_plasma_min: float = None -"""f-value for Q (`constraint equation 28`, `iteration variable 45`)""" - - -fradpwr: float = None -"""f-value for core radiation power limit (`constraint equation 17`, `iteration variable 28`)""" - - -fpflux_fw_rad_max: float = None -"""f-value for upper limit on radiation wall load (`constr. equ. 67`, `iteration variable 116`)""" - - -freinke: float = None -"""f-value for Reinke detachment criterion (`constr. equ. 78`, `iteration variable 147`)""" - - -frminor: float = None -"""f-value for minor radius limit (`constraint equation 21`, `iteration variable 32`)""" - - -fstrcase: float = None -"""f-value for maximum TF coil case Tresca yield criterion -(`constraint equation 31`, `iteration variable 48`) -""" - - -fstrcond: float = None -"""f-value for maxiumum TF coil conduit Tresca yield criterion -(`constraint equation 32`, `iteration variable 49`) -""" - - -fstr_wp: float = None -"""f-value for maxiumum TF coil strain absolute value -(`constraint equation 88`, `iteration variable 165`) -""" - - -fmaxvvstress: float = None -"""f-value for maximum permitted stress of the VV -(`constraint equation 65`, `iteration variable 113`) -""" - - -ftbr: float = None -"""f-value for minimum tritium breeding ratio (`constraint equation 52`, `iteration variable 89`)""" - - -ft_burn_min: float = None -"""f-value for minimum burn time (`constraint equation 13`, `iteration variable 21`)""" - - -ft_cycle_min: float = None -"""f-value for cycle time (`constraint equation 42`, `iteration variable 67`)""" - - -ftmargoh: float = None -"""f-value for central solenoid temperature margin -(`constraint equation 60`, `iteration variable 106`) -""" - - -ftmargtf: float = None -"""f-value for TF coil temperature margin (`constraint equation 36`, `iteration variable 54`)""" - - -ft_current_ramp_up: float = None -"""f-value for plasma current ramp-up time (`constraint equation 41`, `iteration variable 66`)""" - - -ftemp_fw_max: float = None -"""f-value for first wall peak temperature (`constraint equation 39`, `iteration variable 63`)""" - - -fvdump: float = None -"""f-value for dump voltage (`constraint equation 34`, `iteration variable 51`)""" - - -fvs_plasma_total_required: float = None -"""f-value for flux-swing (V-s) requirement (STEADY STATE) -(`constraint equation 12`, `iteration variable 15`) -""" - - -fvvhe: float = None -"""f-value for vacuum vessel He concentration limit (`i_blanket_type = 2`) -(`constraint equation 55`, `iteration variable 96`) -""" - - -fpflux_fw_neutron_max_mw: float = None -"""f-value for maximum wall load (`constraint equation 8`, `iteration variable 14`)""" - - -fzeff_max: float = None -"""f-value for maximum n_charge_plasma_effective_vol_avg (`constraint equation 64`, `iteration variable 112`)""" - - eta_cd_norm_hcd_primary_max: float = None """maximum current drive gamma (`constraint equation 37`)""" @@ -294,19 +28,15 @@ (`constraint equation 68`) """ - pflux_fw_rad_max: float = None """Maximum permitted radiation wall load (MW/m^2) (`constraint equation 67`)""" - mvalim: float = None """maximum MVA limit (`constraint equation 19`)""" - f_p_beam_shine_through_max: float = None """maximum neutral beam shine-through fraction (`constraint equation 59`)""" - nflutfmax: float = None """max fast neutron fluence on TF coil (n/m2) (`blktmodel>0`) (`constraint equation 53`) Also used for demontable magnets (itart = 1) and superconducting coils (i_tf_sup = 1) @@ -314,157 +44,63 @@ To set the CP lifetime (`constraint equation 85`) """ - p_plasma_separatrix_min_mw: float = None """Minimum p_plasma_separatrix_mw [MW] (`constraint equation 80`)""" - f_fw_rad_max: float = None """peaking factor for radiation wall load (`constraint equation 67`)""" - pflux_fw_rad_max_mw: float = None """Peak radiation wall load (MW/m^2) (`constraint equation 67`)""" - p_plant_electric_net_required_mw: float = None """required net electric power (MW) (`constraint equation 16`)""" - p_fusion_total_max_mw: float = None """maximum fusion power (MW) (`constraint equation 9`)""" - psepbqarmax: float = None """maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`)""" - pseprmax: float = None """maximum ratio of power crossing the separatrix to plasma major radius (Psep/R) (MW/m) (`constraint equation 56`) """ - ptfnucmax: float = None """maximum nuclear heating in TF coil (MW/m3) (`constraint equation 54`)""" - tbrmin: float = None """minimum tritium breeding ratio (`constraint equation 52`)""" - t_burn_min: float = None """minimum burn time (s) (KE - no longer itv., see issue #706)""" - t_cycle_min: float = None """minimum cycle time (s) (`constraint equation 42`)""" - t_current_ramp_up_min: float = None """minimum plasma current ramp-up time (s) (`constraint equation 41`)""" - pflux_fw_neutron_max_mw: float = None """allowable neutron wall-load (MW/m2) (`constraint equation 8`)""" - f_alpha_energy_confinement_min: float = None """Lower limit on f_alpha_energy_confinement the ratio of alpha particle to energy confinement times (`constraint equation 62`) """ - -falpha_energy_confinement: float = None -"""f-value for lower limit on f_alpha_energy_confinement the ratio of alpha particle to energy -confinement times (`constraint equation 62`, `iteration variable 110`) -""" - - -fniterpump: float = None -"""f-value for constraint that number of pumps < tfno -(`constraint equation 63`, `iteration variable 111`) -""" - - zeff_max: float = None """maximum value for Zeff (`constraint equation 64`)""" -fpoloidalpower: float = None -"""f-value for constraint on rate of change of energy in poloidal field -(`constraint equation 66`, `iteration variable 115`) -""" - - -ftemp_croco_quench_max: float = None -"""TF coil quench temparature remains below temp_croco_quench_max -(`constraint equation 74`, `iteration variable 141`) -""" - - def init_constraint_variables(): """Initialise the constraint variables""" global p_hcd_injected_min_mw global beta_poloidal_max global big_q_plasma_min global b_tf_inboard_max - global fp_hcd_injected_min_mw - global fbeta_poloidal_eps - global fbeta_poloidal - global fbeta_max - global fbeta_min - global fc_tf_turn_max - global fr_conducting_wall - global fdene - global fdtmp - global fecrh_ignition - global fflutf - global fp_fusion_total_max_mw - global feta_cd_norm_hcd_primary_max - global fpflux_div_heat_load_mw - global fiooic - global fipir global q95_fixed - global fjohc - global fjohc0 - global fjprot - global fl_h_threshold - global fmva - global fnbshinef - global fncycle - global fnesep - global foh_stress - global fb_tf_inboard_max - global fp_hcd_injected_max - global fp_plant_electric_net_required_mw - global fradius_beam_tangency - global fpsepbqar - global fpsepr - global fptemp - global fptfnuc - global fq95_min - global fbig_q_plasma_min - global fradpwr - global fpflux_fw_rad_max - global freinke - global frminor - global fstrcase - global fstrcond - global fstr_wp - global fmaxvvstress - global ftbr - global ft_burn_min - global ft_cycle_min - global ftmargoh - global ftmargtf - global ft_current_ramp_up - global ftemp_fw_max - global fvdump - global fvs_plasma_total_required - global fvvhe - global fpflux_fw_neutron_max_mw - global fzeff_max global eta_cd_norm_hcd_primary_max global i_q95_fixed global pflux_fw_rad_max @@ -485,71 +121,13 @@ def init_constraint_variables(): global t_current_ramp_up_min global pflux_fw_neutron_max_mw global f_alpha_energy_confinement_min - global falpha_energy_confinement - global fniterpump global zeff_max - global fpoloidalpower - global ftemp_croco_quench_max p_hcd_injected_min_mw = 0.1 beta_poloidal_max = 0.19 big_q_plasma_min = 10.0 b_tf_inboard_max = 12.0 - fp_hcd_injected_min_mw = 1.0 - fbeta_poloidal_eps = 1.0 - fbeta_poloidal = 1.0 - fbeta_max = 1.0 - fbeta_min = 1.0 - fc_tf_turn_max = 1.0 - fr_conducting_wall = 1.0 - fdene = 1.0 - fdtmp = 1.0 - fflutf = 1.0 - fp_fusion_total_max_mw = 1.0 - feta_cd_norm_hcd_primary_max = 1.0 - fpflux_div_heat_load_mw = 1.0 - fiooic = 0.5 - fipir = 1.0 q95_fixed = 3.0 - fjohc = 1.0 - fjohc0 = 1.0 - fjprot = 1.0 - fl_h_threshold = 1.0 - fmva = 1.0 - fnbshinef = 1.0 - fncycle = 1.0 - fnesep = 1.0 - foh_stress = 1.0 - fb_tf_inboard_max = 1.0 - fp_hcd_injected_max = 1.0 - fp_plant_electric_net_required_mw = 1.0 - fradius_beam_tangency = 1.0 - fpsepbqar = 1.0 - fpsepr = 1.0 - fptemp = 1.0 - fptfnuc = 1.0 - fq95_min = 1.0 - fbig_q_plasma_min = 1.0 - fradpwr = 0.99 - fpflux_fw_rad_max = 1.0 - freinke = 1.0 - frminor = 1.0 - fstrcase = 1.0 - fstrcond = 1.0 - fstr_wp = 1.0 - fmaxvvstress = 1.0 - ftbr = 1.0 - ft_burn_min = 1.0 - ft_cycle_min = 1.0 - ftmargoh = 1.0 - ftmargtf = 1.0 - ft_current_ramp_up = 1.0 - ftemp_fw_max = 1.0 - fvdump = 1.0 - fvs_plasma_total_required = 1.0 - fvvhe = 1.0 - fpflux_fw_neutron_max_mw = 1.0 - fzeff_max = 1.0 eta_cd_norm_hcd_primary_max = 2.0 i_q95_fixed = 0 pflux_fw_rad_max = 1.0 @@ -570,9 +148,4 @@ def init_constraint_variables(): t_current_ramp_up_min = 1.0 pflux_fw_neutron_max_mw = 1.0 f_alpha_energy_confinement_min = 5.0 - falpha_energy_confinement = 1.0 - fniterpump = 1.0 zeff_max = 3.6 - fpoloidalpower = 1.0 - ftemp_croco_quench_max = 1.0 - fecrh_ignition = 1.0 From 759f7b2ae0bf03041d95b344b3dd0446b05c0319 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Wed, 22 Oct 2025 11:25:48 +0100 Subject: [PATCH 03/17] Remove f-values from input files, input handler, iteration variables, and scan etc --- documentation/development/standards.md | 5 - documentation/eng-models/central-solenoid.md | 11 +- .../NBI/nbi_overview.md | 2 +- ...conversion-and-heat-dissipation-systems.md | 2 +- .../eng-models/tf-coil-superconducting.md | 10 +- documentation/eng-models/tf-coil.md | 1 - documentation/eng-models/vacuum-vessel.md | 3 +- documentation/fusion-devices/inertial.md | 2 +- .../fusion-devices/spherical-tokamak.md | 6 +- documentation/fusion-devices/stellarator.md | 7 +- documentation/io/input-guide.md | 3 - .../fusion_reactions/plasma_reactions.md | 4 +- .../physics-models/plasma_beta/plasma_beta.md | 8 +- .../physics-models/plasma_composition.md | 2 - .../physics-models/plasma_confinement.md | 3 - .../plasma_current/plasma_current.md | 4 +- .../physics-models/plasma_density.md | 2 +- documentation/physics-models/plasma_h_mode.md | 6 +- .../physics-models/plasma_radiation.md | 4 - .../profiles/plasma_profiles.md | 4 +- documentation/physics-models/pulsed-plant.md | 6 +- documentation/solver/solver-guide.md | 7 +- documentation/usage/troubleshooting.md | 6 - examples/data/large_tokamak_eval_IN.DAT | 10 - process/constraints.py | 24 +- process/data_structure/build_variables.py | 6 - .../data_structure/constraint_variables.py | 5 + process/data_structure/cost_variables.py | 6 - .../heat_transport_variables.py | 9 - process/data_structure/ife_variables.py | 6 - process/data_structure/numerics.py | 93 +-- process/data_structure/pfcoil_variables.py | 12 - process/data_structure/physics_variables.py | 20 - process/data_structure/rebco_variables.py | 10 - process/data_structure/scan_variables.py | 5 - process/data_structure/tfcoil_variables.py | 17 - process/input.py | 201 ------ process/io/obsolete_vars.py | 101 ++- process/io/plot_radial_build.py | 4 - process/io/plot_scans.py | 3 - process/iteration_variables.py | 150 ----- process/pfcoil.py | 20 +- process/scan.py | 12 - process/stellarator.py | 8 +- .../data/large_tokamak_eval.IN.DAT | 10 - tests/regression/input_files/helias_5b.IN.DAT | 9 - .../input_files/large_tokamak.IN.DAT | 614 ------------------ .../input_files/large_tokamak_eval.IN.DAT | 10 - .../input_files/large_tokamak_nof.IN.DAT | 11 - .../input_files/spherical_tokamak_eval.IN.DAT | 15 - .../input_files/st_regression.IN.DAT | 188 +----- .../stellarator_helias_eval.IN.DAT | 14 - tests/unit/test_stellarator.py | 6 - 53 files changed, 136 insertions(+), 1571 deletions(-) delete mode 100644 tests/regression/input_files/large_tokamak.IN.DAT diff --git a/documentation/development/standards.md b/documentation/development/standards.md index 3767925f44..ac9d2e022d 100644 --- a/documentation/development/standards.md +++ b/documentation/development/standards.md @@ -506,11 +506,6 @@ If a variable is intended to represent an engineering efficiency then it should --------------------- -##### F-values - -Variables used within constraint equations to scale iteration variables (f-values) should start with the `f` prefix without an underscore before the next word. - ---------------------- ### Variable Length diff --git a/documentation/eng-models/central-solenoid.md b/documentation/eng-models/central-solenoid.md index 44f5fe2a4d..b633e352d6 100644 --- a/documentation/eng-models/central-solenoid.md +++ b/documentation/eng-models/central-solenoid.md @@ -299,23 +299,18 @@ using `f_j_cs_start_pulse_end_flat_top` (iteration variable no. 41). The current calculated by taking into account the flux swing necessary to initiate and maintain plasma current. The current density in the central solenoid can be limited at BOP and at EOF. To limit the current -density at BOP, constraint equation no. 27 is used with iteration variable no. 39 (`fjohc0`). To -limit the current density at the EOF, constraint equation no. 26 should be turned on with iteration -variable no. 38 (`fjohc`). +density at BOP, use constraint equation no. 27. To +limit the current density at the EOF, constraint equation no. 26 should be turned on. The critical current density *J*crit is a function of the temperature of the superconductor. The temperature margin $\Delta$*T* is the difference between the current sharing temperature and the operating temperature. The current sharing temperature is the temperature at which *J*crit is equal to the operating current density *J*op. The minimum allowed $\Delta$*T* can be -set using input parameter `tmargmin` together with constraint equation no. 60 and iteration variable -no. 106 (`ftmargoh`). +set using input parameter `tmargmin` together with constraint equation no. 60. It is recommended that EITHER the temperature margin constraint (60), OR the current density constraints (26 and 27) are activated. -!!! tip "Recommended maximum current ratio" - For engineering feasibility, the centrepost currents at end of flat-top and beginning of pulse (`fjohc` and `fjohc0` respectively) shouldn't be set above 0.7. - !!! note "Central solenoid current over time" A plot of how the central solenoid current varies over time can be found [here](../physics-models/pulsed-plant.md#burn-time) diff --git a/documentation/eng-models/heating_and_current_drive/NBI/nbi_overview.md b/documentation/eng-models/heating_and_current_drive/NBI/nbi_overview.md index adcd7ba318..0f200e1469 100644 --- a/documentation/eng-models/heating_and_current_drive/NBI/nbi_overview.md +++ b/documentation/eng-models/heating_and_current_drive/NBI/nbi_overview.md @@ -7,7 +7,7 @@ If present, a neutral beam injection system needs sufficient space between the TF coils to be able to intercept the plasma tangentially. The major radius `radius_beam_tangency` at which the centre-line of the beam is tangential to the toroidal direction is user-defined using input parameter `f_radius_beam_tangency_rmajor`, which is the ratio of `radius_beam_tangency` to the plasma major radius `rmajor`. -The maximum possible tangency radius `radius_beam_tangency_max` is determined by the geometry of the TF coils - see Figure 1, and this can be enforced using `icc = 20` with `ixc = 33` (`fradius_beam_tangency`). The thickness of the beam duct walls may be set using input parameter `dx_beam_shield`. +The maximum possible tangency radius `radius_beam_tangency_max` is determined by the geometry of the TF coils - see Figure 1, and this can be enforced using `icc = 20`. The thickness of the beam duct walls may be set using input parameter `dx_beam_shield`.
diff --git a/documentation/eng-models/power-conversion-and-heat-dissipation-systems.md b/documentation/eng-models/power-conversion-and-heat-dissipation-systems.md index 53be7501a7..ba05c07bb6 100644 --- a/documentation/eng-models/power-conversion-and-heat-dissipation-systems.md +++ b/documentation/eng-models/power-conversion-and-heat-dissipation-systems.md @@ -31,7 +31,7 @@ This performs calculations on the first wall of the machine. Evaluations of the thermal stresses on this component lead to a measure of the maximum number of cycles to which the first wall can be subjected, and hence to the minimum allowable length of each reactor cycle for a specified first wall lifetime. The cycle time can be constrained to be at least the minimum value -by turning on constraint equation no. 42 with iteration variable no 67 (`ft_cycle_min`). +by turning on constraint equation no. 42. # Power conversion cycle diff --git a/documentation/eng-models/tf-coil-superconducting.md b/documentation/eng-models/tf-coil-superconducting.md index 0869529a23..2dabd8ef5a 100644 --- a/documentation/eng-models/tf-coil-superconducting.md +++ b/documentation/eng-models/tf-coil-superconducting.md @@ -237,15 +237,11 @@ The toroidal field falls off at a rate $1/R$, with the peak value occurring at t Three constraints are relevant to the operating current density $J_{\mbox{op}}$ in the TF coils. -- Criticial current (`constraint 33`): $J_{\mbox{op}}$ must not exceed the critical value $J_{\mbox{crit}}$. Iteration variable 50 must be active (`fiooic`). The current density margin can be set using the upper bound of `fiooic`: - -$$ - J_{\mbox{op}} < \texttt{fiooic} \cdot J_{\mbox{crit}} -$$ +- Criticial current (`constraint 33`): $J_{\mbox{op}}$ must not exceed the critical value $J_{\mbox{crit}}$. - Temperature margin (`constraint 36`) -- The critical current density $J_{\mbox{crit}}$ falls with the temperature of the superconductor. The temperature margin $\Delta T$ is the difference between the current sharing temperature (at which $J_{\mbox{crit}}$ would be equal to $J_{\mbox{op}}$) and the operating temperature. The minimum allowed $\Delta T$ -can be set using `tmargmin` together with constraint equation 36 and iteration variable 54 (`ftmargtf`). Note that if the temperature margin is positive, $J_{\mbox{op}}$ is guaranteed to be lower than \jcrit, and so constraints 33 and 36 need not both be turned on. It is recommended that only one of these two constraints is activated. +can be set using `tmargmin` together with constraint equation 36. Note that if the temperature margin is positive, $J_{\mbox{op}}$ is guaranteed to be lower than \jcrit, and so constraints 33 and 36 need not both be turned on. It is recommended that only one of these two constraints is activated. --------- @@ -281,7 +277,7 @@ $$ $$ -- `Constraint 35` -- To ensure that $J_{\mbox{op}}$ does not exceed the quench protection current density limit, $J_{TF,\mathrm{quench}}$, constraint equation no.\ 35 should be turned on with iteration variable 53 ( `fjprot`). +- `Constraint 35` -- To ensure that $J_{\mbox{op}}$ does not exceed the quench protection current density limit, $J_{TF,\mathrm{quench}}$, turn on constraint equation no.\ 35. ----------------------- diff --git a/documentation/eng-models/tf-coil.md b/documentation/eng-models/tf-coil.md index 4f7245a588..e0710eb2dc 100644 --- a/documentation/eng-models/tf-coil.md +++ b/documentation/eng-models/tf-coil.md @@ -983,7 +983,6 @@ $$ | `n_tf_wp_pancakes` | Number of turns in the toroidal direction (`i_tf_turns_integer = 1` only) | - | 10 | - | | `dx_tf_turn_general` | TF turn squared size | - | No default | m | | `dx_tf_turn_cable_space_general` | TF cable diameter size | - | No default | m | -| `f_t_turn_tf` | f-value for TF turn squared size constraint (icc = 86) | 175 | 1. | m | | `t_turn_tf_max` | Maximum turn squared size for constraint (icc = 86) | - | 0.05 | m | | `c_tf_turn` | Current per turn
Overwitten if `dx_tf_turn_general` is set by the user | ixc = 60 | $70.10^3$ | A | | `dx_tf_turn_insulation` | Turn insulation layer thickness | - | $0.8.10^{-3}$ | m | diff --git a/documentation/eng-models/vacuum-vessel.md b/documentation/eng-models/vacuum-vessel.md index c2a2886d3c..e85a4de20f 100644 --- a/documentation/eng-models/vacuum-vessel.md +++ b/documentation/eng-models/vacuum-vessel.md @@ -9,8 +9,7 @@ A model has been implemented, based on This model takes account of the currents induced in both the vacuum vessel and the steel TF coil structures. -Constraint 65 implements this model, by applying a maximum permitted stress in the vacuum vessel. -`fmaxvvstress` f-value for constraint 65. Iteration variable 113. +Constraint 65 implements this model, by applying a maximum permitted stress in the vacuum vessel. `theta1_coil` An angle, shown as $\theta_1$ in Figure 1, relating to the shape of the TF coil conductor centre-line (degrees). `theta1_vv` An angle, shown as $\theta_1$ in Figure 1, relating to the shape of the vacuum vessel centre-line (degrees). `max_vv_stress` The maximum permissible maximum shear stress in the vacuum vessel (Pa) (as used in the Tresca criterion). diff --git a/documentation/fusion-devices/inertial.md b/documentation/fusion-devices/inertial.md index cef61e200c..b75f3ff8df 100644 --- a/documentation/fusion-devices/inertial.md +++ b/documentation/fusion-devices/inertial.md @@ -28,7 +28,7 @@ Switch `ifetyp` defines the type of device that is assumed; this varies widely b Switch `ifedrv` defines how the code calculates the drivers efficiency and target gain - these are the primary outputs required from the physics part of the model. For the SOMBRERO and OSIRIS cases (`ifedrv = 1` and `ifedrv = 2`, respectively) the driver efficiency and gain are calculated from curves of these parameters as functions of the driver energy, via the two arrays`etaxe(1:10)` and `gainve(1:10)` respectively; the element number corresponds to the driver energy in MJ, and outside the range 1-10 MJ the curves are extrapolated linearly. Finally, for the `ifedrv = 0` case, the user inputs single values for the driver efficiency (`drveff`) and target gain (`tgain`). -Constraint equation no. 50 can be turned on to enable the ignition repetition rate to remain below a user-specified upper limit (`rrmax`); iteration variable no. 86 (`frrmax`) is the associated f-value. The other iteration variables relevant for the IFE model are nos. 81-85 (`edrive`, `drveff`, `tgain`, `chrad` and `pdrive`). +Constraint equation no. 50 can be turned on to enable the ignition repetition rate to remain below a user-specified upper limit (`rrmax`). The other iteration variables relevant for the IFE model are nos. 81-85 (`edrive`, `drveff`, `tgain`, `chrad` and `pdrive`). [^1]: P. J. Knight, *"PROCESS 3009: Incorporation of Inertial Fusion Energy Model"*, Work File Note F/MI/PJK/PROCESS/CODE/032 [^2]: Bourque et al., *"Overview of the OSIRIS IFE Reactor Conceptual Design"*, Fusion Technology **21** (1992) 1465 diff --git a/documentation/fusion-devices/spherical-tokamak.md b/documentation/fusion-devices/spherical-tokamak.md index c7443305d4..8ea596bde0 100644 --- a/documentation/fusion-devices/spherical-tokamak.md +++ b/documentation/fusion-devices/spherical-tokamak.md @@ -18,9 +18,9 @@ 2. Spherical tokamaks have resistive TF coils that combine into a single centrepost at the centre of the machine. The centrepost is constructed from copper (as are the outboard TF coil sections), and tapered length ways so that it is narrowest at the midplane of the device. Routine `CNTRPST` calculates various parameters relevant to the centrepost, including the pump pressure, maximum temperature and pip radius, and these may be limited using constraint equations 43 to 45 of required: * Equation 43 is a consistency equation for the average centrepost temperature. - * Equation 44 can be used to limit the peak centrepost temperature to a maximum value (`temp_cp_max`) using iteration variable no. 68 (`fptemp`). - * Equation 45 can be used to force a lower; limit to the edge safety factor *q$_{lim}$* using iteration variable no. 71 (`fq95_min`). - Equation 46 can be used to apply an upper limit to the ratio of plasma current to TF coil ("rod") current , using iteration variable no. 72 (`fipir`)

+ * Equation 44 can be used to limit the peak centrepost temperature to a maximum value (`temp_cp_max`). + * Equation 45 can be used to force a lower; limit to the edge safety factor *q$_{lim}$*. + Equation 46 can be used to apply an upper limit to the ratio of plasma current to TF coil ("rod") current.

3. A gaseous divertor model is used, and a simple divertor heat load calculation is employed, rather than the more complex divertor model assumed for conventional aspect ratio tokamaks.

diff --git a/documentation/fusion-devices/stellarator.md b/documentation/fusion-devices/stellarator.md index e58de803cf..8dbdbbc390 100644 --- a/documentation/fusion-devices/stellarator.md +++ b/documentation/fusion-devices/stellarator.md @@ -63,7 +63,7 @@ icc = 83 * Radial build at critical location icc = 91 * ECRH ignitability (checks critical density at ignition point) ``` -A reasonable start for iteration variables (next to the required f-values) are: +A reasonable start for iteration variables are: ``` ixc = 2 * Toroidal Magnetic field strength @@ -123,7 +123,7 @@ Stellarators try to achieve zero plasma current in order to allow safe divertor ### Beta limit The stellarator version calculates the plasma beta based on the input parameter and it is thus not necessary to Differently to the tokamak version, -The beta limit is assumed to be 5%, based on 3-D MHD calculations[^7]. To apply the beta limit, constraint equation no. 24 should be turned on with iteration variable no. 36 (`fbeta_max`). +The beta limit is assumed to be 5%, based on 3-D MHD calculations[^7]. To apply the beta limit, constraint equation no. 24 should be turned on. ### Density limit @@ -131,7 +131,7 @@ The density limit relevant to certain stellarators experiments has been proposed $n_{max} = 0.25(PB_0/R_0a^2_p)^{1/2}$ -where $n$ is the line-averaged electron density in units of $10^{20} m^{-3}$, $p$ is the absorbed heating power (MW), $B_0$ is the on-axis field (t), $R_0$ is the major radius (m), and $a_p$ is the plasma minor radius (m). To enforce the Sudo density limit, turn on constraint equation no. 5 with iteration variable no. 9 (`fdene`). +where $n$ is the line-averaged electron density in units of $10^{20} m^{-3}$, $p$ is the absorbed heating power (MW), $B_0$ is the on-axis field (t), $R_0$ is the major radius (m), and $a_p$ is the plasma minor radius (m). To enforce the Sudo density limit, turn on constraint equation no. 5. Note that the Sudo limit is a radiation based density limit and it is unclear how well this limit extrapolates to reactor parameters, especially as no impurity dependence e.g. is present in the Sudo model. PROCESS features an impurity dependent radiation module already which can be used with `icc=17` and by setting the `f_nd_impurity_electrons` vector. @@ -226,7 +226,6 @@ f_a_tf_turn_cable_copper = 0.7 *Copper fraction of cable conductor (TF coils), S tftmp = 4.75 *Peak helium coolant temperature in TF coils and PF coils (K) temp_tf_cryo = 4.75 * Temperature in TF coils, required for plant efficiency (K) f_a_tf_turn_cable_space_extra_void = 0.3 *Coolant fraction of TF coil leg (itfsup=0) this is the same for conductor and strand! -fiooic = 0.78 *Fraction TF coil critical current to operation current (should be iteration variable!) v_tf_coil_dump_quench_max_kv = 12.64 * Max voltage across tf coil during quench (kV) t_tf_superconductor_quench = 20 * Dump time (should be iteration variable) dr_tf_nose_case = 0.1 * Thickness TF Coil case (for stellarators: Also for toroidal direction) diff --git a/documentation/io/input-guide.md b/documentation/io/input-guide.md index c64593685e..749c844f50 100644 --- a/documentation/io/input-guide.md +++ b/documentation/io/input-guide.md @@ -44,9 +44,6 @@ equation 2. A comment on the same line is recommended: icc = 2 * Global power balance (consistency equation) ``` -Some constraints have `f-value` variables. These must be set as iteration variables, -which are discussed below. - !!! Info "Constraints" A full list of constraints is given on the variable description page in the row labelled diff --git a/documentation/physics-models/fusion_reactions/plasma_reactions.md b/documentation/physics-models/fusion_reactions/plasma_reactions.md index ca3b8922d4..cb967370ed 100644 --- a/documentation/physics-models/fusion_reactions/plasma_reactions.md +++ b/documentation/physics-models/fusion_reactions/plasma_reactions.md @@ -222,7 +222,7 @@ If the plasma is classed as ignited then the injected heating power density is n This constraint can be activated by stating `icc = 9` in the input file. -The value of `p_fusion_total_max_mw` can be set to the desired maximum fusion power. The scaling value `fp_fusion_total_max_mw` can be varied also. +The value of `p_fusion_total_max_mw` can be set to the desired maximum fusion power. --------------------------------- @@ -230,7 +230,7 @@ The value of `p_fusion_total_max_mw` can be set to the desired maximum fusion po This constraint can be activated by stating `icc = 28` in the input file. -The value of `big_q_plasma_min` can be set to the minimum desired $Q_{\text{plasma}}$ value. The scaling value `fbig_q_plasma_min` can be varied also. +The value of `big_q_plasma_min` can be set to the minimum desired $Q_{\text{plasma}}$ value. ------------------------- diff --git a/documentation/physics-models/plasma_beta/plasma_beta.md b/documentation/physics-models/plasma_beta/plasma_beta.md index 7ae8b4ffef..b44fe0f15b 100644 --- a/documentation/physics-models/plasma_beta/plasma_beta.md +++ b/documentation/physics-models/plasma_beta/plasma_beta.md @@ -405,8 +405,6 @@ This constraint can be activated by stating `icc = 6` in the input file [^6]. The limiting value of $\epsilon\beta_p$ is be set using input parameter `beta_poloidal_eps_max`. -The scaling value `fbeta_poloidal_eps` can be varied also. - !!! note "Origin of the $\epsilon\beta_p$ limit" High poloidal beta shots in TFTR were performed[^6] and it was found that as $\beta_p$, @@ -427,8 +425,6 @@ It is the general setting of the $\beta$ limit depending on the $\beta_{\text{N} The upper limit value of beta is calculated by `calculate_beta_limit()`. The beta coefficient $g$ can be set using `beta_norm_max`, depending on the setting of [`i_beta_norm_max`](#setting-the-beta--coefficient). It can be set directly or follow some relation. -The scaling value `fbeta_max` can be varied also. - **It is recommended to have this constraint on as it is a plasma stability model** -------------------- @@ -437,7 +433,7 @@ The scaling value `fbeta_max` can be varied also. This constraint can be activated by stating `icc = 48` in the input file. -The value of `beta_poloidal_max` can be set to the desired maximum poloidal beta. The scaling value `fbeta_poloidal` can be varied also. +The value of `beta_poloidal_max` can be set to the desired maximum poloidal beta. ------------------- @@ -445,7 +441,7 @@ The value of `beta_poloidal_max` can be set to the desired maximum poloidal beta This constraint can be activated by stating `icc = 84` in the input file. -The value of `beta_vol_avg_min` can be set to the desired minimum total beta. The scaling value `fbeta_min` can be varied also. +The value of `beta_vol_avg_min` can be set to the desired minimum total beta. [^0]: F. Troyon et.al, “Beta limit in tokamaks. Experimental and computational status,” Plasma Physics and Controlled Fusion, vol. 30, no. 11, pp. 1597–1609, Oct. 1988, doi: https://doi.org/10.1088/0741-3335/30/11/019. diff --git a/documentation/physics-models/plasma_composition.md b/documentation/physics-models/plasma_composition.md index 9abb7f93d6..32f6a1b78e 100644 --- a/documentation/physics-models/plasma_composition.md +++ b/documentation/physics-models/plasma_composition.md @@ -236,7 +236,5 @@ This constraint can be activated by stating `icc = 78` in the input file. The minimum impurity fraction required from the Reinke module can be set with, `fzmin` -The scaling value `freinke` can be varied also. - [^1]: H. Lux, R. Kemp, D.J. Ward, M. Sertoli, Impurity radiation in DEMO systems modelling, Fusion Engineering and Design, Volume 101, 2015, Pages 42-51, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2015.10.002. diff --git a/documentation/physics-models/plasma_confinement.md b/documentation/physics-models/plasma_confinement.md index 495af1108a..7da7e17cf4 100644 --- a/documentation/physics-models/plasma_confinement.md +++ b/documentation/physics-models/plasma_confinement.md @@ -707,9 +707,6 @@ This constraint can be activated by stating `icc = 62` in the input file. The value of `f_alpha_energy_confinement_min` can be set to the desired minimum total ratio between the alpha confinement and energy confinement times. - The scaling value `falpha_energy_confinement` can be varied also. - - [^1]: N. A. Uckan, International Atomic Energy Agency, Vienna (Austria) and ITER Physics Group, "ITER physics design guidelines: 1989", no. No. 10. Feb. 1990. [^2]: T.C. Hender et al., 'Physics Assessment of the European Reactor Study', AEA FUS 172, 1992. [^3]: J. P. Christiansen et al., “Global energy confinement H-mode database for ITER,” Nuclear Fusion, vol. 32, no. 2, pp. 291-338, Feb. 1992, doi: https://doi.org/10.1088/0029-5515/32/2/i11. diff --git a/documentation/physics-models/plasma_current/plasma_current.md b/documentation/physics-models/plasma_current/plasma_current.md index ae578188bf..cce5fec996 100644 --- a/documentation/physics-models/plasma_current/plasma_current.md +++ b/documentation/physics-models/plasma_current/plasma_current.md @@ -677,7 +677,7 @@ $$ This constraint can be activated by stating `icc = 41` in the input file. -The value of `tohsm` can be set to the required minimum plasma current ramp up time at the start of a pulse. The scaling value `ft_current_ramp_up` can be varied also +The value of `tohsm` can be set to the required minimum plasma current ramp up time at the start of a pulse. The calculated plasma current ramp up time `t_plant_pulse_plasma_current_ramp_up` is dictated by the [pulsed plant operation configuration](../pulsed-plant.md). @@ -696,7 +696,7 @@ $$ $$ In this case $I_{\text{cp}}$ is the total current going up the centrepost in a spherical tokamak. -This constraint was initially though to prevent instabilities and act as a guideline to limit power dissipation when generating new designs. The scaling value for the constraint, `fipir` can be varied also. +This constraint was initially though to prevent instabilities and act as a guideline to limit power dissipation when generating new designs. The origins of the relation should be seen in early spherical tokamak papers not yet referenced here. diff --git a/documentation/physics-models/plasma_density.md b/documentation/physics-models/plasma_density.md index a79402cb20..f8dade8613 100644 --- a/documentation/physics-models/plasma_density.md +++ b/documentation/physics-models/plasma_density.md @@ -5,7 +5,7 @@ calculated in routine `calculate_density_limit()`, which is called by `physics`. This constraint can be activated by stating `icc = 5` in the input file. -The value of `i_density_limit` can be set to apply the relevant limit . The scaling value `fdene` can be varied also. +The value of `i_density_limit` can be set to apply the relevant limit. For the `i_density_limit = 1-5,8` scalings we scale the function output by the separatrix to volume averaged electron density so that we can set the limit on the volume averaged. **Therefore it is recommended to only use these scalings with an H-mode profile (`i_plasma_pedestal == 1`) otherwise the separatrix density (`nd_plasma_separatrix_electron`) will not be calculated.** diff --git a/documentation/physics-models/plasma_h_mode.md b/documentation/physics-models/plasma_h_mode.md index cbe03cbc35..03b1d04eee 100644 --- a/documentation/physics-models/plasma_h_mode.md +++ b/documentation/physics-models/plasma_h_mode.md @@ -25,8 +25,6 @@ There are two separate constraint equations for enforcing the L-H threshold. This constraint can be activated by stating `icc = 15` in the input file. -The scaling value `fl_h_threshold (ixc=103)` can be varied to set the required margin around the threshold. - $$ 1.0 - \mathtt{fl\_h\_threshold} \times \frac{\overbrace{\mathtt{p\_l\_h\_threshold\_mw}}^{\text{Power from scaling}}}{\mathtt{p_plasma_separatrix_mw}} $$ @@ -50,12 +48,10 @@ and therefore the machine remains in L-mode. This constraint can be activated by stating `icc = 73` in the input file. $$ -1.0 - \mathtt{fplhsep} \times \frac{\mathtt{p_plasma_separatrix_mw}}{ +1.0 - \frac{\mathtt{p_plasma_separatrix_mw}}{ \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}}+ P_{\text{HCD}}} $$ -The scaling value `fplhsep (ixc=137)` can be varied to set the required margin around the threshold. - -------------------- diff --git a/documentation/physics-models/plasma_radiation.md b/documentation/physics-models/plasma_radiation.md index 96363ff6be..8606e658a0 100644 --- a/documentation/physics-models/plasma_radiation.md +++ b/documentation/physics-models/plasma_radiation.md @@ -253,8 +253,6 @@ the ohmic heating power). If the radiation power is higher than the heating powe $f_{\alpha, \text{plasma}}$ is the fraction of alpha power that is coupled to the plasma (`f_p_alpha_plasma_deposited`). -The scaling value `fradpwr` can be varied also. - **It is recommended to have this constraint on as it is a plasma stability model** ---------------- @@ -265,8 +263,6 @@ This constraint can be activated by stating `icc = 67` in the input file. The limiting value of $q_{\text{fw,rad}}$ in $\mathrm {MWm^{-2}}$ is be set using input parameter `pflux_fw_rad_max`. -The scaling value `fpflux_fw_rad_max` can be varied also. - [^1]: “ADAS: Docmentation,” Adas.ac.uk, 2024. https://www.adas.ac.uk/manual.php [^2]: “OPEN-ADAS,” Adas.ac.uk, 2025. https://open.adas.ac.uk/adf11 (accessed Jan. 15, 2025). [^3]: H. P. Summers et al., “Ionization state, excited populations and emission of impurities in dynamic finite density plasmas: I. The generalized collisional–radiative model for light elements,” Plasma Physics and Controlled Fusion, vol. 48, no. 2, pp. 263–293, Jan. 2006, doi: https://doi.org/10.1088/0741-3335/48/2/007. diff --git a/documentation/physics-models/profiles/plasma_profiles.md b/documentation/physics-models/profiles/plasma_profiles.md index ac0cf6ab29..c6514b5d51 100644 --- a/documentation/physics-models/profiles/plasma_profiles.md +++ b/documentation/physics-models/profiles/plasma_profiles.md @@ -659,7 +659,7 @@ and `ixc = 152` respectively This constraint can be activated by stating `icc = 81` in the input file -To prevent unrealistic profiles when iterating the values of `nd_plasma_electron_on_axis, nd_plasma_separatrix_electron, nd_plasma_pedestal_electron` etc, this constraint ensures that the value of `nd_plasma_electron_on_axis` is always higher that `nd_plasma_pedestal_electron` to get a converged solution. This can be scaled with `fne0` +To prevent unrealistic profiles when iterating the values of `nd_plasma_electron_on_axis, nd_plasma_separatrix_electron, nd_plasma_pedestal_electron` etc, this constraint ensures that the value of `nd_plasma_electron_on_axis` is always higher that `nd_plasma_pedestal_electron` to get a converged solution. ------- @@ -687,7 +687,7 @@ $$ Where $A$ is the plasma aspect ratio, $P_{\text{sep}}$ is the power crossing the separatrix and is the heating power minus the radiated power in this case, $n_{\text{GW}}$ is the Greenwald density limit. -The value of `nd_plasma_separatrix_electron` is check to make sure that it does not go higher than $n_{\text{sep}}^{\text{crit}}$. This can be scaled with `fnesep` +The value of `nd_plasma_separatrix_electron` is check to make sure that it does not go higher than $n_{\text{sep}}^{\text{crit}}$. [^1]: M. Bernert et al. Plasma Phys. Control. Fus. **57** (2015) 014038 [^2]: N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', diff --git a/documentation/physics-models/pulsed-plant.md b/documentation/physics-models/pulsed-plant.md index 047a5e0e3f..0a0b73a0e8 100644 --- a/documentation/physics-models/pulsed-plant.md +++ b/documentation/physics-models/pulsed-plant.md @@ -12,7 +12,7 @@ cases, as even a steady-state reactor has to be started up. ## Start-up power requirements The auxiliary power reaching the plasma can be constrained to be more than the minimum allowable -value `p_hcd_injected_min_mw` by turning on constraint equation no. 40 with iteration variable no. 64 (`fp_hcd_injected_min_mw`). +value `p_hcd_injected_min_mw` by turning on constraint equation no. 40. The value of `p_hcd_injected_min_mw` is set in the input file. The auxiliary power required during the start-up and ramp-up phase is not calculated. (The code @@ -41,7 +41,7 @@ can be set as an iteration variable (65). The ramp-up and shutdown time in the p equal to `t_plant_pulse_plasma_current_ramp_up`. To ensure that the plasma current ramp rate during start-up is prevented from being too high, as governed by the requirement to maintain plasma stability by ensuring that the induced current has time to diffuse into the body of the plasma, constraint equation no. 41 should be -turned on with iteration variable no. 66 `ft_current_ramp_up` and input `t_current_ramp_up_min`, the minimum plasma current +turned on with input `t_current_ramp_up_min`, the minimum plasma current ramp-up time. ## Burn time @@ -49,7 +49,7 @@ ramp-up time. The length of the burn time is calculated from the surplus volt-seconds available from the Central Solenoid and the other PF coils during the plasma burn phase, after the flux required during the plasma start-up is taken into account. A minimum burn time (`t_burn_min`) can be enforced via -constraint equation no. 13 and iteration variable no 21 (`ft_burn_min`). +constraint equation no. 13. ## Currents over time diff --git a/documentation/solver/solver-guide.md b/documentation/solver/solver-guide.md index d459ca477c..e75513d3a7 100644 --- a/documentation/solver/solver-guide.md +++ b/documentation/solver/solver-guide.md @@ -37,8 +37,7 @@ thereby ensuring that $g = h$. ## Limit Equations The limit equations are inequalities that ensure that various physics or engineering -limits are not exceeded. Each of these equations has an associated `f-value`, which allow -them to be coded as equalities. +limits are not exceeded. The f-values are used as follows. In general, limit equations have the form @@ -73,9 +72,7 @@ For example, to set the net electric power to a certain value, the following should be carried out: 1. Activate `constraint 16` (net electric power lower limit) by including it in the `icc` array -2. Set the corresponding `f-value` `fp_plant_electric_net_required_mw = 1.0D0` -3. Ensure that `fp_plant_electric_net_required_mw` (iteration variable no. 25) **IS NOT** selected as an iteration variable. -4. Set `p_plant_electric_net_required_mw` to the required net electric power. +2. Set `p_plant_electric_net_required_mw` to the required net electric power. Limit equations are not restricted to optimisation mode. In non-optimisation mode, the iteration variables are not bounded, but the `f-values` can still be used to provide information about diff --git a/documentation/usage/troubleshooting.md b/documentation/usage/troubleshooting.md index 089bc1971c..fb9b3ab068 100644 --- a/documentation/usage/troubleshooting.md +++ b/documentation/usage/troubleshooting.md @@ -128,12 +128,6 @@ equations and the iteration variables that determines whether the code will eb s producing a useful result. It can be somewhat laborious process to arrive at a working vase, and experience is often of great value in this situation. -It should be remembered that sufficient iteration variables should be used to solve each constraint -equation. For instance, a specific limit equation may be $A \leq B$, i.e. $A = fB$, where the -f-value $f$ must lie between zero and one for the relation to be satisfied. However, if none of -the iteration variables have any effect on the values of $A$ and $B$, and $A$ happens to be -*greater* than $B$, the PROCESS will clearly not be able to solve the constraint. - The lower and upper bounds of the iteration variables are all available to be changed in the input file. Constraints can be relaxed in a controlled manner by moving these bounds, although in some cases care should be taken to ensure that un-physical values cannot occur. The code indicates which diff --git a/examples/data/large_tokamak_eval_IN.DAT b/examples/data/large_tokamak_eval_IN.DAT index 0e1e9937e3..3c661e701c 100644 --- a/examples/data/large_tokamak_eval_IN.DAT +++ b/examples/data/large_tokamak_eval_IN.DAT @@ -92,16 +92,6 @@ dr_shld_blkt_gap = 0.02 * gap between vacuum vessel and blanket (m) *---------------Constraint Variables---------------* b_tf_inboard_max = 14.0 * maximum peak toroidal field (T) (`constraint equation 25`) -fbeta_max = 0.5 * f-value for beta limit (`constraint equation 24`; `iteration variable 36`) -fdene = 1.2 * f-value for density limit (`constraint equation 5`; `iteration variable 9`) -fiooic = 0.65 * f-value for TF coil operating current / critical current ratio -fjohc = 0.6 * f-value for central solenoid current at end-of-flattop -fjohc0 = 0.6 * f-value for central solenoid current at beginning of pulse -fjprot = 1.0 * f-value for TF coil winding pack current density -foh_stress = 1.0 * f-value for Tresca yield criterion in Central Solenoid -fmaxvvstress = 1.0 * f-value for maximum permitted stress of the VV -fvdump = 1.0 * f-value for dump voltage (`constraint equation 34`; `iteration variable 51`) -fpflux_fw_neutron_max_mw = 1.0 * f-value for maximum wall load (`constraint equation 8`; `iteration variable 14`) p_plant_electric_net_required_mw = 400.0 * required net electric power (MW) (`constraint equation 16`) p_fusion_total_max_mw = 3000 * maximum fusion power (MW) (`constraint equation 9`) psepbqarmax = 10.0 * maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`) diff --git a/process/constraints.py b/process/constraints.py index 437f289359..e45ac016f6 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -638,7 +638,6 @@ def constraint_equation_18(): """Equation for divertor heat load upper limit author: P B Lloyd, CCFE, Culham Science Centre - fpflux_div_heat_load_mw: f-value for divertor heat load pflux_div_heat_load_max_mw: heat load limit (MW/m2) pflux_div_heat_load_mw: divertor heat load (MW/m2) """ @@ -812,17 +811,13 @@ def constraint_equation_24(): # Beta limit applies to toroidal beta elif data_structure.physics_variables.i_beta_component == 3: cc = ( - ( - data_structure.physics_variables.beta_total_vol_avg - * ( - data_structure.physics_variables.b_plasma_total - / data_structure.physics_variables.b_plasma_toroidal_on_axis - ) - ** 2 + data_structure.physics_variables.beta_total_vol_avg + * ( + data_structure.physics_variables.b_plasma_total + / data_structure.physics_variables.b_plasma_toroidal_on_axis ) - / data_structure.physics_variables.beta_vol_avg_max - - 1.0 * data_structure.constraint_variables.fbeta_max - ) + ** 2 + ) / data_structure.physics_variables.beta_vol_avg_max - 1.0 con = data_structure.physics_variables.beta_vol_avg_max err = data_structure.physics_variables.beta_vol_avg_max - ( data_structure.physics_variables.beta_total_vol_avg @@ -1950,8 +1945,11 @@ def constraint_equation_81(): ) return ConstraintResult( cc, - data_structure.physics_variables.fne0, - data_structure.physics_variables.fne0 * cc, + data_structure.physics_variables.nd_plasma_electron_on_axis, + ( + data_structure.physics_variables.nd_plasma_electron_on_axis + - data_structure.physics_variables.nd_plasma_pedestal_electron + ), ) diff --git a/process/data_structure/build_variables.py b/process/data_structure/build_variables.py index 4a75fe5b51..586a9749fc 100644 --- a/process/data_structure/build_variables.py +++ b/process/data_structure/build_variables.py @@ -90,10 +90,6 @@ """vacuum vessel double walled shell thicknesses (m)""" -f_avspace: float = None -"""F-value for stellarator radial space check (`constraint equation 83`)""" - - fcspc: float = None """Fraction of space occupied by CS pre-compression structure""" @@ -427,7 +423,6 @@ def init_build_variables(): global dz_vv_upper global dz_vv_lower global dr_vv_shells - global f_avspace global fcspc global fseppc global a_fw_total_full_coverage @@ -522,7 +517,6 @@ def init_build_variables(): dz_vv_upper = 0.07 dz_vv_lower = 0.07 dr_vv_shells = 0.12 - f_avspace = 1.0 fcspc = 0.6 fseppc = 3.5e8 a_fw_total_full_coverage = 0.0 diff --git a/process/data_structure/constraint_variables.py b/process/data_structure/constraint_variables.py index 5d48da11d3..0b3c9c0c5a 100644 --- a/process/data_structure/constraint_variables.py +++ b/process/data_structure/constraint_variables.py @@ -93,6 +93,9 @@ zeff_max: float = None """maximum value for Zeff (`constraint equation 64`)""" +fl_h_threshold: float = None +"""f-value for L-H power threshold (`constraint equation 15`, `iteration variable 103`)""" + def init_constraint_variables(): """Initialise the constraint variables""" @@ -122,6 +125,7 @@ def init_constraint_variables(): global pflux_fw_neutron_max_mw global f_alpha_energy_confinement_min global zeff_max + global fl_h_threshold p_hcd_injected_min_mw = 0.1 beta_poloidal_max = 0.19 @@ -149,3 +153,4 @@ def init_constraint_variables(): pflux_fw_neutron_max_mw = 1.0 f_alpha_energy_confinement_min = 5.0 zeff_max = 3.6 + fl_h_threshold = 1.0 diff --git a/process/data_structure/cost_variables.py b/process/data_structure/cost_variables.py index c141a3fdd6..980e97c4a2 100644 --- a/process/data_structure/cost_variables.py +++ b/process/data_structure/cost_variables.py @@ -476,10 +476,6 @@ """Unit cost for unshielded non-active buildings ($/m3)""" -favail: float = None -"""F-value for minimum availability (`constraint equation 61`)""" - - num_rh_systems: int = None """Number of remote handling systems (1-10)""" @@ -1340,7 +1336,6 @@ def init_cost_variables(): global avail_min global tok_build_cost_per_vol global light_build_cost_per_vol - global favail global num_rh_systems global conf_mag global div_prob_fail @@ -1495,7 +1490,6 @@ def init_cost_variables(): avail_min = 0.75 tok_build_cost_per_vol = 1283.0 light_build_cost_per_vol = 270.0 - favail = 1.0 num_rh_systems = 4 conf_mag = 0.99 div_prob_fail = 0.0002 diff --git a/process/data_structure/heat_transport_variables.py b/process/data_structure/heat_transport_variables.py index b8820eadef..03ef99a819 100644 --- a/process/data_structure/heat_transport_variables.py +++ b/process/data_structure/heat_transport_variables.py @@ -20,13 +20,6 @@ """ -f_crypmw: float = None -"""f-value for maximum cryogenic plant power -Iteration variable ixc = 164 -Constraint equation icc = 87 -""" - - etatf: float = None """AC to resistive power conversion for TF coils""" @@ -233,7 +226,6 @@ def init_heat_transport_variables(): global p_plant_electric_base global p_cryo_plant_electric_mw global p_cryo_plant_electric_max_mw - global f_crypmw global etatf global eta_turbine global etath_liq @@ -284,7 +276,6 @@ def init_heat_transport_variables(): p_plant_electric_base = 5.0e6 p_cryo_plant_electric_mw = 0.0 p_cryo_plant_electric_max_mw = 50.0 - f_crypmw = 1.0 etatf = 0.9 eta_turbine = 0.35 etath_liq = 0.35 diff --git a/process/data_structure/ife_variables.py b/process/data_structure/ife_variables.py index aa4dc18d98..fe3e4d4df9 100644 --- a/process/data_structure/ife_variables.py +++ b/process/data_structure/ife_variables.py @@ -148,10 +148,6 @@ """radius of FLiBe/lithium inlet (m) (`ifetyp=3,4`)""" -frrmax: float = None -"""f-value for maximum IFE repetition rate (`constraint equation 50`, `iteration variable 86`)""" - - fwdr: float = None """radial thickness of IFE first wall (m)""" @@ -527,7 +523,6 @@ def init_ife_variables(): global fbreed global fburn global flirad - global frrmax global fwdr global fwdzl global fwdzu @@ -685,7 +680,6 @@ def init_ife_variables(): fbreed = 0.51 fburn = 0.3333 flirad = 0.78 - frrmax = 1.0 fwdr = 0.01 fwdzl = 0.01 fwdzu = 0.01 diff --git a/process/data_structure/numerics.py b/process/data_structure/numerics.py index cace7d6905..ad8e00806a 100644 --- a/process/data_structure/numerics.py +++ b/process/data_structure/numerics.py @@ -167,26 +167,25 @@ * (70) ensure that teomp = separatrix temperature in the pedestal profile, (itv 119 (temp_plasma_separatrix_kev)) * (71) ensure that neomp = separatrix density (nd_plasma_separatrix_electron) x neratio -* (72) central solenoid shear stress limit (Tresca yield criterion) (itv 123 foh_stress) -* (73) Psep >= Plh + Paux (itv 137 (fplhsep)) -* (74) TFC quench < temp_croco_quench_max (itv 141 (ftemp_croco_quench_max)) -* (75) TFC current/copper area < Maximum (itv 143 f_coppera_m2) +* (72) central solenoid shear stress limit (Tresca yield criterion) +* (73) Psep >= Plh + Paux +* (75) TFC current/copper area < Maximum * (76) Eich critical separatrix density * (77) TF coil current per turn upper limit -* (78) Reinke criterion impurity fraction lower limit (itv 147 freinke) -* (79) Peak CS field upper limit (itv 149 fb_cs_limit_max) -* (80) Divertor power lower limit p_plasma_separatrix_mw (itv 153 fp_plasma_separatrix_min_mw) -* (81) Ne(0) > ne(ped) constraint (itv 154 fne0) -* (82) toroidalgap > dx_tf_inboard_out_toroidal constraint (itv 171 ftoroidalgap) -* (83) Radial build consistency for stellarators (itv 172 f_avspace) +* (78) Reinke criterion impurity fraction lower limit +* (79) Peak CS field upper limit +* (80) Divertor power lower limit p_plasma_separatrix_mw +* (81) Ne(0) > ne(ped) constraint +* (82) toroidalgap > dx_tf_inboard_out_toroidal constraint +* (83) Radial build consistency for stellarators * (84) Lower limit for beta (itv 173 fbeta_min) * (85) Constraint for CP lifetime * (86) Constraint for TF coil turn dimension * (87) Constraint for cryogenic power * (88) Constraint for TF coil strain absolute value * (89) Constraint for CS coil quench protection -* (90) Lower Limit on number of stress load cycles for CS (itr 167 fncycle) -* (91) Checking if the design point is ECRH ignitable (itv 168 fecrh_ignition) +* (90) Lower Limit on number of stress load cycles for CS +* (91) Checking if the design point is ECRH ignitable * (92) D/T/He3 ratio in fuel sums to 1 """ @@ -204,53 +203,28 @@ * ( 5) beta_total_vol_avg * ( 6) nd_plasma_electrons_vol_avg * ( 7) f_nd_beam_electron -* ( 8) fbeta_poloidal_eps (f-value for equation 6) -* ( 9) fdene (f-value for equation 5) * (10) hfact * (11) p_hcd_primary_extra_heat_mw * (12) oacdcp * (13) dr_tf_inboard (NOT RECOMMENDED) -* (14) fpflux_fw_neutron_max_mw (f-value for equation 8) -* (15) fvs_plasma_total_required (f-value for equation 12) * (16) dr_cs * (17) t_plant_pulse_dwell * (18) q * (19) e_beam_kev * (20) temp_cp_average -* (21) ft_burn_min (f-value for equation 13) * (22) NOT USED * (23) fcoolcp * (24) NOT USED -* (25) fp_plant_electric_net_required_mw (f-value for equation 16) -* (26) fp_fusion_total_max_mw (f-value for equation 9) -* (27) fpflux_div_heat_load_mw (f-value for equation 18) -* (28) fradpwr (f-value for equation 17), total radiation fraction * (29) dr_bore -* (30) fmva (f-value for equation 19) * (31) gapomin -* (32) frminor (f-value for equation 21) -* (33) fradius_beam_tangency (f-value for equation 20) * (34) NOT USED -* (35) fb_tf_inboard_max (f-value for equation 25) -* (36) fbeta_max (f-value for equation 24) * (37) j_cs_flat_top_end -* (38) fjohc (f-value for equation 26) -* (39) fjohc0 (f-value for equation 27) -* (40) feta_cd_norm_hcd_primary_max (f-value for equation 37) * (41) f_j_cs_start_pulse_end_flat_top * (42) dr_cs_tf_gap * (43) NOT USED * (44) f_c_plasma_non_inductive -* (45) fbig_q_plasma_min (f-value for equation 28) -* (46) fp_hcd_injected_max (f-value for equation 30) * (47) feffcd -* (48) fstrcase (f-value for equation 31) -* (49) fstrcond (f-value for equation 32) -* (50) fiooic (f-value for equation 33) -* (51) fvdump (f-value for equation 34) * (52) NOT USED -* (53) fjprot (f-value for equation 35) -* (54) ftmargtf (f-value for equation 36) * (55) NOT USED * (56) t_tf_superconductor_quench * (57) dr_tf_nose_case @@ -258,67 +232,40 @@ * (59) f_a_tf_turn_cable_copper * (60) c_tf_turn * (61) dr_shld_vv_gap_inboard -* (62) fdtmp (f-value for equation 38) -* (63) ftemp_fw_max (f-value for equation 39) -* (64) fp_hcd_injected_min_mw (f-value for equation 40) * (65) t_plant_pulse_plasma_current_ramp_up -* (66) ft_current_ramp_up (f-value for equation 41) -* (67) ft_cycle_min (f-value for equation 42) -* (68) fptemp (f-value for equation 44) * (69) rcool * (70) vcool -* (71) fq95_min (f-value for equation 45) -* (72) fipir (f-value for equation 46) * (73) dr_fw_plasma_gap_inboard * (74) dr_fw_plasma_gap_outboard * (75) f_dr_tf_outboard_inboard * (76) NOT USED * (77) NOT USED * (78) NOT USED -* (79) fbeta_poloidal (f-value for equation 48) * (80) NOT USED * (81) edrive * (82) drveff * (83) tgain * (84) chrad * (85) pdrive -* (86) frrmax (f-value for equation 50) * (87) NOT USED * (88) NOT USED -* (89) ftbr (f-value for equation 52) * (90) blbuith * (91) blbuoth -* (92) fflutf (f-value for equation 53) * (93) dr_shld_inboard * (94) dr_shld_outboard -* (95) fptfnuc (f-value for equation 54) -* (96) fvvhe (f-value for equation 55) -* (97) fpsepr (f-value for equation 56) * (98) f_blkt_li6_enrichment * (99) NOT USED * (100) NOT USED * (101) NOT USED * (102) f_nd_impurity_electronsvar # OBSOLETE * (103) fl_h_threshold (f-value for equation 15) -* (104)fr_conducting_wall (f-value for equation 23) -* (105) fnbshinef (f-value for equation 59) -* (106) ftmargoh (f-value for equation 60) -* (107) favail (f-value for equation 61) * (108) breeder_f: Volume of Li4SiO4 / (Volume of Be12Ti + Li4SiO4) * (109) f_nd_alpha_electron: thermal alpha density / electron density -* (110) falpha_energy_confinement: Lower limit on f_alpha_energy_confinement the ratio of alpha -* (111) fniterpump: f-value for constraint that number -* (112) fzeff_max: f-value for max Zeff (f-value for equation 64) -* (113) ftaucq: f-value for minimum quench time (f-value for equation 65) * (114) len_fw_channel: Length of a single first wall channel -* (115) fpoloidalpower: f-value for max rate of change of -* (116) fpflux_fw_rad_max: f-value for radiation wall load limit (eq. 67) -* (117) fpsepbqar: f-value for Psep*Bt/qar upper limit (eq. 68) * (119) temp_plasma_separatrix_kev: separatrix temperature calculated by the Kallenbach divertor model * (120) ttarget: Plasma temperature adjacent to divertor sheath [eV] * (121) neratio: ratio of mean SOL density at OMP to separatrix density at OMP * (122) f_a_cs_turn_steel : streel fraction of Central Solenoid -* (123) foh_stress : f-value for CS coil Tresca yield criterion (f-value for eq. 72) * (124) qtargettotal : Power density on target including surface recombination [W/m2] * (125) f_nd_impurity_electrons(3) : Beryllium density fraction relative to electron density * (126) f_nd_impurity_electrons(4) : Carbon density fraction relative to electron density @@ -332,38 +279,20 @@ * (134) f_nd_impurity_electrons(12) : Krypton density fraction relative to electron density * (135) f_nd_impurity_electrons(13) : Xenon density fraction relative to electron density * (136) f_nd_impurity_electrons(14) : Tungsten density fraction relative to electron density -* (137) fplhsep (f-value for equation 73) * (138) dx_hts_tape_rebco : thickness of REBCO layer in tape (m) * (139) dx_hts_tape_copper : thickness of copper layer in tape (m) * (140) dr_tf_wp_with_insulation : radial thickness of TFC winding pack (m) -* (141) ftemp_croco_quench_max : TF coil quench temperature < temp_croco_quench_max (f-value for equation 74) * (142) nd_plasma_separatrix_electron : electron density at separatrix [m-3] * (143) f_copperA_m2 : TF coil current / copper area < Maximum value -* (144) fnesep : Eich critical electron density at separatrix * (145) f_nd_plasma_pedestal_greenwald : fraction of Greenwald density to set as pedestal-top density -* (146) fc_tf_turn_max : F-value for TF coil current per turn limit (constraint equation 77) -* (147) freinke : F-value for Reinke detachment criterion (constraint equation 78) * (148) fzactual : fraction of impurity at SOL with Reinke detachment criterion -* (149) fb_cs_limit_max : F-value for max peak CS field (con. 79, itvar 149) * (150) REMOVED * (151) REMOVED * (152) f_nd_plasma_separatrix_greenwald : Ratio of separatrix density to Greenwald density -* (153) fp_plasma_separatrix_min_mw : F-value for minimum p_plasma_separatrix_mw (con. 80) -* (154) fne0 : F-value for ne(0) > ne(ped) (con. 81) * (155) pfusife : IFE input fusion power (MW) (ifedrv=3 only) * (156) rrin : Input IFE repetition rate (Hz) (ifedrv=3 only) -* (157) fvs_cs_pf_total_ramp : F-value for available to required start up flux (con. 51) * (158) dx_croco_strand_copper : Thickness of CroCo copper tube (m) -* (159) ftoroidalgap : F-value for toroidalgap > dx_tf_inboard_out_toroidal constraint (con. 82) -* (160) f_avspace (f-value for equation 83) -* (161) fbeta_min (f-value for equation 84) * (162) r_cp_top : Top outer radius of the centropost (ST only) (m) -* (163) f_t_turn_tf : f-value for TF coils WP trurn squared dimension constraint -* (164) f_crypmw : f-value for cryogenic plant power -* (165) fstr_wp : f-value for TF coil strain absolute value -* (166) f_copperaoh_m2 : CS coil current /copper area < Maximum value -* (167) fncycle : f-value for minimum CS coil stress load cycles -* (168) fecrh_ignition: f-value for equation 91 * (169) te0_ecrh_achievable: Max. achievable electron temperature at ignition point * (170) deg_div_field_plate : field line angle wrt divertor target plate (degrees) * (171) casths_fraction : TF side case thickness as fraction of toridal case thickness diff --git a/process/data_structure/pfcoil_variables.py b/process/data_structure/pfcoil_variables.py index 63be3d2f58..963c2e823f 100644 --- a/process/data_structure/pfcoil_variables.py +++ b/process/data_structure/pfcoil_variables.py @@ -175,10 +175,6 @@ """copper fraction of cable conductor (PF coils)""" -fvs_cs_pf_total_ramp: float = None -"""F-value for `constraint equation 51`""" - - i_pf_location: list[int] = None """Switch for location of PF coil group i: - =1 PF coil on top of central solenoid (flux ramp only) @@ -535,10 +531,6 @@ """Central solenoid max field limit [T]""" -fb_cs_limit_max: float = None -"""F-value for CS mmax field (`cons. 79`, `itvar 149`)""" - - f_dr_dz_cs_turn: float = None """Ratio of CS coil turn conduit length to depth""" @@ -630,7 +622,6 @@ def init_pfcoil_variables(): global f_j_cs_start_pulse_end_flat_top global fcuohsu global fcupfsu - global fvs_cs_pf_total_ramp global i_pf_location global i_pf_conductor global itr_sum @@ -701,7 +692,6 @@ def init_pfcoil_variables(): global z_pf_coil_middle global zref global b_cs_limit_max - global fb_cs_limit_max global f_dr_dz_cs_turn global dr_cs_turn global dr_cs_full @@ -732,7 +722,6 @@ def init_pfcoil_variables(): f_j_cs_start_pulse_end_flat_top = 0.9 fcuohsu = 0.7 fcupfsu = 0.69 - fvs_cs_pf_total_ramp = 1.0 i_pf_location = np.array([2, 2, 3, 0, 0, 0, 0, 0, 0, 0]) i_pf_conductor = 0 itr_sum = 0.0 @@ -803,7 +792,6 @@ def init_pfcoil_variables(): z_pf_coil_middle = np.zeros(NGC2) zref = np.array([3.6, 1.2, 2.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]) b_cs_limit_max = 13.0 - fb_cs_limit_max = 1.0 f_dr_dz_cs_turn = 70.0 / 22.0 dr_cs_turn = 0.0 dr_cs_full = 0.0 diff --git a/process/data_structure/physics_variables.py b/process/data_structure/physics_variables.py index 49f5d21484..70cf037500 100644 --- a/process/data_structure/physics_variables.py +++ b/process/data_structure/physics_variables.py @@ -502,20 +502,6 @@ """Zohm elongation scaling adjustment factor (`i_plasma_geometry=2, 3`)""" -fplhsep: float = None -"""F-value for Psep >= Plh + Paux (`constraint equation 73`)""" - - -fp_plasma_separatrix_min_mw: float = None -"""F-value for minimum p_plasma_separatrix_mw (`constraint equation 80`)""" - - -fne0: float = None -"""f-value for the constraint ne(0) > ne(ped) (`constraint equation 81`) -(`Iteration variable 154`) -""" - - f_plasma_fuel_tritium: float = None """Plasma tritium fuel fraction""" @@ -1461,9 +1447,6 @@ def init_physics_variables(): global f_plasma_fuel_helium3 global figmer global fkzohm - global fplhsep - global fp_plasma_separatrix_min_mw - global fne0 global f_plasma_fuel_tritium global fusden_total global fusrat_total @@ -1720,9 +1703,6 @@ def init_physics_variables(): f_plasma_fuel_helium3 = 0.0 figmer = 0.0 fkzohm = 1.0 - fplhsep = 1.0 - fp_plasma_separatrix_min_mw = 1.0 - fne0 = 1.0 f_plasma_fuel_tritium = 0.5 fusden_total = 0.0 fusrat_total = 0.0 diff --git a/process/data_structure/rebco_variables.py b/process/data_structure/rebco_variables.py index ff21427e04..adde613ce0 100644 --- a/process/data_structure/rebco_variables.py +++ b/process/data_structure/rebco_variables.py @@ -31,18 +31,12 @@ coppera_m2_max: float = None """Maximum TF coil current / copper area (A/m2)""" -f_coppera_m2: float = None -"""f-value for constraint 75: TF coil current / copper area < copperA_m2_max""" - copperaoh_m2: float = None """CS coil current / copper area (A/m2) (`sweep variable 61`)""" copperaoh_m2_max: float = None """Maximum CS coil current / copper area (A/m2)""" -f_copperaoh_m2: float = None -"""f-value for constraint 88: CS coil current / copper area < copperA_m2_max""" - dx_croco_strand_tape_stack: float = None """Width / thickness of tape stack in CroCo strand (m)""" @@ -76,7 +70,6 @@ def init_rebco_variables(): global dx_croco_strand_copper global copper_rrr global coppera_m2_max - global f_coppera_m2 global dx_hts_tape_total global dx_croco_strand_tape_stack global n_croco_strand_hts_tapes @@ -87,7 +80,6 @@ def init_rebco_variables(): global a_croco_strand global coppera_m2 global copperaoh_m2_max - global f_copperaoh_m2 global copperaoh_m2 dx_hts_tape_rebco = 1.0e-6 @@ -99,7 +91,6 @@ def init_rebco_variables(): dx_croco_strand_copper = 2.5e-3 copper_rrr = 100.0 coppera_m2_max = 1.0e8 - f_coppera_m2 = 1.0 dx_hts_tape_total = 6.5e-5 dx_croco_strand_tape_stack = 0.0 n_croco_strand_hts_tapes = 0.0 @@ -111,5 +102,4 @@ def init_rebco_variables(): coppera_m2 = 0.0 copperaoh_m2_max = 1.0e8 - f_copperaoh_m2 = 1.0 copperaoh_m2 = 0.0 diff --git a/process/data_structure/scan_variables.py b/process/data_structure/scan_variables.py index 30f2165612..260da9c63e 100644 --- a/process/data_structure/scan_variables.py +++ b/process/data_structure/scan_variables.py @@ -42,14 +42,10 @@
  • 5 oacdcp
  • 6 pflux_fw_neutron_max_mw
  • 7 beamfus0 -
  • 8 fbig_q_plasma_min
  • 9 temp_plasma_electron_vol_avg_kev -
  • 10 boundu(15: fvs_plasma_total_required)
  • 11 beta_norm_max
  • 12 f_c_plasma_bootstrap_max
  • 13 boundu(10: hfact) -
  • 14 fiooic -
  • 15 fjprot
  • 16 rmajor
  • 17 b_tf_inboard_max
  • 18 eta_cd_norm_hcd_primary_max @@ -57,7 +53,6 @@
  • 20 t_burn_min
  • 21 not used
  • 22 cfactr (N.B. requires iavail=0) -
  • 23 boundu(72: fipir)
  • 24 p_fusion_total_max_mw
  • 25 kappa
  • 26 triang diff --git a/process/data_structure/tfcoil_variables.py b/process/data_structure/tfcoil_variables.py index d1d56ed36f..2f270015b6 100644 --- a/process/data_structure/tfcoil_variables.py +++ b/process/data_structure/tfcoil_variables.py @@ -135,15 +135,6 @@ """ -f_t_turn_tf: float = None -"""f-value for TF turn edge length constraint -If the turn is not a square (i_tf_turns_integer = 1) a squared turn of -equivelent size is use for this constraint -iteration variable ixc = 175 -constraint equation icc = 86 -""" - - t_turn_tf_max: float = None """TF turn edge length including turn insulation upper limit [m] If the turn is not a square (i_tf_turns_integer = 1) a squared turn of @@ -511,10 +502,6 @@ """Minimal distance between two toroidal coils. (m)""" -ftoroidalgap: float = None -"""F-value for minimum dx_tf_inboard_out_toroidal (`constraint equation 82`)""" - - ripple_b_tf_plasma_edge_max: float = None """maximum allowable toroidal field ripple amplitude at plasma edge (%)""" @@ -1115,7 +1102,6 @@ def init_tfcoil_variables(): global t_conductor global dx_tf_turn_general global i_dx_tf_turn_general_input - global f_t_turn_tf global t_turn_tf_max global dx_tf_turn_cable_space_general global i_dx_tf_turn_cable_space_general_input @@ -1177,7 +1163,6 @@ def init_tfcoil_variables(): global r_b_tf_inboard_peak global res_tf_leg global toroidalgap - global ftoroidalgap global ripple_b_tf_plasma_edge_max global ripple_b_tf_plasma_edge global c_tf_total @@ -1333,7 +1318,6 @@ def init_tfcoil_variables(): i_dx_tf_turn_cable_space_general_input = False dx_tf_turn_general = 0.0 i_dx_tf_turn_general_input = False - f_t_turn_tf = 1.0 t_turn_tf_max = 0.05 acs = 0.0 cdtfleg = 0.0 @@ -1413,7 +1397,6 @@ def init_tfcoil_variables(): r_b_tf_inboard_peak = 0.0 res_tf_leg = 0.0 toroidalgap = 1.0 # [m] - ftoroidalgap = 1.0 ripple_b_tf_plasma_edge_max = 1.0 ripple_b_tf_plasma_edge = 0.0 c_tf_total = 0.0 diff --git a/process/input.py b/process/input.py index 91c7eebfc1..85eb1ed5fc 100644 --- a/process/input.py +++ b/process/input.py @@ -179,9 +179,6 @@ def __post_init__(self): data_structure.impurity_radiation_module, float, array=True ), "fkzohm": InputVariable(data_structure.physics_variables, float, range=(0.5, 2.0)), - "fnesep": InputVariable( - data_structure.constraint_variables, float, range=(0.1, 20.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)), "admv": InputVariable( @@ -684,18 +681,6 @@ def __post_init__(self): "f_asym": InputVariable( data_structure.stellarator_variables, float, range=(0.9, 2.0) ), - "f_avspace": InputVariable( - data_structure.build_variables, float, range=(0.001, 10.0) - ), - "f_coppera_m2": InputVariable( - data_structure.rebco_variables, float, range=(0.001, 10.0) - ), - "f_copperaoh_m2": InputVariable( - data_structure.rebco_variables, float, range=(0.001, 1.0) - ), - "f_crypmw": InputVariable( - data_structure.heat_transport_variables, float, range=(0.0, 100.0) - ), "f_fw_peak": InputVariable( data_structure.fwbs_variables, float, range=(1.0, 100.0) ), @@ -724,9 +709,6 @@ def __post_init__(self): "f_sync_reflect": InputVariable( data_structure.physics_variables, float, range=(0.0, 1.0) ), - "f_t_turn_tf": InputVariable( - data_structure.tfcoil_variables, float, range=(0.0, 1.0) - ), "f_plasma_fuel_tritium": InputVariable( data_structure.physics_variables, float, range=(0.0, 1.0) ), @@ -740,26 +722,7 @@ def __post_init__(self): "f_z_cryostat": InputVariable( data_structure.build_variables, float, range=(2.0, 10.0) ), - "falpha_energy_confinement": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 1.0) - ), "fauxbop": InputVariable(data_structure.ife_variables, float, range=(0.0, 1.0)), - "fp_hcd_injected_min_mw": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "favail": InputVariable(data_structure.cost_variables, float, range=(0.0, 1.0)), - "fbeta_max": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fbeta_min": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fbeta_poloidal": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fbeta_poloidal_eps": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "fblbe": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 1.0)), "fblbreed": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 1.0)), "fblhebmi": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 1.0)), @@ -771,9 +734,6 @@ def __post_init__(self): "fbllipb": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 1.0)), "fblss": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 1.0)), "fblvd": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 1.0)), - "fb_cs_limit_max": InputVariable( - data_structure.pfcoil_variables, float, range=(0.01, 1.0) - ), "fbreed": InputVariable(data_structure.ife_variables, float, range=(0.0, 0.999)), "fburn": InputVariable(data_structure.ife_variables, float, range=(0.01, 1.0)), "fc_building_l": InputVariable( @@ -790,9 +750,6 @@ def __post_init__(self): ), "fcontng": InputVariable(data_structure.cost_variables, float, range=(0.0, 1.0)), "fcoolcp": InputVariable(data_structure.tfcoil_variables, float, range=(0.0, 1.0)), - "ftemp_croco_quench_max": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 1.0) - ), "fcr0": InputVariable(data_structure.cost_variables, 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)), @@ -800,9 +757,6 @@ def __post_init__(self): "f_a_tf_turn_cable_copper": InputVariable( data_structure.tfcoil_variables, float, range=(0.0, 1.0) ), - "fdene": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "f_ster_div_single": InputVariable( data_structure.fwbs_variables, float, range=(0.0, 1.0) ), @@ -810,47 +764,14 @@ def __post_init__(self): "fdivwet": InputVariable( data_structure.stellarator_variables, float, range=(0.01, 1.0) ), - "fdtmp": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fecrh_ignition": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "feffcd": InputVariable( data_structure.current_drive_variables, float, range=(0.0, 20.0) ), - "fflutf": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fp_fusion_total_max_mw": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "feta_cd_norm_hcd_primary_max": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "f_a_fw_outboard_hcd": InputVariable( data_structure.fwbs_variables, float, range=(0.0, 1.0) ), - "fpflux_div_heat_load_mw": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "fhole": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 1.0)), "fhts": InputVariable(data_structure.tfcoil_variables, float, range=(0.01, 1.0)), - "fiooic": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fipir": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fjohc": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fjohc0": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fjprot": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "fkind": InputVariable(data_structure.cost_variables, float, range=(0.5, 1.0)), "fl_h_threshold": InputVariable( data_structure.constraint_variables, float, range=(0.001, 1000000.0) @@ -862,62 +783,13 @@ def __post_init__(self): "f_div_flux_expansion": InputVariable( data_structure.divertor_variables, float, range=(0.0, 10.0) ), - "fmaxvvstress": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 1.0) - ), "fmgdmw": InputVariable( data_structure.heat_transport_variables, float, range=(0.0, 100.0) ), - "fmva": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fnbshinef": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fncycle": InputVariable( - data_structure.constraint_variables, float, range=(1e-08, 1.0) - ), "fndt": InputVariable(data_structure.buildings_variables, float, range=(0.0, 10.0)), - "fne0": InputVariable(data_structure.physics_variables, float, range=(0.001, 1.0)), - "fniterpump": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "foh_stress": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 1.0) - ), "f_p_beam_orbit_loss": InputVariable( data_structure.current_drive_variables, float, range=(0.0, 0.999) ), - "fp_plasma_separatrix_min_mw": InputVariable( - data_structure.physics_variables, float, range=(0.001, 1.0) - ), - "fb_tf_inboard_max": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fp_hcd_injected_max": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fp_plant_electric_net_required_mw": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fpoloidalpower": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 1.0) - ), - "fradius_beam_tangency": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fpsepbqar": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 1.0) - ), - "fpsepr": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fptemp": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fptfnuc": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "f_p_blkt_coolant_pump_total_heat": InputVariable( data_structure.heat_transport_variables, float, range=(0.0, 0.2) ), @@ -930,99 +802,29 @@ def __post_init__(self): "f_p_shld_coolant_pump_total_heat": InputVariable( data_structure.heat_transport_variables, float, range=(0.0, 0.2) ), - "fq95_min": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fbig_q_plasma_min": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fr_conducting_wall": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "fracture_toughness": InputVariable( data_structure.cs_fatigue_variables, float, range=(0.1, 100000000.0) ), - "fradpwr": InputVariable( - data_structure.constraint_variables, float, range=(0.0, 1.0) - ), - "fpflux_fw_rad_max": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 1.0) - ), "f_radius_beam_tangency_rmajor": InputVariable( data_structure.current_drive_variables, float, range=(0.5, 2.0) ), - "freinke": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 1.0) - ), "frhocp": InputVariable(data_structure.tfcoil_variables, float, range=(0.01, 5.0)), "frholeg": InputVariable(data_structure.tfcoil_variables, float, range=(0.01, 5.0)), - "frminor": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "frrmax": InputVariable(data_structure.ife_variables, float, range=(1e-06, 1.0)), "fseppc": InputVariable( data_structure.build_variables, float, range=(1000000.0, 1000000000.0) ), - "fstr_wp": InputVariable( - data_structure.constraint_variables, float, range=(1e-09, 10.0) - ), - "fstrcase": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fstrcond": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "ft_burn_min": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "ft_current_ramp_up": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "ftbr": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "ft_cycle_min": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "ftmargoh": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "ftmargtf": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "ftoroidalgap": InputVariable( - data_structure.tfcoil_variables, float, range=(0.001, 10.0) - ), - "ftemp_fw_max": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), - "fvdump": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "fvoldw": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 10.0)), "fvolsi": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 10.0)), "fvolso": InputVariable(data_structure.fwbs_variables, float, range=(0.0, 10.0)), - "fvs_plasma_total_required": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "f_c_plasma_non_inductive": InputVariable( data_structure.physics_variables, float, range=(0.0, 1.0) ), - "fvs_cs_pf_total_ramp": InputVariable( - data_structure.pfcoil_variables, float, range=(0.001, 10.0) - ), - "fvvhe": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "fw_armour_thickness": InputVariable( data_structure.fwbs_variables, float, range=(0.0, 1.0) ), "fw_th_conductivity": InputVariable( data_structure.fwbs_variables, float, range=(1.0, 100.0) ), - "fpflux_fw_neutron_max_mw": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 10.0) - ), "fwbs_nref": InputVariable( data_structure.cost_variables, float, range=(1000.0, 100000000.0) ), @@ -1040,9 +842,6 @@ def __post_init__(self): "fwdzl": InputVariable(data_structure.ife_variables, float, range=(0.0, 10.0)), "fwdzu": InputVariable(data_structure.ife_variables, float, range=(0.0, 10.0)), "fzactual": InputVariable(data_structure.reinke_variables, float, range=(0.0, 1.0)), - "fzeff_max": InputVariable( - data_structure.constraint_variables, float, range=(0.001, 1.0) - ), "eta_cd_norm_ecrh": InputVariable( data_structure.current_drive_variables, float, range=(0.0, 1.0) ), diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index 6a27444b89..0ea3f26759 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -69,7 +69,6 @@ "i_strain_wp": "i_str_wp", "strain_wp_max": "str_wp_max", "strain_wp": "str_wp", - "fstrain_wp": "fstr_wp", "rad_fraction": "rad_fraction_total", "pcoreradmw": "p_plasma_inner_rad_mw", "pedgeradmw": "p_plasma_outer_rad_mw", @@ -99,7 +98,6 @@ "impvar": None, "fimpvar": None, "sigvvall": "max_vv_stress", - "ftaucq": "fmaxvvstress", "fradmin": None, "ftr": "f_plasma_fuel_tritium", "iculdl": "idensl", @@ -134,8 +132,6 @@ "fhe3": "f_plasma_fuel_helium3", "falpha": "f_p_alpha_plasma_deposited", "idensl": "i_density_limit", - "ftburn": "ft_burn_min", - "ftohs": "ft_current_ramp_up", "tbrnmn": "t_burn_min", "tohs": "t_plant_pulse_plasma_current_ramp_up", "tdwell": "t_plant_pulse_dwell", @@ -145,16 +141,12 @@ "pdivmax/rmajor": "pdivmax_over_rmajor", "pdivtbt/qar": "pdivtbt_over_qar", "betpmx": "beta_poloidal_max", - "fbetatry": "fbeta_max", - "fbetap": "fbeta_poloidal", "iculbl": "i_beta_component", "epbetmax": "beta_poloidal_eps_max", "dnbeta": "beta_norm_max", "ifalphap": "i_beta_fast_alpha", "betalim": "beta_vol_avg_max", "betalim_lower": "beta_vol_avg_min", - "fbeta": "fbeta_poloidal_eps", - "fcwr": "fr_conducting_wall", "cvol": "f_vol_plasma", "cwrmax": "f_r_conducting_wall", "ishape": "i_plasma_geometry", @@ -191,7 +183,6 @@ "d_vv_out": "dr_vv_outboard", "iblnkith": "i_blkt_inboard", "taulimit": "f_alpha_energy_confinement_min", - "ftaulimit": "falpha_energy_confinement", "isc": "i_confinement_time", "iradloss": "i_rad_loss", "iinvqd": None, @@ -228,8 +219,6 @@ "vf": "f_a_pf_coil_void", "coheof": "j_cs_flat_top_end", "ipfres": "i_pf_conductor", - "fvssu": "fvs_cs_pf_total_ramp", - "fbmaxcs": "fb_cs_limit_max", "fcohbop": "f_j_cs_start_pulse_end_flat_top", "ohhghf": "f_z_cs_tf_internal", "vfohc": "f_a_cs_void", @@ -318,9 +307,7 @@ "divclfr": "f_vol_div_coolant", "divdens": "den_div_structure", "divplt": "dx_div_plate", - "fhldiv": "fpflux_div_heat_load_mw", "flux_exp": "f_div_flux_expansion", - "fpdivlim": "fp_plasma_separatrix_min_mw", "hldiv": "pflux_div_heat_load_mw", "hldivlim": "pflux_div_heat_load_max_mw", "pdivtlim": "p_plasma_separatrix_min_mw", @@ -328,7 +315,6 @@ "ignite": "i_plasma_ignited", "iprofile": None, "powfmax": "p_fusion_total_max_mw", - "ffuspow": "fp_fusion_total_max_mw", "roughness": "roughness_fw_channel", "casthi_is_fraction": "i_f_dr_tf_plasma_case", "casthi_fraction": "f_dr_tf_plasma_case", @@ -359,21 +345,10 @@ "vftf": "f_a_tf_turn_cable_space_extra_void", "beamwd": "dx_beam_duct", "frbeam": "f_radius_beam_tangency_rmajor", - "fportsz": "fradius_beam_tangency", "pinjmax": None, "f_alpha_plasma": "f_p_alpha_plasma_deposited", "bmxlim": "b_tf_inboard_max", "cpttf_max": "c_tf_turn_max", - "fgamcd": "feta_cd_norm_hcd_primary_max", - "fpeakb": "fb_tf_inboard_max", - "fpinj": "fp_hcd_injected_max", - "fpnetel": "fp_plant_electric_net_required_mw", - "fradwall": "fpflux_fw_rad_max", - "ft_burn": "ft_burn_min", - "ftcycl": "ft_cycle_min", - "ftpeak": "ftemp_fw_max", - "fvs": "fvs_plasma_total_required", - "fwalld": "fpflux_fw_neutron_max_mw", "gammax": "eta_cd_norm_hcd_primary_max", "pnetelin": "p_plant_electric_net_required_mw", "tbeamin": "n_beam_decay_lengths_core_required", @@ -381,12 +356,7 @@ "walalw": "pflux_fw_neutron_max_mw", "dx_tf_side_case": "dx_tf_side_case_min", "bigqmin": "big_q_plasma_min", - "fauxmn": "fp_hcd_injected_min_mw", - "fcqt": "ftemp_croco_quench_max", "fpsep": None, - "fq": "fq95_min", - "fqval": "fbig_q_plasma_min", - "fzeffmax": "fzeff_max", "ptempalw": "temp_cp_max", "tmax_croco": "temp_croco_quench_max", "vdalw": "v_tf_coil_dump_quench_max_kv", @@ -504,3 +474,74 @@ kallenbach_message = "The Kallenbach model is currently not included in PROCESS. See issue #1886 for more information on the use of the Kallenbach model. " OBS_VARS.update(dict.fromkeys(kallenbach_list, None)) OBS_VARS_HELP.update(dict.fromkeys(kallenbach_list, kallenbach_message)) + + +fvalues_list = [ + "fp_hcd_injected_min_mw", + "fbeta_poloidal_eps", + "fbeta_poloidal", + "fbeta_max", + "fbeta_min", + "fc_tf_turn_max", + "fr_conducting_wall", + "fdene", + "fdtmp", + "fecrh_ignition", + "fflutf", + "fp_fusion_total_max_mw", + "feta_cd_norm_hcd_primary_max", + "fpflux_div_heat_load_mw", + "fiooic", + "fipir", + "fjohc", + "fjohc0", + "fjprot", + "fl_h_threshold", + "fmva", + "fnbshinef", + "fncycle", + "fnesep", + "foh_stress", + "fb_tf_inboard_max", + "fp_hcd_injected_max", + "fp_plant_electric_net_required_mw", + "fradius_beam_tangency", + "fpsepbqar", + "fpsepr", + "fptemp", + "fptfnuc", + "fq95_min", + "fbig_q_plasma_min", + "fradpwr", + "fpflux_fw_rad_max", + "freinke", + "frminor", + "fstrcase", + "fstrcond", + "fstr_wp", + "fmaxvvstress", + "ftbr", + "ft_burn_min", + "ft_cycle_min", + "ftmargoh", + "ftmargtf", + "ft_current_ramp_up", + "ftemp_fw_max", + "fvdump", + "fvs_plasma_total_required", + "fvvhe", + "fpflux_fw_neutron_max_mw", + "fzeff_max", + "falpha_energy_confinement", + "fniterpump", + "fpoloidalpower", + "ftemp_croco_quench_max", +] + +OBS_VARS.update(dict.fromkeys(fvalues_list, None)) +OBS_VARS_HELP.update( + dict.fromkeys( + fvalues_list, + "F-values are no longer supported, please use inequality constraints", + ) +) diff --git a/process/io/plot_radial_build.py b/process/io/plot_radial_build.py index 7f48dabddd..6ba6388f04 100644 --- a/process/io/plot_radial_build.py +++ b/process/io/plot_radial_build.py @@ -148,14 +148,11 @@ def main(args=None): "oacdcp", "pflux_fw_neutron_max_mw", "beamfus0", - "fbig_q_plasma_min", "temp_plasma_electron_vol_avg_kev", "boundu(15)", "beta_norm_max", "f_c_plasma_bootstrap_max", "boundu(10)", - "fiooic", - "fjprot", "rmajor", "b_tf_inboard_peak_symmetric", # b_tf_inboard_max the maximum T field upper limit is the scan variable "eta_cd_norm_hcd_primary_max", @@ -217,7 +214,6 @@ def main(args=None): "", "", "", - "fvs_plasma_total_required", # actaully lower bound fvs_plasma_total_required "v_plasma_loop_burn", "res_plasma", ] diff --git a/process/io/plot_scans.py b/process/io/plot_scans.py index 8e08593e78..084b81dc35 100644 --- a/process/io/plot_scans.py +++ b/process/io/plot_scans.py @@ -297,14 +297,11 @@ def main(args=None): 5: "oacdcp", 6: "pflux_fw_neutron_max_mw", 7: "beamfus0", - 8: "fbig_q_plasma_min", 9: "temp_plasma_electron_vol_avg_kev", 10: "boundu(15)", 11: "beta_norm_max", 12: "f_c_plasma_bootstrap_max", 13: "boundu(10)", - 14: "fiooic", - 15: "fjprot", 16: "rmajor", 17: "b_tf_inboard_peak_symmetric", # b_tf_inboard_max the maximum T field upper limit is the scan variable 18: "eta_cd_norm_hcd_primary_max", diff --git a/process/iteration_variables.py b/process/iteration_variables.py index 3214f3ffec..a8a00c4985 100644 --- a/process/iteration_variables.py +++ b/process/iteration_variables.py @@ -49,10 +49,6 @@ class IterationVariable: 7: IterationVariable( "f_nd_beam_electron", data_structure.physics_variables, 1.0e-6, 1.0 ), - 8: IterationVariable( - "fbeta_poloidal_eps", data_structure.constraint_variables, 0.001, 1.0 - ), - 9: IterationVariable("fdene", data_structure.constraint_variables, 0.001, 1.0), 10: IterationVariable("hfact", data_structure.physics_variables, 0.1, 3.0), 11: IterationVariable( "p_hcd_primary_extra_heat_mw", @@ -62,12 +58,6 @@ class IterationVariable: ), 12: IterationVariable("oacdcp", data_structure.tfcoil_variables, 1.0e5, 1.50e8), 13: IterationVariable("dr_tf_inboard", data_structure.build_variables, 0.1, 5.0), - 14: IterationVariable( - "fpflux_fw_neutron_max_mw", data_structure.constraint_variables, 0.001, 1.0 - ), - 15: IterationVariable( - "fvs_plasma_total_required", data_structure.constraint_variables, 0.001, 10.000 - ), 16: IterationVariable("dr_cs", data_structure.build_variables, 0.01, 10.00), 17: IterationVariable( "t_plant_pulse_dwell", data_structure.times_variables, 0.1, 1.0e8 @@ -79,42 +69,12 @@ class IterationVariable: 20: IterationVariable( "temp_cp_average", data_structure.tfcoil_variables, 40.00, 3.0e2 ), - 21: IterationVariable( - "ft_burn_min", data_structure.constraint_variables, 0.001, 1.0 - ), 23: IterationVariable("fcoolcp", data_structure.tfcoil_variables, 0.1, 0.50), - 25: IterationVariable( - "fp_plant_electric_net_required_mw", - data_structure.constraint_variables, - 0.001, - 1.0, - ), - 26: IterationVariable( - "fp_fusion_total_max_mw", data_structure.constraint_variables, 0.001, 1.0 - ), - 27: IterationVariable( - "fpflux_div_heat_load_mw", data_structure.constraint_variables, 0.001, 1.0 - ), - 28: IterationVariable("fradpwr", data_structure.constraint_variables, 0.001, 0.99), 29: IterationVariable("dr_bore", data_structure.build_variables, 0.1, 10.00), - 30: IterationVariable("fmva", data_structure.constraint_variables, 0.010, 1.0), 31: IterationVariable("gapomin", data_structure.build_variables, 0.001, 1.0e1), - 32: IterationVariable("frminor", data_structure.constraint_variables, 0.001, 1.0), - 33: IterationVariable( - "fradius_beam_tangency", data_structure.constraint_variables, 0.001, 1.0 - ), - 35: IterationVariable( - "fb_tf_inboard_max", data_structure.constraint_variables, 0.001, 1.0 - ), - 36: IterationVariable("fbeta_max", data_structure.constraint_variables, 0.001, 1.0), 37: IterationVariable( "j_cs_flat_top_end", data_structure.pfcoil_variables, 1.0e5, 1.0e8 ), - 38: IterationVariable("fjohc", data_structure.constraint_variables, 0.010, 1.0), - 39: IterationVariable("fjohc0", data_structure.constraint_variables, 0.001, 1.0), - 40: IterationVariable( - "feta_cd_norm_hcd_primary_max", data_structure.constraint_variables, 0.001, 1.0 - ), 41: IterationVariable( "f_j_cs_start_pulse_end_flat_top", data_structure.pfcoil_variables, 0.001, 1.0 ), @@ -122,19 +82,7 @@ class IterationVariable: 44: IterationVariable( "f_c_plasma_non_inductive", data_structure.physics_variables, 0.001, 1.0 ), - 45: IterationVariable( - "fbig_q_plasma_min", data_structure.constraint_variables, 0.001, 1.0 - ), - 46: IterationVariable( - "fp_hcd_injected_max", data_structure.constraint_variables, 0.001, 1.0 - ), 47: IterationVariable("feffcd", data_structure.current_drive_variables, 0.001, 1.0), - 48: IterationVariable("fstrcase", data_structure.constraint_variables, 0.001, 1.0), - 49: IterationVariable("fstrcond", data_structure.constraint_variables, 0.001, 1.0), - 50: IterationVariable("fiooic", data_structure.constraint_variables, 0.001, 1.0), - 51: IterationVariable("fvdump", data_structure.constraint_variables, 0.001, 1.0), - 53: IterationVariable("fjprot", data_structure.constraint_variables, 0.001, 1.0), - 54: IterationVariable("ftmargtf", data_structure.constraint_variables, 0.001, 1.0), 56: IterationVariable( "t_tf_superconductor_quench", data_structure.tfcoil_variables, 0.1, 100.0 ), @@ -151,30 +99,14 @@ class IterationVariable: 61: IterationVariable( "dr_shld_vv_gap_inboard", data_structure.build_variables, 0.001, 10.00 ), - 62: IterationVariable("fdtmp", data_structure.constraint_variables, 0.001, 1.0), - 63: IterationVariable( - "ftemp_fw_max", data_structure.constraint_variables, 0.001, 1.0 - ), - 64: IterationVariable( - "fp_hcd_injected_min_mw", data_structure.constraint_variables, 0.001, 1.0 - ), 65: IterationVariable( "t_plant_pulse_plasma_current_ramp_up", data_structure.times_variables, 0.1, 1.0e3, ), - 66: IterationVariable( - "ft_current_ramp_up", data_structure.constraint_variables, 0.001, 1.0 - ), - 67: IterationVariable( - "ft_cycle_min", data_structure.constraint_variables, 0.001, 1.0 - ), - 68: IterationVariable("fptemp", data_structure.constraint_variables, 0.001, 1.0), 69: IterationVariable("rcool", data_structure.tfcoil_variables, 0.001, 0.010), 70: IterationVariable("vcool", data_structure.tfcoil_variables, 1.0, 1.0e2), - 71: IterationVariable("fq95_min", data_structure.constraint_variables, 0.001, 1.0), - 72: IterationVariable("fipir", data_structure.constraint_variables, 0.001, 1.0), 73: IterationVariable( "dr_fw_plasma_gap_inboard", data_structure.build_variables, 0.001, 10.00 ), @@ -184,77 +116,36 @@ class IterationVariable: 75: IterationVariable( "f_dr_tf_outboard_inboard", data_structure.build_variables, 0.200, 5.0 ), - 79: IterationVariable( - "fbeta_poloidal", data_structure.constraint_variables, 0.001, 1.0 - ), 81: IterationVariable("edrive", data_structure.ife_variables, 1.0e5, 5.0e7), 82: IterationVariable("drveff", data_structure.ife_variables, 0.010, 1.0), 83: IterationVariable("tgain", data_structure.ife_variables, 1.0, 500.0), 84: IterationVariable("chrad", data_structure.ife_variables, 0.1, 20.00), 85: IterationVariable("pdrive", data_structure.ife_variables, 1.0e6, 200.0e6), - 86: IterationVariable("frrmax", data_structure.ife_variables, 0.001, 1.0), - 89: IterationVariable("ftbr", data_structure.constraint_variables, 0.001, 1.0), 90: IterationVariable("blbuith", data_structure.build_variables, 0.001, 2.0), 91: IterationVariable("blbuoth", data_structure.build_variables, 0.001, 2.0), - 92: IterationVariable("fflutf", data_structure.constraint_variables, 0.001, 1.0), 93: IterationVariable( "dr_shld_inboard", data_structure.build_variables, 0.001, 10.00 ), 94: IterationVariable( "dr_shld_outboard", data_structure.build_variables, 0.001, 10.00 ), - 95: IterationVariable("fptfnuc", data_structure.constraint_variables, 0.001, 1.0), - 96: IterationVariable("fvvhe", data_structure.constraint_variables, 0.001, 1.0), - 97: IterationVariable("fpsepr", data_structure.constraint_variables, 0.001, 1.0), 98: IterationVariable( "f_blkt_li6_enrichment", data_structure.fwbs_variables, 10.00, 100.0 ), - 103: IterationVariable( - "fl_h_threshold", data_structure.constraint_variables, 0.001, 1.0 - ), 104: IterationVariable("fcwr", data_structure.constraint_variables, 0.001, 1.0), - 105: IterationVariable( - "fnbshinef", data_structure.constraint_variables, 0.001, 1.0 - ), - 106: IterationVariable("ftmargoh", data_structure.constraint_variables, 0.001, 1.0), - 107: IterationVariable("favail", data_structure.cost_variables, 0.001, 1.0), 108: IterationVariable("breeder_f", data_structure.fwbs_variables, 0.060, 1.0), 109: IterationVariable( "f_nd_alpha_electron", data_structure.physics_variables, 0.05, 0.15 ), - 110: IterationVariable( - "falpha_energy_confinement", data_structure.constraint_variables, 0.001, 1.0 - ), - 111: IterationVariable( - "fniterpump", data_structure.constraint_variables, 0.001, 1.0 - ), - 112: IterationVariable( - "fzeff_max", data_structure.constraint_variables, 0.001, 1.0 - ), - 113: IterationVariable( - "fmaxvvstress", data_structure.constraint_variables, 0.001, 1.0 - ), 114: IterationVariable( "len_fw_channel", data_structure.fwbs_variables, 0.001, 1.0e3 ), - 115: IterationVariable( - "fpoloidalpower", data_structure.constraint_variables, 0.001, 1.0 - ), - 116: IterationVariable( - "fpflux_fw_rad_max", data_structure.constraint_variables, 0.001, 1.0 - ), - 117: IterationVariable( - "fpsepbqar", data_structure.constraint_variables, 0.001, 1.0 - ), 119: IterationVariable( "temp_plasma_separatrix_kev", data_structure.physics_variables, 0.0, 1.0e1 ), 122: IterationVariable( "f_a_cs_turn_steel", data_structure.pfcoil_variables, 0.001, 0.950 ), - 123: IterationVariable( - "foh_stress", data_structure.constraint_variables, 0.001, 1.0 - ), 125: IterationVariable( "f_nd_impurity_electrons(03)", data_structure.impurity_radiation_module, @@ -351,7 +242,6 @@ class IterationVariable: target_name="f_nd_impurity_electron_array", array_index=13, ), - 137: IterationVariable("fplhsep", data_structure.physics_variables, 0.001, 1.0), 138: IterationVariable( "dx_hts_tape_rebco", data_structure.physics_variables, 0.01e-6, 100.0e-6 ), @@ -361,64 +251,24 @@ class IterationVariable: 140: IterationVariable( "dr_tf_wp_with_insulation", data_structure.tfcoil_variables, 0.001, 2.0 ), - 141: IterationVariable( - "ftemp_croco_quench_max", data_structure.constraint_variables, 0.001, 1.0 - ), 142: IterationVariable( "nd_plasma_separatrix_electron", data_structure.physics_variables, 1.0e17, 1.0e20, ), - 143: IterationVariable("f_coppera_m2", data_structure.rebco_variables, 0.001, 1.0), - 144: IterationVariable("fnesep", data_structure.constraint_variables, 0.001, 1.0), 145: IterationVariable( "f_nd_plasma_pedestal_greenwald", data_structure.physics_variables, 0.1, 0.9 ), - 146: IterationVariable( - "fc_tf_turn_max", data_structure.constraint_variables, 0.001, 1.0 - ), - 147: IterationVariable("freinke", data_structure.constraint_variables, 0.001, 1.0), - 149: IterationVariable( - "fb_cs_limit_max", data_structure.pfcoil_variables, 0.001, 1.0 - ), 152: IterationVariable( "f_nd_plasma_separatrix_greenwald", data_structure.physics_variables, 0.001, 0.5 ), - 153: IterationVariable( - "fp_plasma_separatrix_min_mw", data_structure.physics_variables, 0.001, 1.0 - ), - 154: IterationVariable("fne0", data_structure.physics_variables, 0.001, 1.0), 155: IterationVariable("pfusife", data_structure.ife_variables, 5.0e2, 3.0e3), 156: IterationVariable("rrin", data_structure.ife_variables, 1.0, 1.0e1), - 157: IterationVariable( - "fvs_cs_pf_total_ramp", data_structure.pfcoil_variables, 1.0e-3, 1.0e1 - ), 158: IterationVariable( "dx_croco_strand_copper", data_structure.rebco_variables, 1.0e-3, 1.0e-1 ), - 159: IterationVariable( - "ftoroidalgap", data_structure.tfcoil_variables, 1.0e-4, 1.0 - ), - 160: IterationVariable("f_avspace", data_structure.build_variables, 0.010, 1.0), - 161: IterationVariable( - "fbeta_min", data_structure.constraint_variables, 0.010, 1.0 - ), 162: IterationVariable("r_cp_top", data_structure.build_variables, 0.0010, 10.0), - 163: IterationVariable( - "f_t_turn_tf", data_structure.tfcoil_variables, 0.0010, 1000.0 - ), - 164: IterationVariable( - "f_crypmw", data_structure.heat_transport_variables, 0.001, 1.0 - ), - 165: IterationVariable("fstr_wp", data_structure.constraint_variables, 1.0e-9, 1.0), - 166: IterationVariable( - "f_copperaoh_m2", data_structure.rebco_variables, 0.001, 1.0 - ), - 167: IterationVariable("fncycle", data_structure.constraint_variables, 1.0e-8, 1.0), - 168: IterationVariable( - "fecrh_ignition", data_structure.constraint_variables, 0.010, 2.0 - ), 169: IterationVariable( "te0_ecrh_achievable", data_structure.stellarator_variables, 1.0, 1.0e3 ), diff --git a/process/pfcoil.py b/process/pfcoil.py index b50f421120..0579695285 100644 --- a/process/pfcoil.py +++ b/process/pfcoil.py @@ -15,7 +15,6 @@ from process.data_structure import cs_fatigue_variables as csfv from process.data_structure import fwbs_variables as fwbsv from process.data_structure import ( - numerics, pfcoil_variables, superconducting_tf_coil_variables, ) @@ -2359,20 +2358,19 @@ def outpf(self): "OP ", ) # Check whether CS coil is hitting any limits - # iteration variable (39) fjohc0 - # iteration variable(38) fjohc if ( abs(pfcoil_variables.j_cs_flat_top_end) > 0.99e0 * abs( - numerics.boundu[37] - * pfcoil_variables.j_cs_critical_flat_top_end + # numerics.boundu[fjohc] * (which should have been 1) + pfcoil_variables.j_cs_critical_flat_top_end ) ) or ( abs(pfcoil_variables.j_cs_pulse_start) > 0.99e0 * abs( - numerics.boundu[38] * pfcoil_variables.j_cs_critical_pulse_start + # numerics.boundu[fjohc0] * (which should have been 1) + pfcoil_variables.j_cs_critical_pulse_start ) ): pfcoil_variables.cslimit = True @@ -2386,16 +2384,6 @@ def outpf(self): "CS not using max current density: further optimisation may be possible" ) - # Check whether CS coil currents are feasible from engineering POV - if ctv.fjohc > 0.7: - logger.error( - "fjohc shouldn't be above 0.7 for engineering reliability" - ) - if ctv.fjohc0 > 0.7: - logger.error( - "fjohc0 shouldn't be above 0.7 for engineering reliability" - ) - # REBCO fractures in strains above ~+/- 0.7% if ( pfcoil_variables.i_cs_superconductor == 6 diff --git a/process/scan.py b/process/scan.py index 64d97f84f0..681dd52716 100644 --- a/process/scan.py +++ b/process/scan.py @@ -50,21 +50,17 @@ def __iter__(self): 5: ScanVariable("oacdcp", "TF_inboard_leg_J_(MA/m2)"), 6: ScanVariable("pflux_fw_neutron_max_mw", "Allow._wall_load_(MW/m2)"), 7: ScanVariable("beamfus0", "Beam_bkgrd_multiplier"), - 8: ScanVariable("fbig_q_plasma_min", "Big_Q_f-value"), 9: ScanVariable("temp_plasma_electron_vol_avg_kev", "Electron_temperature_keV"), 10: ScanVariable("boundu(15)", "Volt-second_upper_bound"), 11: ScanVariable("beta_norm_max", "Beta_coefficient"), 12: ScanVariable("f_c_plasma_bootstrap_max", "Bootstrap_fraction"), 13: ScanVariable("boundu(10)", "H_factor_upper_bound"), - 14: ScanVariable("fiooic", "TFC_Iop_/_Icrit_f-value"), - 15: ScanVariable("fjprot", "TFC_Jprot_limit_f-value"), 16: ScanVariable("rmajor", "Plasma_major_radius_(m)"), 17: ScanVariable("b_tf_inboard_max", "Max_toroidal_field_(T)"), 18: ScanVariable("eta_cd_norm_hcd_primary_max", "Maximum_CD_gamma"), 19: ScanVariable("boundl(16)", "CS_thickness_lower_bound"), 20: ScanVariable("t_burn_min", "Minimum_burn_time_(s)"), 22: ScanVariable("cfactr", "Plant_availability_factor"), - 23: ScanVariable("boundu(72)", "Ip/Irod_upper_bound"), 24: ScanVariable("p_fusion_total_max_mw", "Fusion_power_limit_(MW)"), 25: ScanVariable("kappa", "Plasma_elongation"), 26: ScanVariable("triang", "Plasma_triangularity"), @@ -947,8 +943,6 @@ def scan_select(self, nwp, swp, iscn): constraint_variables.pflux_fw_neutron_max_mw = swp[iscn - 1] case 7: physics_variables.beamfus0 = swp[iscn - 1] - case 8: - constraint_variables.fbig_q_plasma_min = swp[iscn - 1] case 9: physics_variables.temp_plasma_electron_vol_avg_kev = swp[iscn - 1] case 10: @@ -959,10 +953,6 @@ def scan_select(self, nwp, swp, iscn): current_drive_variables.f_c_plasma_bootstrap_max = swp[iscn - 1] case 13: numerics.boundu[9] = swp[iscn - 1] - case 14: - constraint_variables.fiooic = swp[iscn - 1] - case 15: - constraint_variables.fjprot = swp[iscn - 1] case 16: physics_variables.rmajor = swp[iscn - 1] case 17: @@ -977,8 +967,6 @@ def scan_select(self, nwp, swp, iscn): if cost_variables.iavail == 1: raise ProcessValueError("Do not scan cfactr if iavail=1") cost_variables.cfactr = swp[iscn - 1] - case 23: - numerics.boundu[71] = swp[iscn - 1] case 24: constraint_variables.p_fusion_total_max_mw = swp[iscn - 1] case 25: diff --git a/process/stellarator.py b/process/stellarator.py index f0651583be..f9344a9396 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -497,9 +497,6 @@ def stbild(self, output: bool): "(required_radial_space)", build_variables.required_radial_space, ) - po.ovarre( - self.outfile, "f value: ", "(f_avspace)", build_variables.f_avspace - ) # po.write(self.outfile,10) # 10 format(t43,'Thickness (m)',t60,'Radius (m)') @@ -2636,7 +2633,7 @@ def stcoil(self, output: bool): ) # Get here a temperature margin of 1.5K. # The operation current density weighted with the global iop/icrit fraction - lhs[:] = constraint_variables.fiooic * jcrit_vector + lhs[:] = jcrit_vector # Conduct fraction of conduit * Superconductor fraction in conductor f_scu = ( @@ -3202,7 +3199,6 @@ def stcoil(self, output: bool): rebco_variables.coppera_m2_max, f_scu, f_vv_actual, - constraint_variables.fiooic, inductance, tfcoil_variables.max_force_density, max_force_density_mnm, @@ -3710,7 +3706,6 @@ def stcoil_output( coppera_m2_max, f_scu, f_vv_actual, - fiooic, inductance, max_force_density, max_force_density_mnm, @@ -4010,7 +4005,6 @@ def stcoil_output( "(c_tf_turn)", tfcoil_variables.c_tf_turn, ) - po.ovarre(self.outfile, "jop/jcrit", "(fiooic)", fiooic) po.ovarre( self.outfile, "Current density in conductor area (A/m2)", diff --git a/tests/integration/data/large_tokamak_eval.IN.DAT b/tests/integration/data/large_tokamak_eval.IN.DAT index 60cd97d7ae..a2174d6f43 100644 --- a/tests/integration/data/large_tokamak_eval.IN.DAT +++ b/tests/integration/data/large_tokamak_eval.IN.DAT @@ -92,16 +92,6 @@ dr_shld_blkt_gap = 0.02 * gap between vacuum vessel and blanket (m) *---------------Constraint Variables---------------* b_tf_inboard_max = 14.0 * maximum peak toroidal field (T) (`constraint equation 25`) -fbeta_max = 0.5 * f-value for beta limit (`constraint equation 24`; `iteration variable 36`) -fdene = 1.2 * f-value for density limit (`constraint equation 5`; `iteration variable 9`) -fiooic = 0.65 * f-value for TF coil operating current / critical current ratio -fjohc = 0.6 * f-value for central solenoid current at end-of-flattop -fjohc0 = 0.6 * f-value for central solenoid current at beginning of pulse -fjprot = 1.0 * f-value for TF coil winding pack current density -foh_stress = 1.0 * f-value for Tresca yield criterion in Central Solenoid -fmaxvvstress = 1.0 * f-value for maximum permitted stress of the VV -fvdump = 1.0 * f-value for dump voltage (`constraint equation 34`; `iteration variable 51`) -fpflux_fw_neutron_max_mw = 1.0 * f-value for maximum wall load (`constraint equation 8`; `iteration variable 14`) p_plant_electric_net_required_mw = 400.0 * required net electric power (MW) (`constraint equation 16`) p_fusion_total_max_mw = 3000 * maximum fusion power (MW) (`constraint equation 9`) psepbqarmax = 10.0 * maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`) diff --git a/tests/regression/input_files/helias_5b.IN.DAT b/tests/regression/input_files/helias_5b.IN.DAT index afd0348cdc..f33f26b0b0 100644 --- a/tests/regression/input_files/helias_5b.IN.DAT +++ b/tests/regression/input_files/helias_5b.IN.DAT @@ -39,15 +39,6 @@ ixc = 10 *hfact hfact = 1.2187 *H-factor on energy confinement times boundu(10) = 2.0 -ixc = 25 *fp_plant_electric_net_required_mw -fp_plant_electric_net_required_mw = 1.0000 *f-value for net electric power -boundl(25) = 0.98 -boundu(25) = 1.0 - -ixc = 50 * itv_fiooic -boundu(50) = 0.9 -boundl(50) = 0.001 - *----------------Physics Variables-----------------* diff --git a/tests/regression/input_files/large_tokamak.IN.DAT b/tests/regression/input_files/large_tokamak.IN.DAT deleted file mode 100644 index 755095a640..0000000000 --- a/tests/regression/input_files/large_tokamak.IN.DAT +++ /dev/null @@ -1,614 +0,0 @@ -************************************************************************* -***** ***** -***** Generic large tokamak file ***** -***** James Morris, UKAEA ***** -***** 28/06/23 ***** -***** ***** -************************************************************************* - -* Run Information * -******************* - -runtitle = Generic large tokamak - -* Figure of merit - minimise major radius -minmax = 1 - -* Error tolerance for VMCON -epsvmc = 1e-7 - -* Constraint Equations - Consistency Equations * -************************************************ - -* Beta consistency * -*------------------* -icc = 1 -ixc = 5 * beta_total_vol_avg -beta_total_vol_avg = 0.03 - -* Global power balance * -*----------------------* -icc = 2 - -* Radial build consistency * -*--------------------------* -icc = 11 - -* Constraint Equations - Limit Equations * -****************************************** - -* Density upper limit * -*---------------------* -icc = 5 -ixc = 6 * nd_plasma_electrons_vol_avg [m-3] -fdene = 1.2 -nd_plasma_electrons_vol_avg = 7.5E19 - -* Neutron wall load upper limit * -*-------------------------------* -icc = 8 -ixc = 14 * fpflux_fw_neutron_max_mw -fpflux_fw_neutron_max_mw = 1.0 -* wall load limit [MW/m2] -pflux_fw_neutron_max_mw = 2.0 - -* Fusion power upper limit * -*--------------------------* - -icc = 9 -ixc = 26 * fp_fusion_total_max_mw -* Maximum allowable value fusion power [MW] -p_fusion_total_max_mw = 3000 - -* Burn time lower limit * -*-----------------------* -icc = 13 -ixc = 21 * ft_burn_min -* minimum burn time [s] -t_burn_min = 7200.0 - -* L-H threshold scaling * -*-----------------------* -icc = 15 -ixc = 103 * fl_h_threshold -boundu(103) = 10.0 - -* Injection power upper limit * -*-----------------------------* -icc = 30 -ixc = 46 * fp_hcd_injected_max -* Maximum allowable value for injected power [MW] -p_hcd_injected_max = 200.0 - -* Net electric power lower limit * -*--------------------------------* -icc = 16 -ixc = 25 * fp_plant_electric_net_required_mw -* Minimum allowable value for net eletric power [MW] -p_plant_electric_net_required_mw = 400.0 - -* Beta upper limit * -*------------------* -icc = 24 -ixc = 36 * fbeta_max -fbeta_max = 0.5 - -* Max TF field * -*--------------* -icc = 25 -ixc = 35 * fb_tf_inboard_max -* Maximum allowable value for toroidal magnetic field [T] -b_tf_inboard_max = 14.0 - -* Central solenoid EOF current density upper limit * -*--------------------------------------------------* -icc = 26 -ixc = 37 * j_cs_flat_top_end [A/m2] -ixc = 38 * fjohc -boundu(38) = 1.0 -j_cs_flat_top_end = 1.5E7 -fjohc = 0.6 - -* Central solenoid BOP current density upper limit * -*--------------------------------------------------* -icc = 27 -ixc = 39 * fjohc0 -ixc = 41 * f_j_cs_start_pulse_end_flat_top -boundu(39) = 1.0 -fjohc0 = 0.6 -f_j_cs_start_pulse_end_flat_top = 0.9 - -* I_op/I_Crit TF coil limit * -*---------------------------* -icc = 33 -ixc = 50 * fiooic -boundu(50) = 1.0 -fiooic = 0.65 - -* Dump voltage upper limit * -*--------------------------* -icc = 34 -ixc = 51 * fvdump -fvdump = 1.0 -v_tf_coil_dump_quench_max_kv = 10.0 - -* J_winding pack protection * -*---------------------------* -icc = 35 -ixc = 53 * fjprot -fjprot = 1.0 - -* TF temp marg lower limit * -*--------------------------* -icc = 36 -ixc = 54 * ftmargtf -* Minimum allowable temperature margin [K] -tmargmin = 1.5 - -* CS coil temp margin lower limit * -*---------------------------------* -icc = 60 -ixc = 106 * ftmargoh -temp_cs_superconductor_margin_min = 1.5 - -* Lower limit on f_alpha_energy_confinement (ratio alpha particle/energy confinement times) * -*-------------------------------------------------------------------------------* -icc = 62 -ixc = 110 * falpha_energy_confinement -f_alpha_energy_confinement_min = 5.0 - -* dump time constraint for VV stresses * -*--------------------------------------* -icc = 65 -ixc = 113 * fmaxvvstress -fmaxvvstress = 1.0 - -* CS stress limit * -*-----------------* -icc = 72 -ixc = 123 * foh_stress -foh_stress = 1.0 -* allowable hoop stress in Central Solenoid structural material [Pa] -alstroh = 7.5D8 - -* nd_plasma_pedestal_electron ne(ped) (`constraint equation 81`) hfact = 1.2 * H factor on energy confinement times; radiation corrected (`iteration variable 10`); i_bootstrap_current = 4 * switch for bootstrap current scaling i_beta_component = 3 * switch for beta limit scaling (`constraint equation 24`) diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index f6ce9d1792..9e165701ed 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -104,13 +104,6 @@ icc = 9 * JUSTIFICATION: Working to target fusion * VARIABLES: p_fusion_total_mw (fusion power) calculated in-situ -ixc = 26 -fp_fusion_total_max_mw = 1.0 -*boundl(26) = 0.9 -*boundu(26) = 1.1 -* DESCRIPTION: f-value for Maximum Fusion Power -* JUSTIFICATION: Used with icc=9 to enforce Fusion Power limit - p_fusion_total_max_mw = 2500.0 * DESCRIPTION: Maximum fusion power (MW) (icc=9) * JUSTIFICATION: @@ -128,13 +121,6 @@ p_plant_electric_net_required_mw = 100.0 * DESCRIPTION: Required net electric power lower limit (MW) (icc=16) * JUSTIFICATION: Not used in this run -ixc = 25 -fp_plant_electric_net_required_mw = 1.0 -* boundl(25) = -* boundu(25) = -* DESCRIPTION: f-value for net electric power (constraint equation 16) -* JUSTIFICATION: - *---------* * Q-value * * Actual Q is calculated by the code * *---------* @@ -248,14 +234,7 @@ nd_plasma_electrons_vol_avg = 1.5E+20 boundl(6) = 0.5E+20 boundu(6) = 5.0E+20 * DESCRIPTION: Average electron density (/m3) -* JUSTIFICATION: Density is constrained by fdene - -ixc = 9 -fdene = 1.0 -boundl(9) = 0.1 -boundu(9) = 1.0 -* DESCRIPTION: f-value for density limit -* JUSTIFICATION: Used with icc=5 to enforce density limit +* JUSTIFICATION: Density is constrained *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -289,11 +268,6 @@ f_temp_plasma_ion_electron = 1.0 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Beta ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -*icc = 6 -* DESCRIPTION: Equation for epsilon beta-poloidal upper limit -* JUSTIFICATION: Turned off, not in use -* VARIABLES: eps,fbeta_poloidal_eps Rest calculated in-situ - *beta_poloidal_eps_max * DESCRIPTION: Max epsilon*beta value * JUSTIFICATION: Turned off, not in use. icc=6. @@ -316,12 +290,6 @@ boundu(5) = 1.0 * DESCRIPTION: Total Plasma Beta, * JUSTIFICATION: Beta is limited by beta_norm_max -ixc = 36 -fbeta_max = 0.75 -boundl(36) = 0.01 -boundu(36) = 1.0 -* DESCRIPTION: f-value for Beta Limit -* JUSTIFICATION: Used with icc=24 to enforce beta limit *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -357,11 +325,6 @@ i_beta_norm_max = 0 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*icc = 48 -* DESCRIPTION: Constraint equation for poloidal beta upper limit -* JUSTIFICATION: Turned off, do not care about poloidal beta -* VARIABLES: beta_poloidal_max, fbeta_poloidal. beta_poloidal calculated in-situ - *beta_poloidal_max = * DESCRIPTION: Maximum poloidal beta (`constraint equation 48`) (default = 0.19) * JUSTIFICATION: Not set, not using icc = 48 @@ -416,13 +379,6 @@ icc = 15 * JUSTIFICATION: Required to be in H-mode * VARIABLES: p_l_h_threshold_mw,p_plasma_separatrix_mw calculated in-situ -ixc = 103 -fl_h_threshold = 1.0 -*boundl(21) = 0.01 -boundu(21) = 10.0 -* DESCRIPTION: f-value for L-H Power Threshold -* JUSTIFICATION: Used with icc=15 to enforce H-mode - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *t_plasma_energy_confinement_max = @@ -448,13 +404,6 @@ icc = 62 * JUSTIFICATION: Used to constrain helium fraction * VARIABLES: t_energy_confinement,t_alpha_confinement calculated in-situ -ixc = 110 -falpha_energy_confinement = 1.0 -boundl(110) = 0.01 -boundu(110) = 1.0 -* DESCRIPTION: f-value for lower limit on f_alpha_energy_confinement the ratio of alpha particle to energy confinement times -* JUSTIFICATION: Calculate He fraction consistent with tau ratio - f_alpha_energy_confinement_min = 5.0 * DESCRIPTION: Ratio of Alpha Particle to Energy Confinement times (icc=62) * JUSTIFICATION: Default based on JET @@ -515,11 +464,6 @@ icc = 81 * JUSTIFICATION: Prevents unrealistic density profiles * VARIABLES: -ixc = 154 -fne0 = 0.08 -boundu(154) = 0.99 -* DESCRIPTION: f-value for ne(0) > ne(sep) -* JUSTIFICATION: Used with icc=81 to prevent unrealistic density profiles *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -528,10 +472,6 @@ boundu(154) = 0.99 * JUSTIFICATION: Turned off, not using model * VARIABLES: Calculated in-situ -*fnesep = -* DESCRIPTION: f-value for Eich critical separatrix density -* JUSTIFICATION: Not using icc=76 - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *-------------* @@ -610,12 +550,6 @@ icc = 17 * JUSTIFICATION: Limit for plasma stability * VARIABLES: Rest calculated in-situ -ixc = 28 -fradpwr = 0.64 -boundu(28) = 1.0 -* DESCRIPTION: f-value for Core Radiation Power Limit -* JUSTIFICATION: Used with icc=17 to enforce Core Radiation limit - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *f_nd_protium_electrons = @@ -708,11 +642,6 @@ i_single_null = 0 * DESCRIPTION: Divertor heat load (MW/m2) * JUSTIFICATION: Turned off, not used -*ixc = 27 -*fpflux_div_heat_load_mw = -* DESCRIPTION: f-value for divertor heat load -* JUSTIFICATION: Used with icc=18 to enforce max divertor heat load, not used - *pflux_div_heat_load_max_mw = * DESCRIPTION: Heat load limit (MW/m2) * JUSTIFICATION: Turned off, not used @@ -750,13 +679,6 @@ pseprmax = 40.0 * DESCRIPTION: Maximum ratio of Psep/R (MW/m) (icc=56) * JUSTIFICATION: -ixc = 97 -fpsepr = 1.0 -boundl(97) = 0.01 -boundu(97) = 1.0 -* DESCRIPTION: f-value for Maximum Psep/R Limit -* JUSTIFICATION: Used with icc=56 to enforce Psep/R limit - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Divertor Configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ @@ -955,13 +877,6 @@ icc = 33 * JUSTIFICATION: A quench must be avoided * VARIABLES: j_tf_wp & j_tf_wp_critical (critical current) calculated in-situ -ixc = 50 -fiooic = 1.0 -boundl(50) = 0.01 -boundu(50) = 1.0 -* DESCRIPTION: f-value for TF coil operating current / critical current density ratio -* JUSTIFICATION: icc = 33 is used - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *icc = 35 @@ -994,12 +909,6 @@ boundu(50) = 1.0 * DESCRIPTION: Maximum TF coil current / copper area (A/m2) * JUSTIFICATION: Not yet defined, assuming (default = 100E0) -*ixc = 143 -*f_coppera_m2 = -*boundl(143) = -*boundu(143) = -* DESCRIPTION: f-value for constraint 75: TF coil current / copper area < copperA_m2_max (iteration variable 143) -* JUSTIFICATION: Not used. *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1301,13 +1210,6 @@ sig_tf_case_max = 850.0E6 * JUSTIFICATION: Stress limit increased as required to match TF coil design finite * element modelling shows PROCESS maybe conservative in stress calculations -ixc = 48 -fstrcase = 1.0 -boundl(48) = 0.01 -boundu(48) = 1.0 -* DESCRIPTION: f-value for Maxiumum TF Coil case (bucking) TRESCA stress -* JUSTIFICATION: Used with icc=31 to enforce stress limit in conductor - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ icc = 32 @@ -1320,12 +1222,6 @@ sig_tf_wp_max = 700.0E6 * JUSTIFICATION: Stress limit increased as required to match TF coil design finite * element modelling shows PROCESS maybe conservative in stress calculations -ixc = 49 -fstrcond = 1.0 -boundu(49) = 1.0 -* DESCRIPTION: f-value for Maxiumum TF Coil Conduit Tresca Stress -* JUSTIFICATION: Used with icc=32 to enforce stress limit - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *i_tf_cond_eyoung_axial = @@ -1506,13 +1402,6 @@ tftmp = 20.0 * DESCRIPTION: Maximum Peak Centrepost Temperature (K) (icc=44) * JUSTIFICATION: Unknown, seems high compared to constrained average -*ixc = 68 -*fptemp = 0.46 -*boundl(68) = -*boundu(68) = -* DESCRIPTION: f-value for Peak Centrepost Temperature -* JUSTIFICATION: Used with icc=44 to enforce centrepost temperature limit - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * rcool = 3.0E-3 @@ -1652,13 +1541,6 @@ i_pf_conductor = 0 * DESCRIPTION: Allowable stress in CS pre-comp structure (Pa) * JUSTIFICATION: -*ixc = 123 -*foh_stress = -*boundl(123) = -*boundu(123) = -* DESCRIPTION: F-value for CS coil Tresca yield criterion -* JUSTIFICATION: Not scaling CS force - *------------------------* * Current & Field Limits * *------------------------* @@ -1686,15 +1568,6 @@ i_pf_conductor = 0 * DESCRIPTION: Maximum allowed peak field on central solenoid (icc = 79) * JUSTIFICATION: Not using icc=79 -*ixc = 149 -*fb_cs_limit_max = -*boundl(149) -*boundu(149) -* DESCRIPTION: F-value for max peak CS field (icc = 79) -* JUSTIFICATION: Not using icc=79 -* -*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - *icc = 26 * DESCRIPTION: Constraint equation for CS current density upper limit at EOF * JUSTIFICATION: Turned off, dont care about CS current density limit @@ -1730,12 +1603,6 @@ i_pf_conductor = 0 * DESCRIPTION: Maximum CS coil current / copper area (A/m2) * JUSTIFICATION: Not using icc = 89 -*ixc = 166 -*f_copperaoh_m2 = -*boundl(166) = -*boundu(166) = -* DESCRIPTION: f-value for constraint 88: CS coil current / copper area < copperA_m2_max -* JUSTIFICATION: Not using icc = 89 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2573,14 +2440,7 @@ f_fw_rad_max = 1.0 * DESCRIPTION: Switch for neutron wall load calculation (default = 1) * =1 use scaled plasma surface area * =2 use first wall area directly -* JUSTIFICATION: Not set, assuming default value - -*ixc = 14 -*fpflux_fw_neutron_max_mw = 0.99 -*boundl(14) = 0.99 -*boundu(14) = 1.0 -* DESCRIPTION: f-value for maximum neutron wall load -* JUSTIFICATION: Used with icc=8 to enforce wall load limit +* JUSTIFICATION: Not set, assuming default value *pflux_fw_neutron_max_mw = * DESCRIPTION: Allowable neutron wall-load (MW/m2) @@ -2597,13 +2457,6 @@ pflux_fw_rad_max = 1.2 * DESCRIPTION: Peak radiation wall load (MW/m^2) * JUSTIFICATION: -ixc = 116 -fpflux_fw_rad_max = 1.0 -boundl(116) = 0.01 -boundu(116) = 1.0 -* DESCRIPTION: f-value for upper limit on radiation wall load -* JUSTIFICATION: just a 0.001 to 1. variation. The peaking factor actually sets the limit - *ffwal = * DESCRIPTION: Wall load fiddle factor * JUSTIFICATION: Not scaling wall load. Used when i_pflux_fw_neutron=1 @@ -2639,12 +2492,6 @@ i_hcd_calculations = 1 * DESCRIPTION: Minimum required auxiliary power (MW) * JUSTIFICATION: Turned off, not using icc = 40 -*ixc = 64 -*fp_hcd_injected_min_mw = -*boundl(64) = -*boundu(64) = -* DESCRIPTION: f-value for minimum auxiliary power (`constraint equation 40`, `iteration variable 64`) -* JUSTIFICATION: Turned off, not using icc = 40 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *icc = 37 @@ -2682,13 +2529,6 @@ icc = 30 * JUSTIFICATION: Limit for plasma stability * VARIABLES: p_hcd_injected_total_mw (total auxiliary injected power (MW)) summed from all injected power sources -ixc = 46 -fp_hcd_injected_max = 1.0 -boundl(46) = 0.6 -boundu(46) = 1.5 -* DESCRIPTION: f-value for injected power variation range -* JUSTIFICATION: Setup to allow the injected power to vary - p_hcd_injected_max = 150.0 * DESCRIPTION: Maximum Allowable Value for Injected Power (MW) (icc=30) * JUSTIFICATION: @@ -2920,10 +2760,6 @@ icc = 46 * neutronic shield into account ? * VARIABLES: Variables calculated in-situ -ixc = 72 -fipir = 0.58 -* DESCRIPTION: f-value for Ip/Irod Limit -* JUSTIFICATION: Used with icc=46 to enforce Ip/Irod limit *__________________________________________________________________________________________________________________________________________________________________________________________________________________________________* *----------------------Heat transport / Power settings-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------* @@ -2977,12 +2813,6 @@ i_shld_primary_heat = 1 * DESCRIPTION: Maximum cryogenic plant power (MW) * JUSTIFICATION: Turned off, not using icc=85 -*ixc = 164 -*f_crypmw = -*boundl(164) = -*boundu(164) = -* DESCRIPTION: f-value for maximum cryogenic plant power -* JUSTIFICATION: Turned off, not using icc=85 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -3148,13 +2978,6 @@ i_pulsed_plant = 0 * DESCRIPTION: Minimum required burn Time (s) * JUSTIFICATION: No required burn time -*ixc = 21 -*ft_burn_min = 1.0 -*boundl(21) = 0.99 -*boundu(21) = 1.0 -* DESCRIPTION: f-value for minimum burn time -* JUSTIFICATION: Used with icc=13 to enforce minimum burn time, not required - t_plant_pulse_burn = 1000.0 * DESCRIPTION: Burn Time (s) * JUSTIFICATION: Default, steady-state device so input, calculates if i_pulsed_plant = 1 @@ -3343,13 +3166,6 @@ iavail = 0 * DESCRIPTION: Minimum availability (`constraint equation 61`) * JUSTIFICATION: testing -*ixc = 107 -*favail = -*boundl(107) = -*boundu(107) = -* DESCRIPTION: F-value for minimum availability (constraint equation 61) -* JUSTIFICATION: - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *________________________________________________________________________* diff --git a/tests/regression/input_files/stellarator_helias_eval.IN.DAT b/tests/regression/input_files/stellarator_helias_eval.IN.DAT index f9f0637740..1c075e4455 100644 --- a/tests/regression/input_files/stellarator_helias_eval.IN.DAT +++ b/tests/regression/input_files/stellarator_helias_eval.IN.DAT @@ -59,7 +59,6 @@ dr_blkt_outboard = 0.6 * outboard blanket thickness (m); calculated if `blktmod dr_cryostat = 0.15 * cryostat thickness (m) dr_vv_inboard = 0.5 * vacuum vessel inboard thickness (TF coil / shield) (m) dr_vv_outboard = 0.5 * vacuum vessel outboard thickness (TF coil / shield) (m) -f_avspace = 1. * F-value for stellarator radial space check (`constraint equation 83`) dr_shld_vv_gap_inboard = 0.1 * gap between inboard vacuum vessel and thermal shield (m) (`iteration variable 61`) gapomin = 0.025 * minimum gap between outboard vacuum vessel and TF coil (m) (`iteration variable 31`) dr_fw_plasma_gap_inboard = 0.15 * Gap between plasma and first wall; inboard side (m) (if `i_plasma_wall_gap=1`) @@ -81,23 +80,11 @@ dz_xpoint_divertor = 0. * vertical gap between x-point and divertor (m) (if = 0; *---------------Constraint Variables---------------* big_q_plasma_min = 1 * minimum fusion gain Q (`constraint equation 28`) -fbeta_max = 1. * f-value for beta limit (`constraint equation 24`; `iteration variable 36`) -fecrh_ignition = 1.0 * f-value for ecrh ignition constraint -fflutf = 1 * f-value for neutron fluence on TF coil (`constraint equation 53`; `iteration variable 92`) -fp_fusion_total_max_mw = 1.0 * f-value for maximum fusion power (`constraint equation 9`; `iteration variable 26`) -fpflux_div_heat_load_mw = 0.8 * f-value for divertor heat load (`constraint equation 18`; `iteration variable 27`) -fiooic = 0.9 * f-value for TF coil operating current / critical current ratio -fjprot = 0.95 * f-value for TF coil winding pack current density -fp_plant_electric_net_required_mw = 1.0 * f-value for net electric power (`constraint equation 16`; `iteration variable 25`) -fptfnuc = 1 * f-value for maximum TF coil nuclear heating (`constraint equation 54`; `iteration variable 95`) -fradpwr = 1 * f-value for core radiation power limit (`constraint equation 17`; `iteration variable 28`) -fpflux_fw_rad_max = 1.0 * f-value for upper limit on radiation wall load (`constr; equ; 67`; `iteration variable 116`) pflux_fw_rad_max = 1 * Maximum permitted radiation wall load (MW/m^2) (`constraint equation 67`) p_plant_electric_net_required_mw = 1000 * required net electric power (MW) (`constraint equation 16`) p_fusion_total_max_mw = 500. * maximum fusion power (MW) (`constraint equation 9`) pflux_fw_neutron_max_mw = 1.0 * allowable neutron wall-load (MW/m2) (`constraint equation 8`) f_alpha_energy_confinement_min = 6 * Lower limit on taup/taueff the ratio of alpha particle to energy confinement -falpha_energy_confinement = 1. * f-value for lower limit on taup/taueff the ratio of alpha particle to energy *-------------------Constraints--------------------* @@ -339,7 +326,6 @@ sig_tf_wp_max = 4.e8 * Allowable maximum shear stress (Tresca criterion) in TF c dx_tf_turn_general = 0.037 * TF coil turn edge length including turn insulation [m] f_a_tf_turn_cable_copper = 0.7630096974258808 * copper fraction of cable conductor (TF coils) i_tf_sc_mat = 8 * Switch for superconductor material in TF coils; -ftoroidalgap = 1. * F-value for minimum dx_tf_inboard_out_toroidal (`constraint equation 82`) t_tf_superconductor_quench = 7.400147540321247 * fast discharge time for TF coil in event of quench (s) (`iteration variable 56`) tftmp = 4.5 * peak helium coolant temperature in TF coils and PF coils (K) dx_tf_turn_insulation = 0.001 * conduit insulation thickness (m) diff --git a/tests/unit/test_stellarator.py b/tests/unit/test_stellarator.py index 85c8bbab95..bbbc31b3ec 100644 --- a/tests/unit/test_stellarator.py +++ b/tests/unit/test_stellarator.py @@ -291,8 +291,6 @@ class StbildParam(NamedTuple): available_radial_space: Any = None - f_avspace: Any = None - required_radial_space: Any = None radius_fw_channel: Any = None @@ -398,7 +396,6 @@ class StbildParam(NamedTuple): dr_tf_inboard=0.78058448071757114, dr_tf_outboard=0.78058448071757114, available_radial_space=0, - f_avspace=1, required_radial_space=0, radius_fw_channel=0.0060000000000000001, blktmodel=0, @@ -468,7 +465,6 @@ class StbildParam(NamedTuple): dr_tf_inboard=0.78058448071757114, dr_tf_outboard=0.78058448071757114, available_radial_space=1.8828828828828827, - f_avspace=1, required_radial_space=2.0332922403587861, radius_fw_channel=0.0060000000000000001, blktmodel=0, @@ -608,8 +604,6 @@ def test_stbild(stbildparam, monkeypatch, stellarator): build_variables, "available_radial_space", stbildparam.available_radial_space ) - monkeypatch.setattr(build_variables, "f_avspace", stbildparam.f_avspace) - monkeypatch.setattr( build_variables, "required_radial_space", stbildparam.required_radial_space ) From 3d8fd9b5b09a0b14bfc968a3f8bbb258f873ced0 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Wed, 5 Nov 2025 14:24:42 +0000 Subject: [PATCH 04/17] Update reference/test input files to use inequality constraints --- examples/data/large_tokamak_IN.DAT | 123 +++++++----------- examples/data/scan_example_file_IN.DAT | 38 +----- process/data_structure/numerics.py | 2 +- process/init.py | 2 +- process/input.py | 4 +- tests/integration/data/large_tokamak_IN.DAT | 121 +++++++---------- tests/integration/data/ref_IN.DAT | 22 ---- tests/regression/input_files/IFE.IN.DAT | 1 + .../input_files/large_tokamak_nof.IN.DAT | 1 - .../input_files/st_regression.IN.DAT | 23 ++-- tests/unit/data/large_tokamak_IN.DAT | 121 +++++++---------- 11 files changed, 167 insertions(+), 291 deletions(-) diff --git a/examples/data/large_tokamak_IN.DAT b/examples/data/large_tokamak_IN.DAT index 2d29ef61b9..f7a1d3cae3 100644 --- a/examples/data/large_tokamak_IN.DAT +++ b/examples/data/large_tokamak_IN.DAT @@ -17,14 +17,16 @@ minmax = 1 * Error tolerance for VMCON epsvmc = 1e-7 +neqns = 3 + * Constraint Equations - Consistency Equations * ************************************************ * Beta consistency * *------------------* icc = 1 -ixc = 5 * beta_total_vol_avg_total_vol_avg -beta_total_vol_avg =0.03 +ixc = 5 * beta_total_vol_avg +beta_total_vol_avg = 0.03 * Global power balance * *----------------------* @@ -37,163 +39,131 @@ icc = 11 * Constraint Equations - Limit Equations * ****************************************** -* Density upper limit * -*---------------------* -icc = 5 -ixc = 6 * nd_plasma_electrons_vol_avg [m-3] -fdene = 1.2 -nd_plasma_electrons_vol_avg = 7.5E19 -* Neutron wall load upper limit * -*-------------------------------* -icc = 8 -ixc = 14 * fpflux_fw_neutron_max_mw -fpflux_fw_neutron_max_mw = 1.0 -* wall load limit [MW/m2] -pflux_fw_neutron_max_mw = 2.0 -* Fusion power upper limit * -*--------------------------* +* Injection power upper limit * +*-----------------------------* +icc = 30 +* Maximum allowable value for injected power [MW] +p_hcd_injected_max = 200.0 + + -icc = 9 -ixc = 26 * fp_fusion_total_max_mw -* Maximum allowable value fusion power [MW] -p_fusion_total_max_mw = 3000 -* Burn time lower limit * -*-----------------------* -icc = 13 -ixc = 21 * fr_burn_min -* minimum burn time [s] -t_burn_min = 7200.0 * L-H threshold scaling * *-----------------------* icc = 15 -ixc = 103 * fl_h_threshold -boundu(103) = 10.0 - -* Injection power upper limit * -*-----------------------------* -icc = 30 -ixc = 46 * fp_hcd_injected_total_mw -* Maximum allowable value for injected power [MW] -p_hcd_injected_max = 200.0 * Net electric power lower limit * *--------------------------------* icc = 16 -ixc = 25 * fp_plant_electric_net_required_mw * Minimum allowable value for net eletric power [MW] p_plant_electric_net_required_mw = 400.0 * Beta upper limit * *------------------* icc = 24 -ixc = 36 * fbeta_max -fbeta_max = 0.5 * Max TF field * *--------------* icc = 25 -ixc = 35 * fb_tf_inboard_max * Maximum allowable value for toroidal magnetic field [T] b_tf_inboard_max = 14.0 * Central solenoid EOF current density upper limit * *--------------------------------------------------* icc = 26 -ixc = 37 * j_cs_flat_top_end [A/m2] -ixc = 38 * fjohc -boundu(38) = 1.0 -j_cs_flat_top_end = 1.5E7 -fjohc = 0.6 * Central solenoid BOP current density upper limit * *--------------------------------------------------* icc = 27 -ixc = 39 * fjohc0 -ixc = 41 * f_j_cs_start_pulse_end_flat_top -boundu(39) = 1.0 -fjohc0 = 0.6 -f_j_cs_start_pulse_end_flat_top = 0.9 +f_j_cs_start_pulse_end_flat_top = 1.0 * I_op/I_Crit TF coil limit * *---------------------------* icc = 33 -ixc = 50 * fiooic -boundu(50) = 1.0 -fiooic = 0.65 * Dump voltage upper limit * *--------------------------* icc = 34 -ixc = 51 * fvdump -fvdump = 1.0 v_tf_coil_dump_quench_max_kv = 10.0 * J_winding pack protection * *---------------------------* icc = 35 -ixc = 53 * fjprot -fjprot = 1.0 * TF temp marg lower limit * *--------------------------* icc = 36 -ixc = 54 * ftmargtf * Minimum allowable temperature margin [K] tmargmin = 1.5 * CS coil temp margin lower limit * *---------------------------------* icc = 60 -ixc = 106 * ftmargoh temp_cs_superconductor_margin_min = 1.5 * Lower limit on f_alpha_energy_confinement (ratio alpha particle/energy confinement times) * *-------------------------------------------------------------------------------* icc = 62 -ixc = 110 * falpha_energy_confinement f_alpha_energy_confinement_min = 5.0 * dump time constraint for VV stresses * *--------------------------------------* icc = 65 -ixc = 113 * fmaxvvstress -fmaxvvstress = 1.0 * CS stress limit * *-----------------* icc = 72 -ixc = 123 * foh_stress -foh_stress = 1.0 * allowable hoop stress in Central Solenoid structural material [Pa] alstroh = 7.5D8 -* nd_plasma_pedestal_electron Date: Thu, 6 Nov 2025 16:03:02 +0000 Subject: [PATCH 05/17] Update scan example to a more meaningful scan --- examples/data/scan_example_file_IN.DAT | 105 ++++++++++++++----------- examples/scan.ipynb | 8 +- 2 files changed, 62 insertions(+), 51 deletions(-) diff --git a/examples/data/scan_example_file_IN.DAT b/examples/data/scan_example_file_IN.DAT index 251b72bd2f..9dd8bbd394 100644 --- a/examples/data/scan_example_file_IN.DAT +++ b/examples/data/scan_example_file_IN.DAT @@ -17,9 +17,18 @@ minmax = 1 * Error tolerance for VMCON epsvmc = 1e-7 -* Number of equality constraints +* Inequality constraint tolerance +force_vmcon_inequality_tolerance = 1e-6 + neqns = 3 +* Scan Variables * +****************** +nsweep = 17 * b_tf_inboard_max, maximum peak toroidal field +isweep = 6 +sweep = 10.5, 10.4, 10.3, 10.2, 10.1, 10.0 + + * Constraint Equations - Consistency Equations * ************************************************ @@ -27,7 +36,7 @@ neqns = 3 *------------------* icc = 1 ixc = 5 * beta_total_vol_avg -beta_total_vol_avg =0.03 +beta_total_vol_avg = 0.03 * Global power balance * *----------------------* @@ -40,42 +49,23 @@ icc = 11 * Constraint Equations - Limit Equations * ****************************************** -* Density upper limit * -*---------------------* -icc = 5 -ixc = 6 * nd_plasma_electrons_vol_avg [m-3] -nd_plasma_electrons_vol_avg = 7.5E19 -* Neutron wall load upper limit * -*-------------------------------* -icc = 8 -* wall load limit [MW/m2] -pflux_fw_neutron_max_mw = 2.0 -* Fusion power upper limit * -*--------------------------* +* Injection power upper limit * +*-----------------------------* +icc = 30 +* Maximum allowable value for injected power [MW] +p_hcd_injected_max = 200.0 + + -icc = 9 -* Maximum allowable value fusion power [MW] -p_fusion_total_max_mw = 3000 -* Burn time lower limit * -*-----------------------* -icc = 13 -* minimum burn time [s] -t_burn_min = 7200.0 * L-H threshold scaling * *-----------------------* icc = 15 boundu(103) = 10.0 -* Injection power upper limit * -*-----------------------------* -icc = 30 -* Maximum allowable value for injected power [MW] -p_hcd_injected_max = 200.0 - * Net electric power lower limit * *--------------------------------* icc = 16 @@ -89,8 +79,6 @@ icc = 24 * Max TF field * *--------------* icc = 25 -* Maximum allowable value for toroidal magnetic field [T] -b_tf_inboard_max = 14.0 * Central solenoid EOF current density upper limit * *--------------------------------------------------* @@ -101,8 +89,7 @@ j_cs_flat_top_end = 1.5E7 * Central solenoid BOP current density upper limit * *--------------------------------------------------* icc = 27 -ixc = 41 * f_j_cs_start_pulse_end_flat_top -f_j_cs_start_pulse_end_flat_top = 0.9 +f_j_cs_start_pulse_end_flat_top = 1.0 * I_op/I_Crit TF coil limit * *---------------------------* @@ -143,9 +130,8 @@ icc = 72 * allowable hoop stress in Central Solenoid structural material [Pa] alstroh = 7.5D8 -* nd_plasma_pedestal_electron Date: Thu, 13 Nov 2025 16:32:00 +0000 Subject: [PATCH 06/17] Add fl_h_threshold back to constraints --- process/constraints.py | 10 ++++++++-- process/io/obsolete_vars.py | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/process/constraints.py b/process/constraints.py index e45ac016f6..4067aa65a2 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -550,16 +550,22 @@ def constraint_equation_15(): """Equation for L-H power threshold limit author: P B Lloyd, CCFE, Culham Science Centre + fl_h_threshold: a factor tolerance on the constraint p_l_h_threshold_mw: L-H mode power threshold (MW) p_plasma_separatrix_mw: power to conducted to the divertor region (MW) + + Setting fl_h_threshold enforces a constraint on a factor of p_plasma_separatrix_mw + e.g. fl_h_threshold * p_plasma_separatrix_mw >= p_l_h_threshold_mw """ return ConstraintResult( 1.0 - - data_structure.physics_variables.p_plasma_separatrix_mw + - data_structure.constraint_variables.fl_h_threshold + * data_structure.physics_variables.p_plasma_separatrix_mw / data_structure.physics_variables.p_l_h_threshold_mw, data_structure.physics_variables.p_l_h_threshold_mw, data_structure.physics_variables.p_l_h_threshold_mw - - data_structure.physics_variables.p_plasma_separatrix_mw, + - data_structure.physics_variables.p_plasma_separatrix_mw + / data_structure.constraint_variables.fl_h_threshold, ) diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index 0ea3f26759..277b2861c3 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -496,7 +496,6 @@ "fjohc", "fjohc0", "fjprot", - "fl_h_threshold", "fmva", "fnbshinef", "fncycle", From ebfbd2abfacfa2a0a4e16b7471718cfac944d263 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Thu, 13 Nov 2025 16:32:29 +0000 Subject: [PATCH 07/17] Update st_regression.IN.DAT to allow it to converge --- tests/regression/input_files/st_regression.IN.DAT | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 74256ba110..0f52620347 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -28,7 +28,7 @@ *________________________________________________________________________* *----------------------------Global Variables---------------------------* *‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾* -maxcal = 2000 +maxcal = 200 * DESCRIPTION: Maximum number of VMCON iterations * JUSTIFICATION: Twice default, no impact on result @@ -39,7 +39,7 @@ runtitle = ST Regression *--------------------------Numerics Variables---------------------------* *‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾* -epsvmc = 1.0E-11 +epsvmc = 1e-9 * DESCRIPTION: Error tolerance for VMCON * JUSTIFICATION: @@ -2536,7 +2536,7 @@ icc = 30 * JUSTIFICATION: Limit for plasma stability * VARIABLES: p_hcd_injected_total_mw (total auxiliary injected power (MW)) summed from all injected power sources -p_hcd_injected_max = 150.0 +p_hcd_injected_max = 225.0 * DESCRIPTION: Maximum Allowable Value for Injected Power (MW) (icc=30) * JUSTIFICATION: From d2004133083e9b39d0ba1adc383ba1f12344c6ac Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Tue, 25 Nov 2025 11:55:23 +0000 Subject: [PATCH 08/17] Correct/enhance fl_h_threshold use docs --- documentation/physics-models/plasma_h_mode.md | 6 ++++-- examples/data/large_tokamak_IN.DAT | 2 +- process/constraints.py | 4 ++-- process/data_structure/constraint_variables.py | 5 ++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/documentation/physics-models/plasma_h_mode.md b/documentation/physics-models/plasma_h_mode.md index 03b1d04eee..57a62b931f 100644 --- a/documentation/physics-models/plasma_h_mode.md +++ b/documentation/physics-models/plasma_h_mode.md @@ -25,18 +25,20 @@ There are two separate constraint equations for enforcing the L-H threshold. This constraint can be activated by stating `icc = 15` in the input file. +The input `fl_h_threshold` can be set not equal to 1 to provide a margin around the threshold. + $$ 1.0 - \mathtt{fl\_h\_threshold} \times \frac{\overbrace{\mathtt{p\_l\_h\_threshold\_mw}}^{\text{Power from scaling}}}{\mathtt{p_plasma_separatrix_mw}} $$ -For an H-mode plasma, `icc = 15` and `fl_h_threshold (ixc=103)` by default will ensure +For an H-mode plasma, `icc = 15` with `fl_h_threshold >= 1.0` will ensure that the power reaching the divertor is at least equal to the threshold power calculated for the chosen scaling, which is a necessary condition for H-mode. -For an L-mode plasma, `icc = 15` should be turned on but the bounds for `fl_h_threshold (ixc=103)` should be set to `boundl(103) = 0.001` and `boundu(103) = 1.0` to ensure that the power does not exceed the calculated threshold, +For an L-mode plasma, `icc = 15` should be turned on with `fl_h_threshold < 1.0` to ensure that the power does not exceed the calculated threshold, and therefore the machine remains in L-mode. **Therefore it is recommended to always use `icc = 15` if trying to simulate a plasma scenario specifically in L or H-mode** diff --git a/examples/data/large_tokamak_IN.DAT b/examples/data/large_tokamak_IN.DAT index f7a1d3cae3..a4f57a151d 100644 --- a/examples/data/large_tokamak_IN.DAT +++ b/examples/data/large_tokamak_IN.DAT @@ -273,7 +273,7 @@ dz_vv_upper = 0.3 * Underside vacuum vessel radial thickness [m] dz_vv_lower = 0.3 -* Inboard vacuum vessel thickness [m] +* Inboard inboard shield thickness [m] dr_shld_inboard = 0.3 * Gap between vacuum vessel and blanket [m] diff --git a/process/constraints.py b/process/constraints.py index 4067aa65a2..533f0cb51d 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -554,8 +554,8 @@ def constraint_equation_15(): p_l_h_threshold_mw: L-H mode power threshold (MW) p_plasma_separatrix_mw: power to conducted to the divertor region (MW) - Setting fl_h_threshold enforces a constraint on a factor of p_plasma_separatrix_mw - e.g. fl_h_threshold * p_plasma_separatrix_mw >= p_l_h_threshold_mw + Setting fl_h_threshold != 1.0 enforces a constraint on a factor of the p_plasma_separatrix_mw + I.e. fl_h_threshold * p_plasma_separatrix_mw >= p_l_h_threshold_mw """ return ConstraintResult( 1.0 diff --git a/process/data_structure/constraint_variables.py b/process/data_structure/constraint_variables.py index 0b3c9c0c5a..cadbb55682 100644 --- a/process/data_structure/constraint_variables.py +++ b/process/data_structure/constraint_variables.py @@ -94,7 +94,10 @@ """maximum value for Zeff (`constraint equation 64`)""" fl_h_threshold: float = None -"""f-value for L-H power threshold (`constraint equation 15`, `iteration variable 103`)""" +"""Sets the constraint bound of the L-H power threshold limit. + +I.e. fl_h_threshold >= p_l_h_threshold_mw / p_plasma_separatrix_mw +""" def init_constraint_variables(): From b34dd216c04e02dd192fe049e9e632a38abb80d4 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Tue, 25 Nov 2025 14:12:18 +0000 Subject: [PATCH 09/17] Add fdene back --- documentation/fusion-devices/stellarator.md | 2 +- documentation/physics-models/plasma_density.md | 2 +- examples/data/large_tokamak_eval_IN.DAT | 1 + process/constraints.py | 14 ++++++++++---- process/data_structure/constraint_variables.py | 6 ++++++ process/input.py | 3 +++ process/io/obsolete_vars.py | 1 - tests/integration/data/large_tokamak_eval.IN.DAT | 1 + .../input_files/large_tokamak_eval.IN.DAT | 1 + .../input_files/large_tokamak_nof.IN.DAT | 1 + 10 files changed, 25 insertions(+), 7 deletions(-) diff --git a/documentation/fusion-devices/stellarator.md b/documentation/fusion-devices/stellarator.md index 8dbdbbc390..5fe5496cd7 100644 --- a/documentation/fusion-devices/stellarator.md +++ b/documentation/fusion-devices/stellarator.md @@ -131,7 +131,7 @@ The density limit relevant to certain stellarators experiments has been proposed $n_{max} = 0.25(PB_0/R_0a^2_p)^{1/2}$ -where $n$ is the line-averaged electron density in units of $10^{20} m^{-3}$, $p$ is the absorbed heating power (MW), $B_0$ is the on-axis field (t), $R_0$ is the major radius (m), and $a_p$ is the plasma minor radius (m). To enforce the Sudo density limit, turn on constraint equation no. 5. +where $n$ is the line-averaged electron density in units of $10^{20} m^{-3}$, $p$ is the absorbed heating power (MW), $B_0$ is the on-axis field (t), $R_0$ is the major radius (m), and $a_p$ is the plasma minor radius (m). To enforce the Sudo density limit, turn on constraint equation no. 5 (`fdene != 1` can be used to scale the constraint bound). Note that the Sudo limit is a radiation based density limit and it is unclear how well this limit extrapolates to reactor parameters, especially as no impurity dependence e.g. is present in the Sudo model. PROCESS features an impurity dependent radiation module already which can be used with `icc=17` and by setting the `f_nd_impurity_electrons` vector. diff --git a/documentation/physics-models/plasma_density.md b/documentation/physics-models/plasma_density.md index f8dade8613..41c7be2fdd 100644 --- a/documentation/physics-models/plasma_density.md +++ b/documentation/physics-models/plasma_density.md @@ -5,7 +5,7 @@ calculated in routine `calculate_density_limit()`, which is called by `physics`. This constraint can be activated by stating `icc = 5` in the input file. -The value of `i_density_limit` can be set to apply the relevant limit. +The value of `i_density_limit` can be set to apply the relevant limit. The variable `fdene` can be set to scale the constraint bound: `nd_plasma_electrons_vol_avg` / `nd_plasma_electrons_max` <= `fdene`. For the `i_density_limit = 1-5,8` scalings we scale the function output by the separatrix to volume averaged electron density so that we can set the limit on the volume averaged. **Therefore it is recommended to only use these scalings with an H-mode profile (`i_plasma_pedestal == 1`) otherwise the separatrix density (`nd_plasma_separatrix_electron`) will not be calculated.** diff --git a/examples/data/large_tokamak_eval_IN.DAT b/examples/data/large_tokamak_eval_IN.DAT index 3c661e701c..b2acc057f0 100644 --- a/examples/data/large_tokamak_eval_IN.DAT +++ b/examples/data/large_tokamak_eval_IN.DAT @@ -92,6 +92,7 @@ dr_shld_blkt_gap = 0.02 * gap between vacuum vessel and blanket (m) *---------------Constraint Variables---------------* b_tf_inboard_max = 14.0 * maximum peak toroidal field (T) (`constraint equation 25`) +fdene = 1.2 * density limit constraint scale (constraint equation 5) p_plant_electric_net_required_mw = 400.0 * required net electric power (MW) (`constraint equation 16`) p_fusion_total_max_mw = 3000 * maximum fusion power (MW) (`constraint equation 9`) psepbqarmax = 10.0 * maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`) diff --git a/process/constraints.py b/process/constraints.py index 533f0cb51d..b0f2fa2702 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -355,6 +355,7 @@ def constraint_equation_5(): """Equation for density upper limit author: P B Lloyd, CCFE, Culham Science Centre + fdene: density limit scale nd_plasma_electrons_vol_avg: electron density (/m3) nd_plasma_electrons_max: density limit (/m3) nd_plasma_electron_line: line averaged electron density (m-3) @@ -367,22 +368,27 @@ def constraint_equation_5(): - 5 JET simplified; - 6 Hugill-Murakami Mq limit; - 7 Greenwald limit + + fdene scales the constraint such that: + nd_plasma_electrons_vol_avg / nd_plasma_electrons_max <= fdene. """ # Apply Greenwald limit to line-averaged density if data_structure.physics_variables.i_density_limit == 7: return ConstraintResult( data_structure.physics_variables.nd_plasma_electron_line / data_structure.physics_variables.nd_plasma_electrons_max - - 1.0, - data_structure.physics_variables.nd_plasma_electrons_max, - data_structure.physics_variables.nd_plasma_electrons_max + - data_structure.constraint_variables.fdene, + data_structure.constraint_variables.fdene + * data_structure.physics_variables.nd_plasma_electrons_max, + data_structure.constraint_variables.fdene + * data_structure.physics_variables.nd_plasma_electrons_max - data_structure.physics_variables.nd_plasma_electron_line, ) cc = ( data_structure.physics_variables.nd_plasma_electrons_vol_avg / data_structure.physics_variables.nd_plasma_electrons_max - - 1.0 + - data_structure.constraint_variables.fdene ) return ConstraintResult( cc, diff --git a/process/data_structure/constraint_variables.py b/process/data_structure/constraint_variables.py index cadbb55682..ab581f4cbe 100644 --- a/process/data_structure/constraint_variables.py +++ b/process/data_structure/constraint_variables.py @@ -14,6 +14,10 @@ """maximum peak toroidal field (T) (`constraint equation 25`)""" +fdene: float = None +"""Scaling value for density limit (constraint equation 5)""" + + q95_fixed: float = None """fixed safety factor q at 95% flux surface (`constraint equation 68`) @@ -106,6 +110,7 @@ def init_constraint_variables(): global beta_poloidal_max global big_q_plasma_min global b_tf_inboard_max + global fdene global q95_fixed global eta_cd_norm_hcd_primary_max global i_q95_fixed @@ -134,6 +139,7 @@ def init_constraint_variables(): beta_poloidal_max = 0.19 big_q_plasma_min = 10.0 b_tf_inboard_max = 12.0 + fdene = 1.0 q95_fixed = 3.0 eta_cd_norm_hcd_primary_max = 2.0 i_q95_fixed = 0 diff --git a/process/input.py b/process/input.py index 32f016e40c..14ae74fad4 100644 --- a/process/input.py +++ b/process/input.py @@ -757,6 +757,9 @@ def __post_init__(self): "f_a_tf_turn_cable_copper": InputVariable( data_structure.tfcoil_variables, float, range=(0.0, 1.0) ), + "fdene": InputVariable( + data_structure.constraint_variables, float, range=(0.001, 10.0) + ), "f_ster_div_single": InputVariable( data_structure.fwbs_variables, float, range=(0.0, 1.0) ), diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index 277b2861c3..5ea2c745ae 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -484,7 +484,6 @@ "fbeta_min", "fc_tf_turn_max", "fr_conducting_wall", - "fdene", "fdtmp", "fecrh_ignition", "fflutf", diff --git a/tests/integration/data/large_tokamak_eval.IN.DAT b/tests/integration/data/large_tokamak_eval.IN.DAT index a2174d6f43..bfb8332dc0 100644 --- a/tests/integration/data/large_tokamak_eval.IN.DAT +++ b/tests/integration/data/large_tokamak_eval.IN.DAT @@ -92,6 +92,7 @@ dr_shld_blkt_gap = 0.02 * gap between vacuum vessel and blanket (m) *---------------Constraint Variables---------------* b_tf_inboard_max = 14.0 * maximum peak toroidal field (T) (`constraint equation 25`) +fdene = 1.2 * density limit constraint scale (constraint equation 5) p_plant_electric_net_required_mw = 400.0 * required net electric power (MW) (`constraint equation 16`) p_fusion_total_max_mw = 3000 * maximum fusion power (MW) (`constraint equation 9`) psepbqarmax = 10.0 * maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`) diff --git a/tests/regression/input_files/large_tokamak_eval.IN.DAT b/tests/regression/input_files/large_tokamak_eval.IN.DAT index 25024d2ad2..7e541634c3 100644 --- a/tests/regression/input_files/large_tokamak_eval.IN.DAT +++ b/tests/regression/input_files/large_tokamak_eval.IN.DAT @@ -92,6 +92,7 @@ dr_shld_blkt_gap = 0.02 * gap between vacuum vessel and blanket (m) *---------------Constraint Variables---------------* b_tf_inboard_max = 14.0 * maximum peak toroidal field (T) (`constraint equation 25`) +fdene = 1.2 * density limit constraint scale (constraint equation 5) p_plant_electric_net_required_mw = 400.0 * required net electric power (MW) (`constraint equation 16`) p_fusion_total_max_mw = 3000 * maximum fusion power (MW) (`constraint equation 9`) psepbqarmax = 10.0 * maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`) diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index f7a1d3cae3..6f97c36962 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -142,6 +142,7 @@ sig_tf_wp_max = 7.5E8 * Allowable maximum shear stress in TF coil conduit (Tr *---------------------* icc = 5 ixc = 6 * nd_plasma_electrons_vol_avg [m-3] +fdene = 1.2 * density limit constraint scale (constraint equation 5) nd_plasma_electrons_vol_avg = 7.5E19 * Neutron wall load upper limit * From c9b3d7128c9bfe9e6f94263b95149fc2b2a220b2 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Tue, 25 Nov 2025 14:21:05 +0000 Subject: [PATCH 10/17] Add fradpwr back --- process/constraints.py | 10 +++++++++- process/data_structure/constraint_variables.py | 5 +++++ process/input.py | 3 +++ .../input_files/spherical_tokamak_eval.IN.DAT | 1 + tests/regression/input_files/st_regression.IN.DAT | 4 ++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/process/constraints.py b/process/constraints.py index b0f2fa2702..1b695a2e30 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -626,6 +626,11 @@ def constraint_equation_17(): pden_non_alpha_charged_mw: non-alpha charged particle fusion power per volume (MW/m3) pden_plasma_ohmic_mw: ohmic heating power per volume (MW/m3) pden_plasma_rad_mw: total radiation power per volume (MW/m3) + fradpwr: core radiation power limit scale + + fradpwr scales the constraint such that + + pden_plasma_rad_mw / pradmaxpv <= fradpwr """ # Maximum possible power/vol_plasma that can be radiated (local) pradmaxpv = ( @@ -637,7 +642,10 @@ def constraint_equation_17(): + data_structure.physics_variables.pden_plasma_ohmic_mw ) - cc = data_structure.physics_variables.pden_plasma_rad_mw / pradmaxpv - 1.0 + cc = ( + data_structure.physics_variables.pden_plasma_rad_mw / pradmaxpv + - data_structure.constraint_variables.fradpwr + ) return ConstraintResult( cc, pradmaxpv * (1.0 - cc), diff --git a/process/data_structure/constraint_variables.py b/process/data_structure/constraint_variables.py index ab581f4cbe..8623e5f1e2 100644 --- a/process/data_structure/constraint_variables.py +++ b/process/data_structure/constraint_variables.py @@ -17,6 +17,9 @@ fdene: float = None """Scaling value for density limit (constraint equation 5)""" +fradpwr: float = None +"""Scaling value for radiation power upper limit (constraint equation 17)""" + q95_fixed: float = None """fixed safety factor q at 95% flux surface @@ -111,6 +114,7 @@ def init_constraint_variables(): global big_q_plasma_min global b_tf_inboard_max global fdene + global fradpwr global q95_fixed global eta_cd_norm_hcd_primary_max global i_q95_fixed @@ -140,6 +144,7 @@ def init_constraint_variables(): big_q_plasma_min = 10.0 b_tf_inboard_max = 12.0 fdene = 1.0 + fradpwr = 1.0 q95_fixed = 3.0 eta_cd_norm_hcd_primary_max = 2.0 i_q95_fixed = 0 diff --git a/process/input.py b/process/input.py index 14ae74fad4..7a0e8dfa91 100644 --- a/process/input.py +++ b/process/input.py @@ -808,6 +808,9 @@ def __post_init__(self): "fracture_toughness": InputVariable( data_structure.cs_fatigue_variables, float, range=(0.1, 100000000.0) ), + "fradpwr": InputVariable( + data_structure.constraint_variables, float, range=(0.0, 1.0) + ), "f_radius_beam_tangency_rmajor": InputVariable( data_structure.current_drive_variables, float, range=(0.5, 2.0) ), diff --git a/tests/regression/input_files/spherical_tokamak_eval.IN.DAT b/tests/regression/input_files/spherical_tokamak_eval.IN.DAT index 11237137ac..d83d7b7979 100644 --- a/tests/regression/input_files/spherical_tokamak_eval.IN.DAT +++ b/tests/regression/input_files/spherical_tokamak_eval.IN.DAT @@ -97,6 +97,7 @@ i_bldgs_size = 0 * switch between routines estimating building sizes (0 = defaul *---------------Constraint Variables---------------* +fradpwr = 0.7109311818294267 * radiation power upper limit constraint scale (constraint equation 17) pflux_fw_rad_max = 1.2 * Maximum permitted radiation wall load (MW/m^2) (`constraint equation 67`) f_fw_rad_max = 1.0 * peaking factor for radiation wall load (`constraint equation 67`) p_fusion_total_max_mw = 2500.0 * maximum fusion power (MW) (`constraint equation 9`) diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 0f52620347..132c7d18f0 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -562,6 +562,10 @@ icc = 17 * JUSTIFICATION: Limit for plasma stability * VARIABLES: Rest calculated in-situ +fradpwr = 0.64 +* DESCRIPTION: Radiation power upper limit constraint scale (constraint equation 17) +* JUSTIFICATION: Scales the bound of constraint equation 17 + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *f_nd_protium_electrons = From 91c4eafc0eda21ba427e8f6aae027e2fb907ce75 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Tue, 25 Nov 2025 14:23:10 +0000 Subject: [PATCH 11/17] Correct dr_shld_inboard in large tokamak regression test --- tests/regression/input_files/large_tokamak_nof.IN.DAT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index 6f97c36962..e4ccbb789b 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -274,7 +274,7 @@ dz_vv_upper = 0.3 * Underside vacuum vessel radial thickness [m] dz_vv_lower = 0.3 -* Inboard vacuum vessel thickness [m] +* Inboard radiation shield radial thickness [m] dr_shld_inboard = 0.3 * Gap between vacuum vessel and blanket [m] From 0a4a3c25115fc064d69b5ffee100b458038aad4d Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Tue, 25 Nov 2025 16:54:22 +0000 Subject: [PATCH 12/17] Add back warnings for fiooic, fjohc, and fjohc0 --- process/pfcoil.py | 21 +++++++++++++++++++++ process/superconducting_tf_coil.py | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/process/pfcoil.py b/process/pfcoil.py index 0579695285..d28d4972ee 100644 --- a/process/pfcoil.py +++ b/process/pfcoil.py @@ -2374,6 +2374,27 @@ def outpf(self): ) ): pfcoil_variables.cslimit = True + + if ( + pfcoil_variables.j_cs_flat_top_end + / pfcoil_variables.j_cs_critical_flat_top_end + > 0.7 + ): + logger.error( + "j_cs_flat_top_end / j_cs_critical_flat_top_end shouldn't be above 0.7 " + "for engineering reliability" + ) + + if ( + pfcoil_variables.j_cs_pulse_start + / pfcoil_variables.j_cs_critical_pulse_start + > 0.7 + ): + logger.error( + "j_cs_pulse_start / j_cs_critical_pulse_start shouldn't be above 0.7 " + "for engineering reliability" + ) + if ( pfcoil_variables.temp_cs_superconductor_margin < 1.01e0 * tfv.temp_cs_superconductor_margin_min diff --git a/process/superconducting_tf_coil.py b/process/superconducting_tf_coil.py index 0d4fbe3794..be57bae76b 100644 --- a/process/superconducting_tf_coil.py +++ b/process/superconducting_tf_coil.py @@ -1519,6 +1519,11 @@ def output_tf_superconductor_info(self): superconducting_tf_coil_variables.f_c_tf_turn_operating_critical, "OP ", ) + if superconducting_tf_coil_variables.f_c_tf_turn_operating_critical > 0.7: + logger.error( + "f_c_tf_turn_operating_critical shouldn't be above 0.7 for engineering reliability" + ) + po.ovarre( self.outfile, "TF Superconductor quench dump time (s)", From f4d507b03b286dc35fe0737cbad618aea8e61224 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Wed, 26 Nov 2025 13:38:07 +0000 Subject: [PATCH 13/17] Add back fiooic, fjohc, and fjohc0 --- documentation/eng-models/central-solenoid.md | 7 ++++-- .../eng-models/tf-coil-superconducting.md | 2 +- documentation/fusion-devices/stellarator.md | 1 + examples/data/large_tokamak_eval_IN.DAT | 3 +++ process/constraints.py | 18 ++++++++++----- .../data_structure/constraint_variables.py | 22 +++++++++++++++++++ process/data_structure/scan_variables.py | 1 + process/input.py | 9 ++++++++ process/io/plot_radial_build.py | 1 + process/io/plot_scans.py | 1 + process/pfcoil.py | 10 ++------- process/scan.py | 1 + process/stellarator.py | 2 +- .../data/large_tokamak_eval.IN.DAT | 3 +++ .../input_files/large_tokamak_eval.IN.DAT | 3 +++ .../input_files/large_tokamak_nof.IN.DAT | 3 +++ .../input_files/spherical_tokamak_eval.IN.DAT | 1 + .../input_files/st_regression.IN.DAT | 4 ++++ .../stellarator_helias_eval.IN.DAT | 1 + 19 files changed, 76 insertions(+), 17 deletions(-) diff --git a/documentation/eng-models/central-solenoid.md b/documentation/eng-models/central-solenoid.md index b633e352d6..8346dfb1ad 100644 --- a/documentation/eng-models/central-solenoid.md +++ b/documentation/eng-models/central-solenoid.md @@ -299,8 +299,8 @@ using `f_j_cs_start_pulse_end_flat_top` (iteration variable no. 41). The current calculated by taking into account the flux swing necessary to initiate and maintain plasma current. The current density in the central solenoid can be limited at BOP and at EOF. To limit the current -density at BOP, use constraint equation no. 27. To -limit the current density at the EOF, constraint equation no. 26 should be turned on. +density at BOP, use constraint equation no. 27 (with a margin set by `fjohc0`). To +limit the current density at the EOF, constraint equation no. 26 should be turned on (with a margin set by `fjohc`). The critical current density *J*crit is a function of the temperature of the superconductor. The temperature margin $\Delta$*T* is the difference between the current sharing temperature and the @@ -311,6 +311,9 @@ set using input parameter `tmargmin` together with constraint equation no. 60. It is recommended that EITHER the temperature margin constraint (60), OR the current density constraints (26 and 27) are activated. +!!! tip "Recommended maximum current ratio" + For engineering feasibility, the currents at end of flat-top and beginning of pulse (set by the `fjohc` and `fjohc0` margins, respectively) shouldn't be set above 0.7. + !!! note "Central solenoid current over time" A plot of how the central solenoid current varies over time can be found [here](../physics-models/pulsed-plant.md#burn-time) diff --git a/documentation/eng-models/tf-coil-superconducting.md b/documentation/eng-models/tf-coil-superconducting.md index 2dabd8ef5a..a5c771ba49 100644 --- a/documentation/eng-models/tf-coil-superconducting.md +++ b/documentation/eng-models/tf-coil-superconducting.md @@ -237,7 +237,7 @@ The toroidal field falls off at a rate $1/R$, with the peak value occurring at t Three constraints are relevant to the operating current density $J_{\mbox{op}}$ in the TF coils. -- Criticial current (`constraint 33`): $J_{\mbox{op}}$ must not exceed the critical value $J_{\mbox{crit}}$. +- Criticial current (`constraint 33`): $f_{\text{iooic}}J_{\mbox{op}}$ must not exceed the critical value $J_{\mbox{crit}}$ where `fiooic` is a margin on the constraint that defaults to `0.7`. - Temperature margin (`constraint 36`) -- The critical current density $J_{\mbox{crit}}$ falls with the temperature of the superconductor. The temperature margin $\Delta T$ is the difference between the current sharing temperature (at which $J_{\mbox{crit}}$ would be equal to $J_{\mbox{op}}$) and the operating temperature. The minimum allowed $\Delta T$ diff --git a/documentation/fusion-devices/stellarator.md b/documentation/fusion-devices/stellarator.md index 5fe5496cd7..aad1b1c691 100644 --- a/documentation/fusion-devices/stellarator.md +++ b/documentation/fusion-devices/stellarator.md @@ -226,6 +226,7 @@ f_a_tf_turn_cable_copper = 0.7 *Copper fraction of cable conductor (TF coils), S tftmp = 4.75 *Peak helium coolant temperature in TF coils and PF coils (K) temp_tf_cryo = 4.75 * Temperature in TF coils, required for plant efficiency (K) f_a_tf_turn_cable_space_extra_void = 0.3 *Coolant fraction of TF coil leg (itfsup=0) this is the same for conductor and strand! +fiooic = 0.78 * Fraction TF coil critical current to operation current (constraint margin) v_tf_coil_dump_quench_max_kv = 12.64 * Max voltage across tf coil during quench (kV) t_tf_superconductor_quench = 20 * Dump time (should be iteration variable) dr_tf_nose_case = 0.1 * Thickness TF Coil case (for stellarators: Also for toroidal direction) diff --git a/examples/data/large_tokamak_eval_IN.DAT b/examples/data/large_tokamak_eval_IN.DAT index b2acc057f0..ffeed8a655 100644 --- a/examples/data/large_tokamak_eval_IN.DAT +++ b/examples/data/large_tokamak_eval_IN.DAT @@ -93,6 +93,9 @@ dr_shld_blkt_gap = 0.02 * gap between vacuum vessel and blanket (m) b_tf_inboard_max = 14.0 * maximum peak toroidal field (T) (`constraint equation 25`) fdene = 1.2 * density limit constraint scale (constraint equation 5) +fiooic = 0.65 * margin for TF coil operating current / critical current ratio +fjohc = 0.6 * margin for central solenoid current at end-of-flattop +fjohc0 = 0.6 * margin for central solenoid current at beginning of pulse p_plant_electric_net_required_mw = 400.0 * required net electric power (MW) (`constraint equation 16`) p_fusion_total_max_mw = 3000 * maximum fusion power (MW) (`constraint equation 9`) psepbqarmax = 10.0 * maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`) diff --git a/process/constraints.py b/process/constraints.py index 1b695a2e30..1deef11fbe 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -876,16 +876,18 @@ def constraint_equation_26(): """Equation for Central Solenoid current density upper limit at EOF author: P B Lloyd, CCFE, Culham Science Centre + fjohc: margin for central solenoid current at end-of-flattop j_cs_critical_flat_top_end: allowable central solenoid current density at end of flat-top (A/m2) j_cs_flat_top_end: central solenoid overall current density at end of flat-top (A/m2) """ return ConstraintResult( data_structure.pfcoil_variables.j_cs_flat_top_end / data_structure.pfcoil_variables.j_cs_critical_flat_top_end - - 1.0, + - data_structure.constraint_variables.fjohc, data_structure.pfcoil_variables.j_cs_critical_flat_top_end, data_structure.pfcoil_variables.j_cs_critical_flat_top_end - - data_structure.pfcoil_variables.j_cs_flat_top_end, + - data_structure.pfcoil_variables.j_cs_flat_top_end + / data_structure.constraint_variables.fjohc, ) @@ -894,16 +896,18 @@ def constraint_equation_27(): """Equation for Central Solenoid current density upper limit at BOP author: P B Lloyd, CCFE, Culham Science Centre + fjohc0: margin for central solenoid current at beginning of pulse j_cs_critical_pulse_start: allowable central solenoid current density at beginning of pulse (A/m2) j_cs_pulse_start: central solenoid overall current density at beginning of pulse (A/m2) """ return ConstraintResult( data_structure.pfcoil_variables.j_cs_pulse_start / data_structure.pfcoil_variables.j_cs_critical_pulse_start - - 1.0, + - data_structure.constraint_variables.fjohc0, data_structure.pfcoil_variables.j_cs_critical_pulse_start, data_structure.pfcoil_variables.j_cs_critical_pulse_start - - data_structure.pfcoil_variables.j_cs_pulse_start, + - data_structure.pfcoil_variables.j_cs_pulse_start + / data_structure.constraint_variables.fjohc0, ) @@ -1021,14 +1025,18 @@ def constraint_equation_33(): author: P B Lloyd, CCFE, Culham Science Centre args : output structure : residual error; constraint value; + fiooic: margin for TF coil operating current / critical j_tf_wp_critical: critical current density for winding pack (A/m2) j_tf_wp: winding pack current density (A/m2) + + fiooic scales the constraint such that: + j_tf_wp / j_tf_wp_critical <= fiooic. """ cc = ( data_structure.tfcoil_variables.j_tf_wp / data_structure.tfcoil_variables.j_tf_wp_critical - - 1.0 + - data_structure.constraint_variables.fiooic ) return ConstraintResult( cc, diff --git a/process/data_structure/constraint_variables.py b/process/data_structure/constraint_variables.py index 8623e5f1e2..e20350f1d2 100644 --- a/process/data_structure/constraint_variables.py +++ b/process/data_structure/constraint_variables.py @@ -21,11 +21,27 @@ """Scaling value for radiation power upper limit (constraint equation 17)""" +fiooic: float = None +"""Constraint margin for TF coil operating current / critical current ratio +(`constraint equation 33`) +""" + q95_fixed: float = None """fixed safety factor q at 95% flux surface (`constraint equation 68`) """ +fjohc: float = None +"""Constraint margin for central solenoid current at end-of-flattop +(`constraint equation 26`) +""" + + +fjohc0: float = None +"""Constraint margin for central solenoid current at beginning of pulse +(`constraint equation 27`) +""" + eta_cd_norm_hcd_primary_max: float = None """maximum current drive gamma (`constraint equation 37`)""" @@ -115,7 +131,10 @@ def init_constraint_variables(): global b_tf_inboard_max global fdene global fradpwr + global fiooic global q95_fixed + global fjohc + global fjohc0 global eta_cd_norm_hcd_primary_max global i_q95_fixed global pflux_fw_rad_max @@ -145,7 +164,10 @@ def init_constraint_variables(): b_tf_inboard_max = 12.0 fdene = 1.0 fradpwr = 1.0 + fiooic = 0.7 q95_fixed = 3.0 + fjohc = 0.7 + fjohc0 = 0.7 eta_cd_norm_hcd_primary_max = 2.0 i_q95_fixed = 0 pflux_fw_rad_max = 1.0 diff --git a/process/data_structure/scan_variables.py b/process/data_structure/scan_variables.py index 260da9c63e..af9e19ec5c 100644 --- a/process/data_structure/scan_variables.py +++ b/process/data_structure/scan_variables.py @@ -46,6 +46,7 @@
  • 11 beta_norm_max
  • 12 f_c_plasma_bootstrap_max
  • 13 boundu(10: hfact) +
  • 14 fiooic
  • 16 rmajor
  • 17 b_tf_inboard_max
  • 18 eta_cd_norm_hcd_primary_max diff --git a/process/input.py b/process/input.py index 7a0e8dfa91..11e2c22a0b 100644 --- a/process/input.py +++ b/process/input.py @@ -760,6 +760,15 @@ def __post_init__(self): "fdene": InputVariable( data_structure.constraint_variables, float, range=(0.001, 10.0) ), + "fiooic": InputVariable( + data_structure.constraint_variables, float, range=(0.001, 1.0) + ), + "fjohc": InputVariable( + data_structure.constraint_variables, float, range=(0.001, 1.0) + ), + "fjohc0": InputVariable( + data_structure.constraint_variables, float, range=(0.001, 1.0) + ), "f_ster_div_single": InputVariable( data_structure.fwbs_variables, float, range=(0.0, 1.0) ), diff --git a/process/io/plot_radial_build.py b/process/io/plot_radial_build.py index 6ba6388f04..6e0bbdca57 100644 --- a/process/io/plot_radial_build.py +++ b/process/io/plot_radial_build.py @@ -153,6 +153,7 @@ def main(args=None): "beta_norm_max", "f_c_plasma_bootstrap_max", "boundu(10)", + "fiooic", "rmajor", "b_tf_inboard_peak_symmetric", # b_tf_inboard_max the maximum T field upper limit is the scan variable "eta_cd_norm_hcd_primary_max", diff --git a/process/io/plot_scans.py b/process/io/plot_scans.py index 084b81dc35..7ecf8595f6 100644 --- a/process/io/plot_scans.py +++ b/process/io/plot_scans.py @@ -302,6 +302,7 @@ def main(args=None): 11: "beta_norm_max", 12: "f_c_plasma_bootstrap_max", 13: "boundu(10)", + 14: "fiooic", 16: "rmajor", 17: "b_tf_inboard_peak_symmetric", # b_tf_inboard_max the maximum T field upper limit is the scan variable 18: "eta_cd_norm_hcd_primary_max", diff --git a/process/pfcoil.py b/process/pfcoil.py index d28d4972ee..fed3737c9a 100644 --- a/process/pfcoil.py +++ b/process/pfcoil.py @@ -2361,17 +2361,11 @@ def outpf(self): if ( abs(pfcoil_variables.j_cs_flat_top_end) > 0.99e0 - * abs( - # numerics.boundu[fjohc] * (which should have been 1) - pfcoil_variables.j_cs_critical_flat_top_end - ) + * abs(ctv.fjohc * pfcoil_variables.j_cs_critical_flat_top_end) ) or ( abs(pfcoil_variables.j_cs_pulse_start) > 0.99e0 - * abs( - # numerics.boundu[fjohc0] * (which should have been 1) - pfcoil_variables.j_cs_critical_pulse_start - ) + * abs(ctv.fjohc0 * pfcoil_variables.j_cs_critical_pulse_start) ): pfcoil_variables.cslimit = True diff --git a/process/scan.py b/process/scan.py index 681dd52716..6656bb85dc 100644 --- a/process/scan.py +++ b/process/scan.py @@ -55,6 +55,7 @@ def __iter__(self): 11: ScanVariable("beta_norm_max", "Beta_coefficient"), 12: ScanVariable("f_c_plasma_bootstrap_max", "Bootstrap_fraction"), 13: ScanVariable("boundu(10)", "H_factor_upper_bound"), + 14: ScanVariable("fiooic", "TFC_Iop_/_Icrit_f-value"), 16: ScanVariable("rmajor", "Plasma_major_radius_(m)"), 17: ScanVariable("b_tf_inboard_max", "Max_toroidal_field_(T)"), 18: ScanVariable("eta_cd_norm_hcd_primary_max", "Maximum_CD_gamma"), diff --git a/process/stellarator.py b/process/stellarator.py index f9344a9396..778a85fd9d 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -2633,7 +2633,7 @@ def stcoil(self, output: bool): ) # Get here a temperature margin of 1.5K. # The operation current density weighted with the global iop/icrit fraction - lhs[:] = jcrit_vector + lhs[:] = constraint_variables.fiooic * jcrit_vector # Conduct fraction of conduit * Superconductor fraction in conductor f_scu = ( diff --git a/tests/integration/data/large_tokamak_eval.IN.DAT b/tests/integration/data/large_tokamak_eval.IN.DAT index bfb8332dc0..98c9e6575e 100644 --- a/tests/integration/data/large_tokamak_eval.IN.DAT +++ b/tests/integration/data/large_tokamak_eval.IN.DAT @@ -93,6 +93,9 @@ dr_shld_blkt_gap = 0.02 * gap between vacuum vessel and blanket (m) b_tf_inboard_max = 14.0 * maximum peak toroidal field (T) (`constraint equation 25`) fdene = 1.2 * density limit constraint scale (constraint equation 5) +fiooic = 0.65 +fjohc = 0.6 +fjohc0 = 0.6 p_plant_electric_net_required_mw = 400.0 * required net electric power (MW) (`constraint equation 16`) p_fusion_total_max_mw = 3000 * maximum fusion power (MW) (`constraint equation 9`) psepbqarmax = 10.0 * maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`) diff --git a/tests/regression/input_files/large_tokamak_eval.IN.DAT b/tests/regression/input_files/large_tokamak_eval.IN.DAT index 7e541634c3..7d3c62a12a 100644 --- a/tests/regression/input_files/large_tokamak_eval.IN.DAT +++ b/tests/regression/input_files/large_tokamak_eval.IN.DAT @@ -93,6 +93,9 @@ dr_shld_blkt_gap = 0.02 * gap between vacuum vessel and blanket (m) b_tf_inboard_max = 14.0 * maximum peak toroidal field (T) (`constraint equation 25`) fdene = 1.2 * density limit constraint scale (constraint equation 5) +fiooic = 0.65 * margin for TF coil operating current / critical current ratio +fjohc = 0.6 * margin for central solenoid current at end-of-flattop +fjohc0 = 0.6 * margin for central solenoid current at beginning of pulse p_plant_electric_net_required_mw = 400.0 * required net electric power (MW) (`constraint equation 16`) p_fusion_total_max_mw = 3000 * maximum fusion power (MW) (`constraint equation 9`) psepbqarmax = 10.0 * maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`) diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index e4ccbb789b..22771905a6 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -74,15 +74,18 @@ b_tf_inboard_max = 14.0 * Central solenoid EOF current density upper limit * *--------------------------------------------------* icc = 26 +fjohc = 0.7 * Central solenoid BOP current density upper limit * *--------------------------------------------------* icc = 27 f_j_cs_start_pulse_end_flat_top = 1.0 +fjohc = 0.7 * I_op/I_Crit TF coil limit * *---------------------------* icc = 33 +fiooic = 0.70 * margin for TF coil operating current / critical current ratio * Dump voltage upper limit * *--------------------------* diff --git a/tests/regression/input_files/spherical_tokamak_eval.IN.DAT b/tests/regression/input_files/spherical_tokamak_eval.IN.DAT index d83d7b7979..9a4e1db6e6 100644 --- a/tests/regression/input_files/spherical_tokamak_eval.IN.DAT +++ b/tests/regression/input_files/spherical_tokamak_eval.IN.DAT @@ -97,6 +97,7 @@ i_bldgs_size = 0 * switch between routines estimating building sizes (0 = defaul *---------------Constraint Variables---------------* +fiooic = 0.9942981023320613 * margin for TF coil operating current / critical current ratio fradpwr = 0.7109311818294267 * radiation power upper limit constraint scale (constraint equation 17) pflux_fw_rad_max = 1.2 * Maximum permitted radiation wall load (MW/m^2) (`constraint equation 67`) f_fw_rad_max = 1.0 * peaking factor for radiation wall load (`constraint equation 67`) diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 132c7d18f0..537d7e393a 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -893,6 +893,10 @@ icc = 33 * JUSTIFICATION: A quench must be avoided * VARIABLES: j_tf_wp & j_tf_wp_critical (critical current) calculated in-situ +fiooic = 0.7 +* DESCRIPTION: Constraint margin for TF superconductor operating current / critical current density +* JUSTIFICATION: Margin of 0.7 for engineering reliability + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *icc = 35 diff --git a/tests/regression/input_files/stellarator_helias_eval.IN.DAT b/tests/regression/input_files/stellarator_helias_eval.IN.DAT index 1c075e4455..58e406273d 100644 --- a/tests/regression/input_files/stellarator_helias_eval.IN.DAT +++ b/tests/regression/input_files/stellarator_helias_eval.IN.DAT @@ -79,6 +79,7 @@ dz_xpoint_divertor = 0. * vertical gap between x-point and divertor (m) (if = 0; *---------------Constraint Variables---------------* +fiooic = 0.9 * margin for TF coil operating current / critical current ratio big_q_plasma_min = 1 * minimum fusion gain Q (`constraint equation 28`) pflux_fw_rad_max = 1 * Maximum permitted radiation wall load (MW/m^2) (`constraint equation 67`) p_plant_electric_net_required_mw = 1000 * required net electric power (MW) (`constraint equation 16`) From a9350cf666d2a3b6dd78d7449af51016a8790760 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Thu, 27 Nov 2025 11:38:08 +0000 Subject: [PATCH 14/17] Add additional constraint to enforce L-mode --- documentation/physics-models/plasma_h_mode.md | 20 +++++------ process/constraints.py | 36 +++++++++++++++++-- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/documentation/physics-models/plasma_h_mode.md b/documentation/physics-models/plasma_h_mode.md index 57a62b931f..bf1ecf522a 100644 --- a/documentation/physics-models/plasma_h_mode.md +++ b/documentation/physics-models/plasma_h_mode.md @@ -23,25 +23,23 @@ There are two separate constraint equations for enforcing the L-H threshold. ### Use the full divertor power -This constraint can be activated by stating `icc = 15` in the input file. +There are two constraints that can be used to enforce L-mode or H-mode. -The input `fl_h_threshold` can be set not equal to 1 to provide a margin around the threshold. +Constraint 15 (`icc = 15`) with `fl_h_threshold <= 1.0` ensures that the power reaching the divertor is at least equal to the threshold power calculated for the chosen scaling, which is a necessary condition for H-mode. $$ -1.0 - \mathtt{fl\_h\_threshold} \times \frac{\overbrace{\mathtt{p\_l\_h\_threshold\_mw}}^{\text{Power from scaling}}}{\mathtt{p_plasma_separatrix_mw}} +\mathtt{fl\_h\_threshold} \times \mathtt{p\_plasma\_separatrix\_mw} >= \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} $$ +`fl_h_threshold` can be used to add a margin to the constraint. For example, `fl_h_threshold = 0.8` ensures that `p_plasma_separatrix_mw` is at least 25% greater than the threshold power. +Constraint 22 (`icc = 22`) with `fl_h_threshold >= 1.0` is the opposite of constraint 15 and ensures that the power reaching the divertor is less than the threshold by some margin. -For an H-mode plasma, `icc = 15` with `fl_h_threshold >= 1.0` will ensure -that the power reaching the divertor is at least equal to the threshold power -calculated for the chosen scaling, which is a necessary condition for -H-mode. - -For an L-mode plasma, `icc = 15` should be turned on with `fl_h_threshold < 1.0` to ensure that the power does not exceed the calculated threshold, -and therefore the machine remains in L-mode. +$$ +\mathtt{fl\_h\_threshold} \times \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} >= \mathtt{p\_plasma\_separatrix\_mw} +$$ -**Therefore it is recommended to always use `icc = 15` if trying to simulate a plasma scenario specifically in L or H-mode** +Again, `fl_h_threshold` can be used to add a margin to the constraint. For example, `fl_h_threshold = 1.25` ensures that `p_plasma_separatrix_mw` is at least 25% less than the threshold power. ------- diff --git a/process/constraints.py b/process/constraints.py index 1deef11fbe..4adb254aa7 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -553,15 +553,18 @@ def constraint_equation_13(): @ConstraintManager.register_constraint(15, "MW", ">=") def constraint_equation_15(): - """Equation for L-H power threshold limit + """Equation for L-H power threshold limit to enforce H-mode author: P B Lloyd, CCFE, Culham Science Centre - fl_h_threshold: a factor tolerance on the constraint + fl_h_threshold: a margin on the constraint p_l_h_threshold_mw: L-H mode power threshold (MW) p_plasma_separatrix_mw: power to conducted to the divertor region (MW) - Setting fl_h_threshold != 1.0 enforces a constraint on a factor of the p_plasma_separatrix_mw + Setting fl_h_threshold != 1.0 enforces a margin on the constraint: I.e. fl_h_threshold * p_plasma_separatrix_mw >= p_l_h_threshold_mw + + For example, fl_h_threshold = 0.8 will ensure that p_plasma_separatrix_mw + is at least 25% above the threshold (in H-mode). """ return ConstraintResult( 1.0 @@ -575,6 +578,33 @@ def constraint_equation_15(): ) +@ConstraintManager.register_constraint(22, "MW", ">=") +def constraint_equation_22(): + """Equation for L-H power threshold limit to enforce L-mode + author: P B Lloyd, CCFE, Culham Science Centre + + fl_h_threshold: a margin on the constraint + p_l_h_threshold_mw: L-H mode power threshold (MW) + p_plasma_separatrix_mw: power to conducted to the divertor region (MW) + + Setting fl_h_threshold != 1.0 enforces a margin on the constraint: + I.e. fl_h_threshold * p_l_h_threshold_mw >= p_plasma_separatrix_mw + + For example, fl_h_threshold = 1.2 will ensure that p_plasma_separatrix_mw + is at least 20% below the threshold (in L-mode). + """ + return ConstraintResult( + 1.0 + - data_structure.constraint_variables.fl_h_threshold + * data_structure.physics_variables.p_l_h_threshold_mw + / data_structure.physics_variables.p_plasma_separatrix_mw, + data_structure.physics_variables.p_plasma_separatrix_mw, + data_structure.physics_variables.p_plasma_separatrix_mw + - data_structure.physics_variables.p_l_h_threshold_mw + / data_structure.constraint_variables.fl_h_threshold, + ) + + @ConstraintManager.register_constraint(16, "MW", ">=") def constraint_equation_16(): """Equation for net electric power lower limit From a7fd265112a3c428077d4ceae1febb68d4c5a357 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Fri, 5 Dec 2025 11:15:31 +0000 Subject: [PATCH 15/17] Correct mistakes in HMode docs and scan example --- documentation/physics-models/plasma_h_mode.md | 4 +- examples/scan.ipynb | 2 +- process/constraints.py | 96 +++++++++---------- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/documentation/physics-models/plasma_h_mode.md b/documentation/physics-models/plasma_h_mode.md index bf1ecf522a..891e0bdbd9 100644 --- a/documentation/physics-models/plasma_h_mode.md +++ b/documentation/physics-models/plasma_h_mode.md @@ -28,7 +28,7 @@ There are two constraints that can be used to enforce L-mode or H-mode. Constraint 15 (`icc = 15`) with `fl_h_threshold <= 1.0` ensures that the power reaching the divertor is at least equal to the threshold power calculated for the chosen scaling, which is a necessary condition for H-mode. $$ -\mathtt{fl\_h\_threshold} \times \mathtt{p\_plasma\_separatrix\_mw} >= \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} +\mathtt{fl\_h\_threshold} \times \mathtt{p\_plasma\_separatrix\_mw} \ge \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} $$ `fl_h_threshold` can be used to add a margin to the constraint. For example, `fl_h_threshold = 0.8` ensures that `p_plasma_separatrix_mw` is at least 25% greater than the threshold power. @@ -36,7 +36,7 @@ $$ Constraint 22 (`icc = 22`) with `fl_h_threshold >= 1.0` is the opposite of constraint 15 and ensures that the power reaching the divertor is less than the threshold by some margin. $$ -\mathtt{fl\_h\_threshold} \times \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} >= \mathtt{p\_plasma\_separatrix\_mw} +\mathtt{fl\_h\_threshold} \times \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} \ge \mathtt{p\_plasma\_separatrix\_mw} $$ Again, `fl_h_threshold` can be used to add a margin to the constraint. For example, `fl_h_threshold = 1.25` ensures that `p_plasma_separatrix_mw` is at least 25% less than the threshold power. diff --git a/examples/scan.ipynb b/examples/scan.ipynb index 0a1048a129..776cd918da 100644 --- a/examples/scan.ipynb +++ b/examples/scan.ipynb @@ -18,7 +18,7 @@ "The input file is a scan-enabled version of the large tokamak `IN.DAT`, as found in the `tests` directory. The scan-relevant values are:\n", "```\n", "nsweep = 17 * b_tf_inboard_max, maximum peak toroidal field (T) (constraint equation 25)\n", - "isweep = 5\n", + "isweep = 6\n", "sweep = 10.5, 10.4, 10.3, 10.2, 10.1, 10.0\n", "```\n", "\n", diff --git a/process/constraints.py b/process/constraints.py index 4adb254aa7..5d45d6934a 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -551,6 +551,27 @@ def constraint_equation_13(): ) +@ConstraintManager.register_constraint(14, "", "=") +def constraint_equation_14(): + """Equation to fix number of NBI decay lengths to plasma centre + author: P B Lloyd, CCFE, Culham Science Centre + + n_beam_decay_lengths_core: neutral beam e-decay lengths to plasma centre + n_beam_decay_lengths_core_required: permitted neutral beam e-decay lengths to plasma centre + """ + cc = ( + 1.0 + - data_structure.current_drive_variables.n_beam_decay_lengths_core + / data_structure.current_drive_variables.n_beam_decay_lengths_core_required + ) + return ConstraintResult( + cc, + data_structure.current_drive_variables.n_beam_decay_lengths_core_required + * (1.0 - cc), + data_structure.current_drive_variables.n_beam_decay_lengths_core_required * cc, + ) + + @ConstraintManager.register_constraint(15, "MW", ">=") def constraint_equation_15(): """Equation for L-H power threshold limit to enforce H-mode @@ -578,33 +599,6 @@ def constraint_equation_15(): ) -@ConstraintManager.register_constraint(22, "MW", ">=") -def constraint_equation_22(): - """Equation for L-H power threshold limit to enforce L-mode - author: P B Lloyd, CCFE, Culham Science Centre - - fl_h_threshold: a margin on the constraint - p_l_h_threshold_mw: L-H mode power threshold (MW) - p_plasma_separatrix_mw: power to conducted to the divertor region (MW) - - Setting fl_h_threshold != 1.0 enforces a margin on the constraint: - I.e. fl_h_threshold * p_l_h_threshold_mw >= p_plasma_separatrix_mw - - For example, fl_h_threshold = 1.2 will ensure that p_plasma_separatrix_mw - is at least 20% below the threshold (in L-mode). - """ - return ConstraintResult( - 1.0 - - data_structure.constraint_variables.fl_h_threshold - * data_structure.physics_variables.p_l_h_threshold_mw - / data_structure.physics_variables.p_plasma_separatrix_mw, - data_structure.physics_variables.p_plasma_separatrix_mw, - data_structure.physics_variables.p_plasma_separatrix_mw - - data_structure.physics_variables.p_l_h_threshold_mw - / data_structure.constraint_variables.fl_h_threshold, - ) - - @ConstraintManager.register_constraint(16, "MW", ">=") def constraint_equation_16(): """Equation for net electric power lower limit @@ -623,27 +617,6 @@ def constraint_equation_16(): ) -@ConstraintManager.register_constraint(14, "", "=") -def constraint_equation_14(): - """Equation to fix number of NBI decay lengths to plasma centre - author: P B Lloyd, CCFE, Culham Science Centre - - n_beam_decay_lengths_core: neutral beam e-decay lengths to plasma centre - n_beam_decay_lengths_core_required: permitted neutral beam e-decay lengths to plasma centre - """ - cc = ( - 1.0 - - data_structure.current_drive_variables.n_beam_decay_lengths_core - / data_structure.current_drive_variables.n_beam_decay_lengths_core_required - ) - return ConstraintResult( - cc, - data_structure.current_drive_variables.n_beam_decay_lengths_core_required - * (1.0 - cc), - data_structure.current_drive_variables.n_beam_decay_lengths_core_required * cc, - ) - - @ConstraintManager.register_constraint(17, "MW/m3", "<=") def constraint_equation_17(): """Equation for radiation power upper limit @@ -763,6 +736,33 @@ def constraint_equation_21(): ) +@ConstraintManager.register_constraint(22, "MW", ">=") +def constraint_equation_22(): + """Equation for L-H power threshold limit to enforce L-mode + author: P B Lloyd, CCFE, Culham Science Centre + + fl_h_threshold: a margin on the constraint + p_l_h_threshold_mw: L-H mode power threshold (MW) + p_plasma_separatrix_mw: power to conducted to the divertor region (MW) + + Setting fl_h_threshold != 1.0 enforces a margin on the constraint: + I.e. fl_h_threshold * p_l_h_threshold_mw >= p_plasma_separatrix_mw + + For example, fl_h_threshold = 1.2 will ensure that p_plasma_separatrix_mw + is at least 20% below the threshold (in L-mode). + """ + return ConstraintResult( + 1.0 + - data_structure.constraint_variables.fl_h_threshold + * data_structure.physics_variables.p_l_h_threshold_mw + / data_structure.physics_variables.p_plasma_separatrix_mw, + data_structure.physics_variables.p_plasma_separatrix_mw, + data_structure.physics_variables.p_plasma_separatrix_mw + - data_structure.physics_variables.p_l_h_threshold_mw + / data_structure.constraint_variables.fl_h_threshold, + ) + + @ConstraintManager.register_constraint(23, "m", "<=") def constraint_equation_23(): """Equation for conducting shell radius / rminor upper limit From 54c6aaa9a4bbd9ce6c81f16d28662945d2c64cee Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Mon, 15 Dec 2025 13:51:48 +0000 Subject: [PATCH 16/17] Split fl_h_threshold into two separate margins --- documentation/physics-models/plasma_h_mode.md | 13 ++++--- process/constraints.py | 38 ++++++++++--------- .../data_structure/constraint_variables.py | 16 ++++++-- process/data_structure/numerics.py | 2 +- process/input.py | 5 ++- process/io/obsolete_vars.py | 6 ++- process/physics.py | 3 +- 7 files changed, 51 insertions(+), 32 deletions(-) diff --git a/documentation/physics-models/plasma_h_mode.md b/documentation/physics-models/plasma_h_mode.md index 891e0bdbd9..ab00ea53d6 100644 --- a/documentation/physics-models/plasma_h_mode.md +++ b/documentation/physics-models/plasma_h_mode.md @@ -25,21 +25,22 @@ There are two separate constraint equations for enforcing the L-H threshold. There are two constraints that can be used to enforce L-mode or H-mode. -Constraint 15 (`icc = 15`) with `fl_h_threshold <= 1.0` ensures that the power reaching the divertor is at least equal to the threshold power calculated for the chosen scaling, which is a necessary condition for H-mode. +Constraint 15 (`icc = 15`) is used to enforce H-mode by mandating that the plasma at the separatrix is greater than or equal to the L-H threshold power, a necessary condition for H-mode. `h_mode_threshold_margin >= 1.0` can be used to ensure the separatrix power exceeds the threshold by some margin. $$ -\mathtt{fl\_h\_threshold} \times \mathtt{p\_plasma\_separatrix\_mw} \ge \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} +\mathtt{p\_plasma\_separatrix\_mw} \ge \mathtt{h\_mode\_threshold\_margin} \times \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} $$ -`fl_h_threshold` can be used to add a margin to the constraint. For example, `fl_h_threshold = 0.8` ensures that `p_plasma_separatrix_mw` is at least 25% greater than the threshold power. +For example, `h_mode_threshold_margin = 1.2` ensures that `p_plasma_separatrix_mw` is at least $1.2\times$ greater than the threshold power `p_l_h_threshold_mw`. -Constraint 22 (`icc = 22`) with `fl_h_threshold >= 1.0` is the opposite of constraint 15 and ensures that the power reaching the divertor is less than the threshold by some margin. + +Constraint 22 (`icc = 22`) is the opposite of constraint 15 and ensures that the power reaching the divertor is less than or equal to the L-H threshold power. `l_mode_threshold_margin >= 1.0` can be used to ensure that the threshold power is greater than the separatrix power by some margin. $$ -\mathtt{fl\_h\_threshold} \times \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} \ge \mathtt{p\_plasma\_separatrix\_mw} +\mathtt{l\_mode\_threshold\_margin} \times \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} \ge \mathtt{p\_plasma\_separatrix\_mw} $$ -Again, `fl_h_threshold` can be used to add a margin to the constraint. For example, `fl_h_threshold = 1.25` ensures that `p_plasma_separatrix_mw` is at least 25% less than the threshold power. +For example, `l_mode_threshold_margin = 1.2` ensures that `p_l_h_threshold_mw` is at least $1.2\times$ greater than the separatrix power `p_plasma_separatrix_mw`. ------- diff --git a/process/constraints.py b/process/constraints.py index 5d45d6934a..a50a56747c 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -577,25 +577,27 @@ def constraint_equation_15(): """Equation for L-H power threshold limit to enforce H-mode author: P B Lloyd, CCFE, Culham Science Centre - fl_h_threshold: a margin on the constraint + h_mode_threshold_margin: a margin on the constraint p_l_h_threshold_mw: L-H mode power threshold (MW) p_plasma_separatrix_mw: power to conducted to the divertor region (MW) - Setting fl_h_threshold != 1.0 enforces a margin on the constraint: - I.e. fl_h_threshold * p_plasma_separatrix_mw >= p_l_h_threshold_mw + Setting h_mode_threshold_margin != 1.0 enforces a margin on the constraint: + I.e. p_plasma_separatrix_mw >= h_mode_threshold_margin * p_l_h_threshold_mw - For example, fl_h_threshold = 0.8 will ensure that p_plasma_separatrix_mw - is at least 25% above the threshold (in H-mode). + For example, h_mode_threshold_margin = 1.2 gives a 20% margin and will ensure that + p_plasma_separatrix_mw is at least 1.2*p_l_h_threshold_mw (ie in H-mode). """ return ConstraintResult( 1.0 - - data_structure.constraint_variables.fl_h_threshold - * data_structure.physics_variables.p_plasma_separatrix_mw - / data_structure.physics_variables.p_l_h_threshold_mw, - data_structure.physics_variables.p_l_h_threshold_mw, - data_structure.physics_variables.p_l_h_threshold_mw - data_structure.physics_variables.p_plasma_separatrix_mw - / data_structure.constraint_variables.fl_h_threshold, + / ( + data_structure.physics_variables.p_l_h_threshold_mw + * data_structure.constraint_variables.h_mode_threshold_margin + ), + data_structure.physics_variables.p_l_h_threshold_mw, + data_structure.constraint_variables.h_mode_threshold_margin + * data_structure.physics_variables.p_l_h_threshold_mw + - data_structure.physics_variables.p_plasma_separatrix_mw, ) @@ -741,25 +743,25 @@ def constraint_equation_22(): """Equation for L-H power threshold limit to enforce L-mode author: P B Lloyd, CCFE, Culham Science Centre - fl_h_threshold: a margin on the constraint + l_mode_threshold_margin: a margin on the constraint p_l_h_threshold_mw: L-H mode power threshold (MW) p_plasma_separatrix_mw: power to conducted to the divertor region (MW) - Setting fl_h_threshold != 1.0 enforces a margin on the constraint: - I.e. fl_h_threshold * p_l_h_threshold_mw >= p_plasma_separatrix_mw + Setting l_mode_threshold_margin != 1.0 enforces a margin on the constraint: + I.e. l_mode_threshold_margin * p_l_h_threshold_mw >= p_plasma_separatrix_mw - For example, fl_h_threshold = 1.2 will ensure that p_plasma_separatrix_mw - is at least 20% below the threshold (in L-mode). + For example, l_mode_threshold_margin = 0.8 gives at 20% margin and will ensure that + p_plasma_separatrix_mw can never be more than 0.8*p_l_h_threshold_mw (ie in L-mode). """ return ConstraintResult( 1.0 - - data_structure.constraint_variables.fl_h_threshold + - data_structure.constraint_variables.l_mode_threshold_margin * data_structure.physics_variables.p_l_h_threshold_mw / data_structure.physics_variables.p_plasma_separatrix_mw, data_structure.physics_variables.p_plasma_separatrix_mw, data_structure.physics_variables.p_plasma_separatrix_mw - data_structure.physics_variables.p_l_h_threshold_mw - / data_structure.constraint_variables.fl_h_threshold, + / data_structure.constraint_variables.l_mode_threshold_margin, ) diff --git a/process/data_structure/constraint_variables.py b/process/data_structure/constraint_variables.py index e20350f1d2..3cb9c842a1 100644 --- a/process/data_structure/constraint_variables.py +++ b/process/data_structure/constraint_variables.py @@ -116,10 +116,16 @@ zeff_max: float = None """maximum value for Zeff (`constraint equation 64`)""" -fl_h_threshold: float = None +h_mode_threshold_margin: float = None +"""Sets the constraint bound of the L-H power threshold limit for H-mode + +I.e. p_plasma_separatrix_mw / p_l_h_threshold_mw >= h_mode_threshold_margin +""" + +l_mode_threshold_margin: float = None """Sets the constraint bound of the L-H power threshold limit. -I.e. fl_h_threshold >= p_l_h_threshold_mw / p_plasma_separatrix_mw +I.e. l_mode_threshold_margin >= p_plasma_separatrix_mw / p_l_h_threshold_mw """ @@ -156,7 +162,8 @@ def init_constraint_variables(): global pflux_fw_neutron_max_mw global f_alpha_energy_confinement_min global zeff_max - global fl_h_threshold + global l_mode_threshold_margin + global h_mode_threshold_margin p_hcd_injected_min_mw = 0.1 beta_poloidal_max = 0.19 @@ -189,4 +196,5 @@ def init_constraint_variables(): pflux_fw_neutron_max_mw = 1.0 f_alpha_energy_confinement_min = 5.0 zeff_max = 3.6 - fl_h_threshold = 1.0 + l_mode_threshold_margin = 1.0 + h_mode_threshold_margin = 1.0 diff --git a/process/data_structure/numerics.py b/process/data_structure/numerics.py index c56803409e..653450d53c 100644 --- a/process/data_structure/numerics.py +++ b/process/data_structure/numerics.py @@ -258,7 +258,7 @@ * (100) NOT USED * (101) NOT USED * (102) f_nd_impurity_electronsvar # OBSOLETE -* (103) fl_h_threshold (f-value for equation 15) +* (103) NOT USED * (108) breeder_f: Volume of Li4SiO4 / (Volume of Be12Ti + Li4SiO4) * (109) f_nd_alpha_electron: thermal alpha density / electron density * (114) len_fw_channel: Length of a single first wall channel diff --git a/process/input.py b/process/input.py index 11e2c22a0b..340de3554d 100644 --- a/process/input.py +++ b/process/input.py @@ -785,7 +785,10 @@ 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)), - "fl_h_threshold": InputVariable( + "h_mode_threshold_margin": InputVariable( + data_structure.constraint_variables, float, range=(0.001, 1000000.0) + ), + "l_mode_threshold_margin": InputVariable( data_structure.constraint_variables, float, range=(0.001, 1000000.0) ), "flirad": InputVariable(data_structure.ife_variables, float, range=(0.0, 10.0)), diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index 5ea2c745ae..6c7d400161 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -192,7 +192,6 @@ "jbus": "j_tf_bus", "fcoolleg": "f_a_tf_cooil_outboard", "rhotfbus": "rho_tf_bus", - "flhthresh": "fl_h_threshold", "ilhthresh": "i_l_h_threshold", "rli": "ind_plasma_internal_norm", "gamma": "ejima_coeff", @@ -440,12 +439,17 @@ "t_precharge": "t_plant_pulse_coil_precharge", "t_burn": "t_plant_pulse_burn", "tfootfi": "f_dr_tf_outboard_inboard", + "fl_h_threshold": None, } OBS_VARS_HELP = { "iculdl": "(use IDENSL=3 for equivalent model to ICULDL=0). ", "dz_blkt_upper": "WARNING. BLNKTTH is now always calculated rather than input - please remove it from the input file. ", "iprofile": "Use i_beta_norm_max, i_alphaj and i_ind_plasma_internal_norm instead. See docs for setup. ", + "fl_h_threshold": ( + "fl_h_threshold has been replaced by h_mode_threshold_margin/l_mode_threshold_margin" + " please check the docstring for constraint 15/22 to find the appropriate variable" + ), } kallenbach_list = [ diff --git a/process/physics.py b/process/physics.py index d983159135..ee1473d2e4 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2883,7 +2883,8 @@ def physics(self): # calculate separatrix temperature, if Reinke criterion is used physics_variables.temp_plasma_separatrix_kev = reinke_tsep( physics_variables.b_plasma_toroidal_on_axis, - constraint_variables.fl_h_threshold, + physics_variables.p_plasma_separatrix_mw + / physics_variables.p_l_h_threshold_mw, physics_variables.q95, physics_variables.rmajor, physics_variables.eps, From a4002123708123800d83289c607e30e03e068911 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Tue, 16 Dec 2025 09:24:37 +0000 Subject: [PATCH 17/17] Correct constraint 22 --- documentation/physics-models/plasma_h_mode.md | 6 +++--- process/constraints.py | 17 +++++++++-------- process/data_structure/constraint_variables.py | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/documentation/physics-models/plasma_h_mode.md b/documentation/physics-models/plasma_h_mode.md index ab00ea53d6..1e36d770d4 100644 --- a/documentation/physics-models/plasma_h_mode.md +++ b/documentation/physics-models/plasma_h_mode.md @@ -25,7 +25,7 @@ There are two separate constraint equations for enforcing the L-H threshold. There are two constraints that can be used to enforce L-mode or H-mode. -Constraint 15 (`icc = 15`) is used to enforce H-mode by mandating that the plasma at the separatrix is greater than or equal to the L-H threshold power, a necessary condition for H-mode. `h_mode_threshold_margin >= 1.0` can be used to ensure the separatrix power exceeds the threshold by some margin. +Constraint 15 (`icc = 15`) is used to enforce H-mode by mandating that the power transported through the separatrix is greater than or equal to the L-H threshold power, a necessary condition for H-mode. `h_mode_threshold_margin >= 1.0` can be used to ensure the separatrix power exceeds the threshold by some margin. $$ \mathtt{p\_plasma\_separatrix\_mw} \ge \mathtt{h\_mode\_threshold\_margin} \times \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} @@ -34,10 +34,10 @@ $$ For example, `h_mode_threshold_margin = 1.2` ensures that `p_plasma_separatrix_mw` is at least $1.2\times$ greater than the threshold power `p_l_h_threshold_mw`. -Constraint 22 (`icc = 22`) is the opposite of constraint 15 and ensures that the power reaching the divertor is less than or equal to the L-H threshold power. `l_mode_threshold_margin >= 1.0` can be used to ensure that the threshold power is greater than the separatrix power by some margin. +Constraint 22 (`icc = 22`) is the opposite of constraint 15 and ensures that the power transported through the separatrix is less than or equal to the L-H threshold power. `l_mode_threshold_margin >= 1.0` can be used to ensure that the threshold power is greater than the separatrix power by some margin. $$ -\mathtt{l\_mode\_threshold\_margin} \times \underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} \ge \mathtt{p\_plasma\_separatrix\_mw} +\underbrace{\mathtt{p\_l\_h\_threshold\_mw}}_{\text{Power from scaling}} \ge \mathtt{l\_mode\_threshold\_margin} \times \mathtt{p\_plasma\_separatrix\_mw} $$ For example, `l_mode_threshold_margin = 1.2` ensures that `p_l_h_threshold_mw` is at least $1.2\times$ greater than the separatrix power `p_plasma_separatrix_mw`. diff --git a/process/constraints.py b/process/constraints.py index a50a56747c..ab298b0882 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -584,7 +584,7 @@ def constraint_equation_15(): Setting h_mode_threshold_margin != 1.0 enforces a margin on the constraint: I.e. p_plasma_separatrix_mw >= h_mode_threshold_margin * p_l_h_threshold_mw - For example, h_mode_threshold_margin = 1.2 gives a 20% margin and will ensure that + For example, h_mode_threshold_margin = 1.2 will ensure that p_plasma_separatrix_mw is at least 1.2*p_l_h_threshold_mw (ie in H-mode). """ return ConstraintResult( @@ -741,23 +741,24 @@ def constraint_equation_21(): @ConstraintManager.register_constraint(22, "MW", ">=") def constraint_equation_22(): """Equation for L-H power threshold limit to enforce L-mode - author: P B Lloyd, CCFE, Culham Science Centre l_mode_threshold_margin: a margin on the constraint p_l_h_threshold_mw: L-H mode power threshold (MW) p_plasma_separatrix_mw: power to conducted to the divertor region (MW) Setting l_mode_threshold_margin != 1.0 enforces a margin on the constraint: - I.e. l_mode_threshold_margin * p_l_h_threshold_mw >= p_plasma_separatrix_mw + I.e. p_l_h_threshold_mw >= l_mode_threshold_margin * p_plasma_separatrix_mw - For example, l_mode_threshold_margin = 0.8 gives at 20% margin and will ensure that - p_plasma_separatrix_mw can never be more than 0.8*p_l_h_threshold_mw (ie in L-mode). + For example, l_mode_threshold_margin = 1.2 will ensure that + p_l_h_threshold_mw is at least 1.2*p_plasma_separatrix_mw (ie in L-mode). """ return ConstraintResult( 1.0 - - data_structure.constraint_variables.l_mode_threshold_margin - * data_structure.physics_variables.p_l_h_threshold_mw - / data_structure.physics_variables.p_plasma_separatrix_mw, + - data_structure.physics_variables.p_l_h_threshold_mw + / ( + data_structure.constraint_variables.l_mode_threshold_margin + * data_structure.physics_variables.p_plasma_separatrix_mw + ), data_structure.physics_variables.p_plasma_separatrix_mw, data_structure.physics_variables.p_plasma_separatrix_mw - data_structure.physics_variables.p_l_h_threshold_mw diff --git a/process/data_structure/constraint_variables.py b/process/data_structure/constraint_variables.py index 3cb9c842a1..038f24f469 100644 --- a/process/data_structure/constraint_variables.py +++ b/process/data_structure/constraint_variables.py @@ -125,7 +125,7 @@ l_mode_threshold_margin: float = None """Sets the constraint bound of the L-H power threshold limit. -I.e. l_mode_threshold_margin >= p_plasma_separatrix_mw / p_l_h_threshold_mw +I.e. p_l_h_threshold_mw / p_plasma_separatrix_mw >= l_mode_threshold_margin """