API Reference
QED
QED.diffuse — Function
diffuse(QI::QED_state, η, tmax::Real, Nt::Integer;
θimp::Real=0.5,
Vedge::Union{Nothing,Real}=nothing, Ip::Union{Nothing,Real}=nothing,
debug::Bool=false, Np::Union{Nothing,Integer}=nothing)Diffuse rotational transform in QED_state QI with resistivity η for tmax seconds in Nt One of Vedge or Ip should be set Keyword arguments θimp - 0 is fully explicit, 1 is fully implicity, 0.5 (default) gives second-order time accuracy Vedge - edge loop voltage boundary condition (in Volts) Ip - total plasma current boundary condition (in Amps) debug - plot intermediate rotational-transform profiles Np - if debug is true, number of time steps between plots of rotational transform
QED.evolve — Function
evolve(QI::QED_state, η, build::QED_build, tmax::Real, Nt::Integer;
θimp::Real=0.5,
debug::Bool=false, Np::Union{Nothing,Integer}=nothing)Evolve rotational transform in QED_state QI with resistivity η and surrounding structures build for tmax seconds in Nt Keyword arguments θimp - 0 is fully explicit, 1 is fully implicity, 0.5 (default) gives second-order time accuracy debug - plot intermediate rotational-transform profiles Np - if debug is true, number of time steps between plots of rotational transform
QED.from_imas — Function
from_imas(filename::String, timeslice=1)Initialize the QED data structure from a JSON filename in IMAS format at requested timeslice
from_imas(data::Dict, timeslice=1)Initialize the QED data structure from a dictionary data in IMAS format at requested timeslice
QED.initialize — Function
initialize(rho_tor::AbstractVector{<:Real},
B₀::Real,
gm1::AbstractVector{<:Real},
f::AbstractVector{<:Real},
dvolume_drho_tor::AbstractVector{<:Real},
q::AbstractVector{<:Real},
j_tor::AbstractVector{<:Real},
gm9::AbstractVector{<:Real};
ρ_j_non_inductive::Union{Nothing,Tuple{<:AbstractVector{<:Real},<:AbstractVector{<:Real}}}=nothing,
ρ_grid::Union{Nothing,AbstractVector{<:Real}}=nothing)Initialize the QED data structure with data typically taken from an IMAS-like data structure, e.g.,
eqt = data["equilibrium"]["time_slice"][timeslice]
rho_tor = eqt["profiles_1d"]["rho_tor"]
B₀ = data["equilibrium"]["vacuum_toroidal_field"]["b0"][timeslice]
gm1 = eqt["profiles_1d"]["gm1"]
f = eqt["profiles_1d"]["f"]
dvolume_drho_tor = eqt["profiles_1d"]["dvolume_drho_tor"]
q = eqt["profiles_1d"]["q"]
j_tor = eqt["profiles_1d"]["j_tor"]
gm9 = eqt["profiles_1d"]["gm9"]Keyword arguments: ρ_j_non_inductive - a tuple giving a grid and the noninductive current e.g., ρ_j_non_inductive = (prof1d["grid"]["rho_tor_norm"], prof1d["j_non_inductive"]) ρ_grid - The grid for QED to operate on. By default, it uses normalized rho_tor
QED.steady_state — Function
steady_state(QI::QED_state, η; debug::Bool=false,
Vedge::Union{Nothing,Real}=nothing, Ip::Union{Nothing,Real}=nothing)Compute steady-state rotational transform for QED_state QI with resistivity η One of Vedge or Ip should be set Keyword arguments Vedge - edge loop voltage boundary condition (in Volts) Ip - total plasma current boundary condition (in Amps) debug - plot rotational-transform profiles
QED.η_imas — Function
η_imas(filename::String, timeslice::Integer=1; use_log::Bool=true)Return an interpolation of the resistivity from an IMAS-like JSON file filename at timeslice use_log=true (default) interpolates on the log of the resistivity
η_imas(data::Dict, timeslice::Integer=1; use_log::Bool=true)Return an interpolation of the resistivity from an IMAS-like dictionary data at timeslice use_log=true (default) interpolates on the log of the resistivity
QED.η_mock — Function
η_mock(; T0::Real=3000.0, Tp::Real=500.0, Ts::Real=100.0)Return a function of a mock resistivity profile with temperatures T0 (core), Tp (pedestal), and Ts (separatrix)