Skip to content

Commit

Permalink
j_ohmic_steady_state takes in j_ohmic_shape
Browse files Browse the repository at this point in the history
  • Loading branch information
orso82 committed Dec 12, 2024
1 parent 259f74c commit a3ff98e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/physics/currents.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
document[Symbol("Physics currents")] = Symbol[]

"""
j_ohmic_steady_state(eqt::IMAS.equilibrium__time_slice{T}, cp1d::IMAS.core_profiles__profiles_1d{T}, ip::T) where {T<:Real}
j_ohmic_steady_state(eqt::IMAS.equilibrium__time_slice{T}, cp1d::IMAS.core_profiles__profiles_1d{T}, ip::T, j_ohmic_shape::AbstractVector{T}=cp1d.conductivity_parallel) where {T<:Real}
Sets `j_ohmic` parallel current density to what it would be at steady-state, based on parallel conductivity and `j_non_inductive` and a target ip
Sets `j_ohmic` parallel current density to what it would be at steady-state, based on `conductivity_parallel`, `j_non_inductive` and a target total `ip`
Requires constant loop voltage: `Vl = 2π * η * <J_oh⋅B> / (F * <R⁻²>) = constant`
"""
function j_ohmic_steady_state(eqt::IMAS.equilibrium__time_slice{T}, cp1d::IMAS.core_profiles__profiles_1d{T}, ip::T) where {T<:Real}
function j_ohmic_steady_state(eqt::IMAS.equilibrium__time_slice{T}, cp1d::IMAS.core_profiles__profiles_1d{T}, ip::T, j_ohmic_shape::AbstractVector{T}=cp1d.conductivity_parallel) where {T<:Real}
rho_tor_norm = cp1d.grid.rho_tor_norm
rho_eq = eqt.profiles_1d.rho_tor_norm
F = IMAS.interp1d(rho_eq, eqt.profiles_1d.f, :cubic).(rho_tor_norm)
gm1 = IMAS.interp1d(rho_eq, eqt.profiles_1d.gm1, :cubic).(rho_tor_norm) # <R⁻²>
j_oh_par_norm = cp1d.conductivity_parallel .* F .* gm1 # arbitrary normalized Joh,par = <Joh.B> / B0 (constant)
j_oh_par_norm = j_ohmic_shape .* F .* gm1 # arbitrary normalized Joh,par = <Joh.B> / B0 (constant)

j_non_inductive = cp1d.j_non_inductive

Expand Down

0 comments on commit a3ff98e

Please sign in to comment.