ascot4fusion / ascot5

ASCOT5 is a high-performance orbit-following code for fusion plasma physics and engineering
https://ascot4fusion.github.io/ascot5/
GNU Lesser General Public License v3.0
31 stars 9 forks source link

Improved hybrid mode #117

Open miekkasarki opened 2 months ago

miekkasarki commented 2 months ago

Currently the hybrid mode works by switching from GC to GO at the moment when ENDCOND_MAX_RHO. The wall collision check now calculates the distance to the nearest wall element, so we can improve this scheme.

I suggest that in hybrid mode we check for close wall elements if any of those are within distance 1.1 R_larmor. If true, we switch to GO. The close elements are those which belong to any of the octree cells that are within distance 1.1 R_larmor from the guiding center position. Now the problem is in determining which cells fulfill this condition. I think the easiest way is to just include all cells where any of the points P, P+R_x, P-R_x, P+R_y, ... belong.