Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/L_to_H_transition' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
orso82 committed Feb 6, 2025
2 parents e586640 + c258969 commit d3acf17
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/physics/profiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,15 @@ end
push!(document[Symbol("Physics profiles")], :L_H_threshold)

"""
satisfies_h_mode_conditions(dd::IMAS.dd)
satisfies_h_mode_conditions(dd::IMAS.dd; threshold_multiple::Float64=1.0)
Returns `true` if the plasma is diverted, has positive triangularity, and `Psol>Plh`
Returns `true` if the plasma is diverted, has positive triangularity, and `Psol > Plh * threshold_multiple`
"""
function satisfies_h_mode_conditions(dd::IMAS.dd)
function satisfies_h_mode_conditions(dd::IMAS.dd; threshold_multiple::Float64=1.0)
eqt = dd.equilibrium.time_slice[]
diverted = length(eqt.boundary.x_point) > 0
Psol_gt_Plh = IMAS.L_H_threshold(dd) > getproperty(dd.requirements, :lh_power_threshold_fraction, 1.0)
LH_transition_fraction = getproperty(dd.requirements, :lh_power_threshold_fraction, 1.0)
Psol_gt_Plh = IMAS.L_H_threshold(dd) > LH_transition_fraction * threshold_multiple
positive_triangularity = eqt.boundary.triangularity > 0.0
if Psol_gt_Plh && diverted && positive_triangularity
return true
Expand Down

0 comments on commit d3acf17

Please sign in to comment.