Open unalmis opened 4 months ago
A few comments:
That's a good idea, thanks Rory. I've been doing some reading form Boyd's spectral book and thinking for the optimal method to compute these quantities over the last week. my plan is a little different than your suggestion, mainly ~because we can do this (epsilon effective) directly in DESC coordinates~. Much of the logic from PR #854 will be reused, with smarter interpolation methods.
Basically make effective ripple /gamma c type optimization faster/more memory efficient.
some thoughts: To evaluate a quantity along a field line, one can generate a grid in the Clebsh-Type field line coordinate system $\rho, \alpha, \zeta$, then vary $\zeta$ at fixed $\rho, \alpha$. We can then transform into the DESC computational coordinates to evaluate Recall $\alpha$ is multivalued in this coordinate system; after a toroidal transit, the field line is still specified by $\alpha$, but unless it closes on itself, it is at a different physical poloidal coordinate. It would be useful to have a utility that maps a field line onto a rectangular grid, cutting the field line after each toroidal transit.
Applications
1. bounce integration/ neoclassical stuff
Currently, we generate one-dimensional splines of βπ΅β along field lines. In stellarators, there can be fine ripples in βπ΅β(π) which are only captured by splines at high knot density. Here fine ripple means the distance between bounce points is small compared to the number of toroidal transits. We are integrating over a large domain π β πΌ β β with more accurate surface averages obtained as πΌ β β. In that limit, it becomes infeasible to maintain the knot density required to capture all ripples, as the total number of required knots grows with |πΌ|. Since the field line wraps around a surface, the knots that support reconstruction of βπ΅β at small π should also support βπ΅β at large π. Indeed, this is the job of a 2D spline in $\alpha, \zeta$, and switching to such an interpolation will detach the required number of knots from the length of the field line integration.
Note that we donβt want a 3D spline; quantities that rely on bounce integrals to compute usually reduce to flux surface functions. An optimization will involve selecting a finite number of flux surfaces over which to optimize the quantity. Unless the radial resolution is also high, a 3D spline would hinder reconstruction of βπ΅β over a surface.
Implementation suggestions:
interpax
to compute a 2D spline of βπ΅β($\alpha$, π). For a fixed $\alpha$, the roots of this spline can be computed analytically, in the same manner currently implemented onbounce
branch. For bounce points across the "branch" cut at $\zeta = 2 \pi$, treat the boundary $\zeta = 2\pi$ as a right bounce point for all field lines in $A_1$ and $\zeta = 0$ as the left bounce point for all field lines in $A_2$. This is fine because our integration technique works fine for singular and non-singular integrals.Might need to stagger the knots in $\zeta$ across $\alpha$ to save memory. So if the $\alpha = 0$ field line has knots at every 1/10 increment in $\zeta$ then the $\alpha = 0 + \Delta \alpha $ field line should have knots shifted by some amount to lie in between the knots of the other field line.