Let the vacuum potential's Fourier cutoffs exceed the plasma's - #833
Open
CharlesCNorton wants to merge 2 commits into
Open
Let the vacuum potential's Fourier cutoffs exceed the plasma's#833CharlesCNorton wants to merge 2 commits into
CharlesCNorton wants to merge 2 commits into
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Contributor
Author
|
fixing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change -
VmecInput.vacuum_mpolandVmecInput.vacuum_ntorset the Fourier cutoffs of NESTOR's scalar potential independently of the plasma'smpolandntor, which they default to. The potential and the vacuum field keep the plasma's tangential grid; the boundary is zero-padded into the larger layout,nzetahas to carry the toroidal cutoff, andpotvacis written at the potential's own size.Cause - Fortran VMEC expands the vacuum potential to
mf = mpol + 1,nf = ntor, so the vacuum solution is truncated at the plasma's resolution. On the cth boundary that truncation, not the singular quadrature, is the floor #628 discusses: an exact exterior Neumann problem (a line of dipoles inside the surface, whose total field on it is zero) gives a residual of 5.3e-3 relative to the external field withntor = 4for the potential at anympolup to 32 and any grid up tontheta = 160,nzeta = 288, and 4.8e-4 with the potential atntor = 8. Against BIEST at twelve digits on the real cth vacuum field, NESTOR's rms error atmpol = 16is 1.42e-3 withntor = 4, 3.5e-4 at 6, 9.9e-5 at 8 and 7.3e-5 at 12.Evidence - in the loop on
cth_like_free_bdyatftol = 1e-11the change moves the boundary by tens of micrometres at its 0.19 percent beta and by 0.27 mm (mpol = 5) to 1.3 mm (mpol = 8) inrmax_surfat 2.1 percent beta on the wide mgrid; the axis moves by up to 76 micrometres. The numbers above were measured with the cross-term sign of #825; with the historical sign the vacuum error stays at 6.9e-3 for every cutoff, so the two changes only pay together.Tests -
VacuumCutoffsStayAboveThePlasmaResolutioninvmec_indata_test(defaults, rejection below the plasma's cutoffs and of annzetathat cannot carryvacuum_ntor, JSON round trip),VacuumPotentialCutoffsAboveThePlasmaResolutioninvmec_in_memory_mgrid_test(the expanded run converges on the same grid, reportspotvacat its size and stays within the vacuum resolution change of the base run),test_vacuum_potential_cutoffsintests/test_free_boundary.py.Scope - defaults are bit-identical to main: the vacuum
Sizesequals the plasma's and the hand-off layout is unchanged. Raising the cutoffs costs only the vacuum solve, which grows with the potential's mode count.