DESC icon indicating copy to clipboard operation
DESC copied to clipboard

Make plasma-surface distance calculations robust when using NFP

Open dpanici opened this issue 1 year ago • 3 comments

Currently, if we want to compute the PlasmaVesselDistance objective for two surfaces with NFP>1, and let's say the surface is such that for the point on the plasma surface at $(\theta=0, \zeta=0)$ the closest point on the winding surface is at $(\theta=0,\zeta=\epsilon$ where $\epsilon>0$ is some small number of radians. Then due to the symmetry, we can say that the closest point on the surface for the plasma point $(\theta=0, \zeta=2\pi/NFP)$ is on the surface at $(\theta=0, \zeta=2\pi/NFP+\epsilon)$, which is NOT included on the grids we by default use when both surfaces have NFP>1, resulting in instead a closest point which is not the true closest point.

To remedy this, we can calculate distance not by using cartesian distance formula (which we do now) but instead by calculating the cylindrical coordinates of each, and calculating the distance using some modding of the toroidal angle with $2\pi/NFP$ to account for this

dpanici avatar Sep 08 '23 17:09 dpanici