Equilibrium edge reconstruction using an asymptotically robust analytic/numerical method#241
Draft
StuartBenjamin wants to merge 101 commits intodevelopfrom
Draft
Equilibrium edge reconstruction using an asymptotically robust analytic/numerical method#241StuartBenjamin wants to merge 101 commits intodevelopfrom
StuartBenjamin wants to merge 101 commits intodevelopfrom
Conversation
…not. Also loop now goes from axis to edge instead of edge to axis
… still needs to be fixed). relies on new function find_fl_surface
… that can operate at any poloidal angle eta
…a_brackets,maxima_count are local versions of xpt_etas, xpt_brackets, num_xpts respectively, that necessary whenever running direct_initialise_xpoints on some eta interval that isn't [0,2pi]
…good to have the algorithm saved)
… numerical integral and check for a second x-point
…stopping on an x-point
…inal order in direct.f
…ine integrator (via direct_fl_int), and also calls the analytic field line integral function (analytic_y_out), and splices the outputs together using functions patch_two_a, patch_two_b, patch_two_c
… by Eq. 12 in https://doi.org/10.1088/1361-6587/add9ca . Also updates to the description of direct_analytic_ints
…uted in outmat2 may be used as inputs for a future implementation of the general formula for yi4 where power_bp =/=0
…ich adds a knot at eta = 2pi for field line integral outputs
…lice two y_outs together (see their descriptions for more information)
…ng analytic formulas
…lytic + numerical y_out integrals for a range of xpt_tol & BpBt_tol values, before printing outputs. This function was used to generate the data that is plotted in https://doi.org/10.1088/1361-6587/add9ca Figs. 7 & 9.
…PrincetonUniversity/GPEC into equilibrium_edge_princeton_repo
Collaborator
Author
|
For interested parties, here's the particular machine poloidal angle-dependent formulation of the field line integrals in equil, in terms of splines y_out, ff and rzphi: |
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.
Scripts that implement the field-line integral replacement formulas from this paper: https://doi.org/10.1088/1361-6587/add9ca
These scripts switch the equilibrium field-line numerical integrator in direct.f (needed to convert an equilibrium into magnetic coordinates) to a mixed numerical/analytic method, that converges to the exact solution as we get asymptotically close to the separatrix (see paper for more details). The pull request has NOT been submitted, because there is a discontinuity in the output splines when we switch from the numerical-only solution to to the mixed analytic formulas. For the treatment to robustly work, we need to blend from the numerical-only solution into the mixed analytic solution... I leave this to future interested parties.

In the meantime, for far-edge equilibrium reconstruction, one can just bump up the numerical integrator fidelity. Attached is Fig 10 from the paper, showing where the numerical integrator starts breaking (around psi = 0.9999999). This is NOT the limiting factor preventing far edge evaluation of dW (in DCON), or RDCON...; in DCON it's the numerical ODE integration that breaks first, due to a singularity in the F matrix. For RDCON, I haven't probed the far edge limit...
For interested parties, here's the particular machine poloidal angle-dependent formulation of the field line integrals in equil, in terms of splines y_out, ff and rzphi:
GPEC_Field_Line_Maths.pdf