Modify flux_coordinates.pro to use Bisection near LCFS#60
Open
mgyoo86 wants to merge 1 commit intoPrincetonUniversity:masterfrom
Open
Modify flux_coordinates.pro to use Bisection near LCFS#60mgyoo86 wants to merge 1 commit intoPrincetonUniversity:masterfrom
mgyoo86 wants to merge 1 commit intoPrincetonUniversity:masterfrom
Conversation
Current flux_coordinates.pro may not find some target flux surfaces near LCFS (For example, see Chen Zhao's MAST case on Stellar:/scratch/gpfs/cz12/sim2/fw1_equil/) Two things are implemented in this commit to fix this problem. 1) Check target psin values Ensure that the target psin valuse must form closed flux surfaces within a given rectangular boundary. Otherwise, we cannot find target psin along some poloidal angles, which might causes errors. 2) Use the Bisection method near LCFS (psin>0.95) Newton's method may not work correctly near LCFS due to too steep dpsi/drho there. Instead, use the Bisection method for a more reliable root finding. Note that the Bisection method here is not optimal form to minimize changes in the code. Currently, the Bisection method works for target_psin>0.95. If necessary, we can set a more general condition to determine whether to use Newton's or Biscection in the future.
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.
Current flux_coordinates.pro may not find some target flux surfaces near LCFS
(For example, see Chen Zhao's MAST case on Stellar:/scratch/gpfs/cz12/sim2/fw1_equil/)
Two things are implemented in this commit to fix this problem.
Check target psin values
Ensure that the target psin valuse must form closed flux surfaces within a given rectangular boundary. Otherwise, we cannot find target psin along some poloidal angles, which might causes errors.
Use the Bisection method near LCFS (psin>0.95)
Newton's method may not work correctly near LCFS due to too steep dpsi/drho there. Instead, use the Bisection method for a more reliable root finding. Note that the Bisection method here is not optimal form to minimize changes in the code. Currently, the Bisection method works for target_psin>0.95. If necessary, we can set a more general condition to determine whether to use Newton's or Biscection in the future.