Carry B_s to the wout file on the full radial mesh - #25
Open
CharlesCNorton wants to merge 2 commits into
Open
Conversation
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.
Fixes #22.
jxbforcebuildsB_son the full radial mesh in a local array and drops it atRETURN, sowroutreceives the half-grid array thatbssproduced, applies a full-mesh endpoint rule to it and writes it as!Full mesh.bsubshbecomesINTENT(inout)and carries the full-mesh values back, which is what PARVMECjxbforce.f:33does. The note at wrout.f90:603 that recorded the mismatch goes with it.Compute_Currentsthen has to readbsubsmnon the full mesh rather than averaging two half-grid surfaces intot1. ORNL-Fusion/LIBSTELLread_wout_mod.f90, the copy PARVMEC links against, makes the same four substitutions.Checked against the PARVMEC wout files for
input.solovev,input.cmaandinput.cth_like_fixed_bdy, as the largest difference over the array relative to its maximum:bsubsmnscurrumnccurrvmncsolovevcmacth_like_fixed_bdyThe boundary value is the second commit. PARVMEC reads
bsubs(ns,:)on the right-hand side of its own edge rule, which is the half-grid value still sitting in the array it shares with the caller; here that value isbsubsh(ns,:), so the outermost half point can be used directly instead of extrapolating from two full-mesh points. The largest disagreement with PARVMEC on the boundary surface goes from 9.4e-6 to 7.2e-13 forsolovevand from 1.5e-3 to 7.0e-7 forcth_like_fixed_bdy, level with every interior surface.Compute_Currentsruns from 2 to ns-1 and extrapolates the ends, so it never reads that row and the currents are unchanged. Thecmaresiduals are larger because that pair of runs converged to slightly different states:niterdiffers by 7 percent andbmncby 3e-4 independently of this change.lbsubs = Tnow reaches the wout, since the correction is applied to the array the caller keeps.VMEC++ writes the half-grid values under the name
bsubsmns, to match this code, and publishes the full-grid transform separately asbsubsmns_full; the note atoutput_quantities.cc:5159records the mismatch with the wout file's own declaration and leaves it open. After this change educational_VMEC and PARVMEC agree on that variable.