-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BEAMS3D/FIELDLINES: Bug (and solution) for failures of inverse lookup. #354
Comments
This is an occasional issue with the inverse lookup. It looks to be an issue with the lookup in the region where theta transitions from 2*pi to zero. If you upload a fixed boundary input file it can be debugged. |
The So clearly points inside the equilbrium are failing the lookup. These points do return a value for |
If I set I'm hesitant to make the change in the code official, but I think it's worth noting this issue. I would suggest that @kudav you modify your sources (line 56 of |
@kudav Let us know the outcome. The issue is related to the inverse lookup so both runs with VMEC+VC and the |
I'm going to run a scan of the parameter to see what makes the most sense. This is a tollerance on the square of the error for the coordinate inversion. So 1E-6 may roughly translate to 1 mm which is a bit too lax for my tolerance. If 1E-8 or 1E-10 works as well then I'll set the parameter to that and push a new branch. |
The discontinuity at the edge is real, at least from the theoretical standpoint. VMEC assumes a surface current at the boundary which guaruntees that it is a flux surface. Essentially this surface current is the representation of the external magnetic field which gives rise to the vacuum component of the field inside the equilbrium. Such an effect is a natural outcome of the VMEC model. One could argue that a free boundary VMEC equilibrium at zero beta which exactly matches a flux surface would have no such feature. The little point in the lower left of the equilbrium is a bit worrying. |
Running BEAMS3D with AUG equilbria from VMEC (with ns=512, ftol_end=1e-19) produces wrong fields on some individual grid points. This extends to the BR, BZ and U values, but sometimes also to BPHI and S. Ive tried both with and without -plasma with essentially the same results. Changing the grid resolution changes where these grid points occur.

The black dots in the left panel show the R and Z locations of the VMEC grid, the right panel the differnce of the U_ARR variable in the R direction to clearly show the 0 values. Here, nr=301, nz=501.
There were some changes to the functions in vmec_utils in the last year or so, which get perform the inverse lookups to construct the cylindrical grid. Is it possible that these introduced bugs?
The text was updated successfully, but these errors were encountered: