hiddenSymmetries / simsopt

Simons Stellarator Optimizer Code
https://simsopt.readthedocs.io
MIT License
83 stars 43 forks source link

Creating MagneticField object from VMEC file #394

Closed rmchurch closed 4 months ago

rmchurch commented 4 months ago

Maybe a basic question, is there a way to create a MagneticField object from a Vmec object? I know I can use vmec_compute_geometry to get the magnetic field on the interior, but I'm unclear on how to add to a vacuum field from a Biot-Savart calculation.

landreman commented 4 months ago

Are you sure you want to add an MHD equilibrium field to a vacuum/Biot-Savart field? B in an MHD equilibrium is the total field, already including the Biot-Savart field from external coils. The sum of B from an equilibrium plus another B from Biot-Savart is generally not an equilibrium and so not really meaningful.

Could you say more about what your overall goal is?

On the narrow question of creating a MagneticField object from a Vmec object, I don't believe there is a way to do this now. If you or someone else would like to contribute this, go for it!

rmchurch commented 4 months ago

Now I am sure I don't want to do that (Stuart H. set me straight). The impetus to the question was I had a coil set and a VMEC output given to me that were supposed to be together. I tried a Poincare plot using the vacuum field from Biot-Savart, but it didn't have any flux surfaces (field lines quickly left the boundary). I wanted to check including plasma-response, since this was QA with appreciable current. But I understand now my error in thought.

The overall problem is whether these coils really are optimized for this configuration, but I can check that. Thanks.