DESC
DESC copied to clipboard
How to compute quantities along a fieldline
There have been several applications recently that need data from the equilibrium evaluated along a fieldline (stability stuff from @rahulgaur104 , GX stuff from @pkim1818, gamma_c from @JaxCrocker)
Right now this isn't super easy to do so we have some hacky stuff for it, but it would be good to decide on a common API for this.
One possibility:
- add an attribute to each
Gridlabelling what coordinates its using,rtzfor regular DESC computational coordinates,razfor rho, alpha, zeta etc. - When calling
desc.compute.computewe check the grid type and do any coordinate mapping to computational coordinates there. - quantities that use field aligned grids would need some logic in their individual compute functions to handle multiple fieldlines (ie multiple values of rho, alpha)
Issues:
- the low level
desc.compute.computecurrently expects pre-built transforms and profiles. If we're doing grid mapping inside that function we would need to add an option to just pass in the grid and build transforms from that and the equilibrium - for grids based on alpha we would need to know iota to map it to computational coordinates which adds an extra layer of complication for fixed current equilibria
Any other thoughts? @ddudt @dpanici @unalmis
Source grid, eval grid, single one for each computeable, by default are the same (so i.e call compute twice if want things on same src but different eval grids, one in normal coords other in SFL along field line)
utilities covering common cases i.e. rtz -> raz and having routine to map back on field period etc.
also related: https://github.com/PlasmaControl/DESC/pull/1006#issuecomment-2091007113