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

IMAS.find_strike_points! not working properly #200

Open
ggdose opened this issue Sep 23, 2024 · 1 comment
Open

IMAS.find_strike_points! not working properly #200

ggdose opened this issue Sep 23, 2024 · 1 comment
Assignees

Comments

@ggdose
Copy link
Contributor

ggdose commented Sep 23, 2024

the function in sol.jl find_strike_points!(args...; kw...) is not returning correctly the strike points.
Sometimes it returns only one strike point:
image
Some other times it does not find any of the strike points:
image

Probably the issue is with using the new flux_surface(args...; kw...) which now returns the flux surfaces inside the wall. If the following lines:

IMAS.jl/src/physics/sol.jl

Lines 930 to 934 in eeda6b5

if private_flux_regions
sep = flux_surface(eqt, psi_first_open, :any, wall_r, wall_z)
else
sep = flux_surface(eqt, psi_first_open, :open, wall_r, wall_z)
end

Become:

IMAS.jl/src/physics/sol.jl

Lines 930 to 934 in 283cd78

if private_flux_regions
sep = flux_surface(eqt, psi_first_open, :any, Float64[], Float64[])
else
sep = flux_surface(eqt, psi_first_open, :open, Float64[], Float64[])
end

The issue seems to be solved:
image
image

Probably the function wanted the flux surface to extend also in the volume outside the FW.

@ggdose
Copy link
Contributor Author

ggdose commented Sep 23, 2024

Quick routine to check quickly (1m30s) for all cases if find_strike_points! is working:

FUSE.logging(Logging.Info; actors=Logging.LogLevel(1));
for (testname, (args, kw)) in FUSE.test_cases
ini, act = FUSE.case_parameters(args...; kw...)
dd = IMAS.dd()
FUSE.init(dd, ini, act)
plot(dd.wall, lw =1)
fwr = IMAS.first_wall(dd.wall).r
fwz = IMAS.first_wall(dd.wall).z
psi_sep = IMAS.find_psi_boundary(dd.equilibrium.time_slice[],fwr,fwz).first_open
surface = IMAS.flux_surface(dd.equilibrium.time_slice[], psi_sep, :encircling,Float64[],Float64[])
plot!(surface, label = "first open", c = :black, lw = 2)
for (k,point) in enumerate(dd.equilibrium.time_slice[].boundary.strike_point)
plot!((point.r,point.z), st = :scatter, c = :black, markershape = :x, label = "strike point $k")
end
display(plot!(title = "== $(testname) =="))
display(dd.equilibrium.time_slice[].boundary.strike_point)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants