You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should implement methods to initialize SPEC with a VMEC equilibrium. Zhisong has a Matlab script. I guess we can mimic a python one and one step further, we can link SPEC with LIBSTELL so it can initialize from VMEC itself (put a preprocess flag #ifdef LIBSTELL to make this optional).
Some useful notes from Stuart.
In trying to obtain similar equilibria from SPEC and VMEC, we can match the boundary, toroidal flux, and iota at the volume interfaces in SPEC. Any suggestions on the values to use for mu, helicity and pflux? I know these values will change as it works towards a solution but having a good initial guess would be useful.
The easiest way to get SPEC inputs that match a given VMEC equilibrium is to take the rotational transform profile as the input profile. If I recall, this is achieved by using Lconstraint=1. Just choose a value for Nvol, then choose the toroidal flux values and then take the rotational transform from the VMEC output. In this case, the values of mu and helicity are not really required as inputs. When I say "not really", a reasonable initial guess for mu and pflux are required but only as initial guesses. SPEC will iterate on mu and pflux until the correct value for the rotational transform is obtained. Keep in mind that it is required to specify both \iota and \oita for the rotational transform, which are the rotational transform on the immediate inside and the immediate outside of the interfaces. Usually, we might require that the rotational transform is continuous across the interfaces, so \oita = \iota, but generally SPEC can accommodate discontinuous rotational transform profiles. Usually I would just guess some values for mu and pflux, but I imagine that we could use the relation \iota = d pflux / d tflux, which is true for ideal equilibria with nested surfaces to provide a good guess. Also, mu is related to the parallel current, which I imagine could be extracted from the VMEC output. (I am sorry, but I don't know what units are used in VMEC, and I am kind of ashamed to say that I don't know what units are being used in SPEC.)
Another approach may be to distribute the VMEC equilibrium that you want to compare to SPEC. If you send the VMEC input to all those on this email, perhaps someone might prepare the input for you :-) I haven't run SPEC or VMEC for some time, but I am trying to get back into these calculations, and now is as good a time as any for me to dust off my old routines for doing this . . .
The text was updated successfully, but these errors were encountered:
@zhisong Do you still have access to this script, if you do; could you upload it here for someone to continue on?
@zhucaoxiang: I think we should keep it minimal and focus on the python script first.
The matlab script is probably the easiest to convert. It should live in py_spec.input.SPECnamelist.fromVMEC()
(which itself could be updated so calling it empty returns a circular cross section 1 volume vacuum case, and classmethods to initialize from_input_file() and from_SPECout(). Is this a good idea or would it break existing scripts and be an annoyance?)
I'll get on it if I have the matlab script (and probably after simons' Australia retreat)
We should implement methods to initialize SPEC with a VMEC equilibrium. Zhisong has a Matlab script. I guess we can mimic a python one and one step further, we can link SPEC with LIBSTELL so it can initialize from VMEC itself (put a preprocess flag
#ifdef LIBSTELL
to make this optional).Some useful notes from Stuart.
The text was updated successfully, but these errors were encountered: