DESC icon indicating copy to clipboard operation
DESC copied to clipboard

field line tracing opposite to the magnetic field direction.

Open rahulgaur104 opened this issue 8 months ago • 9 comments

I think it would be a simple but useful feature to add the ability to perform/plot poincare trace in a direction opposite to the magnetic field. This can help users better understand the fieldline structure outside the stellarator boundary.

With modular coils, can be easily achieved by reversing the coil current in all the coils. This would reverse the magnetic field without changing the flux surface shape.

rahulgaur104 avatar Apr 18 '25 03:04 rahulgaur104

@dpanici ftw!

"just use field_reversed = ScaleMagneticField(scale=-1.0, field)"

rahulgaur104 avatar Apr 21 '25 18:04 rahulgaur104

@dpanici add comment in documentation for the field line tracing integrate function to mention this

dpanici avatar Apr 28 '25 18:04 dpanici

can't this already be done by just giving phi = -phi?

f0uriest avatar Apr 28 '25 20:04 f0uriest

Depends on what you mean by that. How do you transform B_r, B_phi, B_z when phi - > -phi? Safer way is what Dario suggests. Also, I have tested it for modular coils.

rahulgaur104 avatar Apr 28 '25 20:04 rahulgaur104

its not transforming B at all? it's just literally tracing in the opposite direction. Phi is our time variable, so we run that backwards. Eg, starting at phi=0, going to phi=-pi

f0uriest avatar Apr 28 '25 20:04 f0uriest

The vector B_R, B_phi, B_z is pointing in one direction but you integrate in the opposite direction? So your dphi is -dphi. It's something to try.

rahulgaur104 avatar Apr 28 '25 20:04 rahulgaur104

i prefer that option, as it means phi=const planes are the same. If you flip B like you talked about I don't think that holds

f0uriest avatar Apr 28 '25 20:04 f0uriest

i prefer that option, as it means phi=const planes are the same. If you flip B like you talked about I don't think that holds

How does that work for multiple field periods? Does it guarantee phi = const. planes are the same?

rahulgaur104 avatar Apr 28 '25 20:04 rahulgaur104

yes, it doesn't care about field periods at all. What the poincare section looks like will depend on the choice of phi, as it does in the forward direction.

f0uriest avatar Apr 28 '25 20:04 f0uriest