Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions documentation/physics-models/plasma_h_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

-------

Expand Down
38 changes: 20 additions & 18 deletions process/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand Down Expand Up @@ -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,
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code really is a cumbersome way to write a simple equation.
It would be easier to read if each of the return quantities had a name.
The code is fine but I think you may need to rename the margin. l_mode_threshold_margin is a fraction, not a margin. If l_mode_threshold_margin = 0.8 then the margin is 20%.


Expand Down
16 changes: 12 additions & 4 deletions process/data_structure/constraint_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""


Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion process/data_structure/numerics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion process/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
6 changes: 5 additions & 1 deletion process/io/obsolete_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 = [
Expand Down
3 changes: 2 additions & 1 deletion process/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading