PlasmaControl / DESC

Stellarator Equilibrium and Optimization Suite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Misleading comment in code and documentation

acerfon opened this issue · comments

If I understand correctly, in DESC equilibria, the variable alpha is the field line label. In other words, alpha is constant along a field line. This can be viewed mathematically from the expression B = grad\psi \cross \grad\alpha, which implies B \cdot \grad\alpha = 0.

In that context, one should not say, as is currently the case in the documentation and the comment in the code, that grad alpha is the unit vector along field line. grad alpha is perpendicular to field lines.

Thanks for catching this Antoine!

Thanks for catching this Antoine!

While I am at it, I am also confused about why you use such a complicated formula for computing the magnetic field line curvature kappa. I have not verified your formula yet, but why did you not want to use the simpler, standard formula b \cdot \nabla b ?

grad b is a higher dimensional object, so I think computing it with b dot grad b would require more memory.

The formula can be verified using the second Vector-dot-Del Operator identity , noting nabla|b|^2 = 0, and applying the second curl identity. both forms are given in https://iopscience.iop.org/article/10.1088/0034-4885/77/8/087001 page 6 .

grad b is a higher dimensional object, so I think computing it with b dot grad b would require more memory.

The formula can be verified using the second Vector-dot-Del Operator identity , noting nabla|b|^2 = 0, and applying the second curl identity. both forms are given in https://iopscience.iop.org/article/10.1088/0034-4885/77/8/087001 page 6 .

If you care about the dimensionality of the object, then I would still implement a simpler version than you currently have for kappa: kappa = -b\cross(\curl b)