Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add keyword to assume input plasma boundary for calculation of psi0,beta #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/solovev.jl
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,14 @@ Keyword Arguments:\\
`diverted` - If true then equilibrium has one or more x-points\\
`x_point` - If diverted = true, then x_point is set to (R0*(1-1.1*δ*ϵ), -R0*1.1*κ*ϵ) else nothing\\
`symmetric` - Is equilibrium up-down symmetric\\
`assume_shape` - Assume the solved psi(r,z) contour has the same shape as the input shape.
"""
@memoize LRU(maxsize=cache_size) function solovev(B0, S::PlasmaShape{T}, α, qstar;
B0_dir = 1, Ip_dir = 1,
diverted::Bool = false,
x_point::Union{NTuple{2},Nothing} = (diverted ? scale_aspect(S,1.1)(3pi/2) : nothing),
symmetric::Bool = (x_point === nothing)) where T
symmetric::Bool = (x_point === nothing),
assume_shape::Bool = false) where T

R0 = major_radius(S)
Z0 = elevation(S)
Expand Down Expand Up @@ -529,11 +531,10 @@ Keyword Arguments:\\
x, y = (S(pi/2) .- (0,Z0))./R0
Ψ_p[12] = _solovev_psi_p_Dxx(x, y, α) + N₃*_solovev_psi_p_Dy(x, y, α)
Ψ_h[:,12] .= _solovev_polynomials_Dxx(x, y) .+ N₃*_solovev_polynomials_Dy(x, y)

c = SVector{12}(Ψ_h'\(-Ψ_p))
end

if !symmetric
if assume_shape
x,y = shape(S, N=100, normed=true)
bdry = PlasmaBoundary(collect(zip(x,y)))
else
Expand Down