API Reference
QED
QED.Ip
— FunctionIp(QI::QED_state)
Return the total plasma current for QED_state QI
QED.JB
— FunctionJB(QI::QED_state; ι=QI.ι, ρ::AbstractVector{<:Real}=QI.ρ)
For a given QED_state QI
, return <J⋅B> on grid ρ
with rotational transform ι
By default, use the grid and rotational transform in QI
itself
QED.Jt_R
— FunctionJt_R(QI::QED_state; ι::FE_rep=QI.ι, ρ::AbstractVector{<:Real}=QI.ρ)
For a given QED_state QI
, return <Jt/R> on grid ρ
with rotational transform ι
By default, use the grid and rotational transform in QI
itself
QED.diffuse
— Functiondiffuse(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
— Functionevolve(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
Missing docstring for evolve!
. Check Documenter's build log for details.
QED.from_imas
— Functionfrom_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
— Functioninitialize(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
— Functionsteady_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.η_FE
— Functionη_FE(rho::AbstractVector{<:Real}, η::AbstractVector{<:Real}; use_log::Bool=true)
Return a cubic-Hermite finite-element interpolation of the resistivity η
on grid rho
use_log=true
(default) interpolates on the log of the resistivity
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)