From a3ff98e8d5c664b6b438f13a087498bf3cee0aeb Mon Sep 17 00:00:00 2001 From: Orso Meneghini Date: Thu, 12 Dec 2024 01:50:30 -0800 Subject: [PATCH] j_ohmic_steady_state takes in j_ohmic_shape --- src/physics/currents.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/physics/currents.jl b/src/physics/currents.jl index d78500b0..50f75ec1 100644 --- a/src/physics/currents.jl +++ b/src/physics/currents.jl @@ -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π * η * / (F * ) = 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) # - j_oh_par_norm = cp1d.conductivity_parallel .* F .* gm1 # arbitrary normalized Joh,par = / B0 (constant) + j_oh_par_norm = j_ohmic_shape .* F .* gm1 # arbitrary normalized Joh,par = / B0 (constant) j_non_inductive = cp1d.j_non_inductive