Skip to content

Commit

Permalink
Use properly computed Ip_non_inductive in ActorQED
Browse files Browse the repository at this point in the history
  • Loading branch information
bclyons12 committed Sep 24, 2024
1 parent 72094db commit 929db27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/actors/current/qed_actor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ function _step(actor::ActorQED)
cp1d = dd.core_profiles.profiles_1d[]

# non_inductive contribution
Ip_non_inductive = trapz(cp1d.grid.area, cp1d.j_non_inductive)
B0 = eqt.global_quantities.vacuum_toroidal_field.b0
JBni = QED.FE(cp1d.grid.rho_tor_norm, cp1d.j_non_inductive .* B0)

Expand Down Expand Up @@ -93,6 +92,7 @@ function _step(actor::ActorQED)
for time0 in range(t0 + δt / 2.0, t1 + δt / 2.0, No + 1)[1:end-1]
if par.solve_for == :ip
Ip = IMAS.get_from(dd, Val{:ip}, par.ip_from; time0)
Ip_non_inductive = dd.core_profiles.global_quantities.current_non_inductive[time0]

This comment has been minimized.

Copy link
@orso82

orso82 Sep 24, 2024

Member

this is actually quite inefficient since the expression needs to evaluate for all times slices in core profiles. I rather we define a new function for these current evaluations and we use it both in the expression as well as in QED

Vedge = nothing
if par.allow_floating_plasma_current && abs(Ip) < abs(Ip_non_inductive)
Ip = nothing
Expand All @@ -109,6 +109,7 @@ function _step(actor::ActorQED)
# steady state solution
if par.solve_for == :ip
Ip = IMAS.get_from(dd, Val{:ip}, par.ip_from)
Ip_non_inductive = dd.core_profiles.global_quantities.current_non_inductive[]
Vedge = nothing
if par.allow_floating_plasma_current && abs(Ip) < abs(Ip_non_inductive)
Ip = nothing
Expand Down

0 comments on commit 929db27

Please sign in to comment.