Open
Conversation
… rather than y=-alpha for tokamak geometry. Update the d3d IWL test so that it is right handed. One more check I will need to implement is whether the bfield_func provided by the user is actually consistent with mapc2p : the provided mapc2p's e_3 and B vector must be parallel. For tokamaks, I needed to change R_psiZ to provide dR and dZ rather than just dR/dZ because we take arctan(dR/dZ) to get some of the tangent vectors and this can give the wrong quadrant - dR and dZ are needed for atan2 which give the correct quadrant. This wasn't affecting things because of the way J is being calculated. I need to bring the cubic R_psiZ functions up to date so that they provide dR and dZ separately.
…xits if it fails them, but mapc2p doesn't. Need to check if this branch reproduces nonlinear sim from main.
…d dPhi/dalpha in calc_metric.
…duction sim to compare.
Collaborator
|
When is this check called? For any input file with mapc2p? |
Collaborator
Author
Yes, any input file with mapc2p or with tokamak numerical geo. |
…sed Fpol = B0*R_axis which is incorrect. It needs to be F_pol=R_axis*B_axis or F_pol = R0*B0. With this correction and a reduction of the error tolerance in the check_parallel function, the miller test finally passes. Updated the 2x d3d iwl test to have the correct mapping and bfield functions
… it consistent with literature and documentation.
…the choice of whether to use R0*B0 or Raxis*Baxis was made in too many places throughout the input files. Change IWL input files so this choice only appears in Bphi, and alpha and dPsidr call Bphi and write fpol=R*Bphi instead.
Collaborator
Author
|
Re-opening: |
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.
Add check to ensure that the GK coordinate system is right handed.
Most importantly, this PR changes the definition of y from y=-alpha to y=alpha, and we change the signs in the definition of the binormal coordinate y (and the size of B_Z) in IWL mapc2p input files.
NOTE: the IWL input files don't pass the consistency checks. We've tried to investigate this some, even completely rewriting the mapc2p for those input files, but have not figured out why they fail. We leave it as failing at the moment, but at least now we know. It prints messages like
Unfortunately, because we need every part of the domain to perform these checks and alert us if they fail, every MPI process is printing this warning, so the log file will have a lot of these at t=0.
Below we do a comparison of a TCV IWL 3x2v simulation ran with this branch vs. one ran in main.
IWL test
Here we compare a TCV IWL 3x2v with fixed source ran in main vs in this righthanded_checks branch. Up to nearly 0.5 ms the moments look basically the same.