-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tglf edits #328
Merged
Merged
Tglf edits #328
Conversation
This file contains 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
Hi Tom,
I looked at the “big” fixes your student proposed and they appear to be true bugs.
The mixed case with parallel flows (vpar) and perpendicular magnetic flutter (use_bper) is very complicated.
The usual GK theory for this is to shift velocity variables (Hinton & Wong) but this introduces the Coriolis drift in a way that is not compatible with the Hammett-Perkins closure of the v_par*k_par term in the GK equation. Instead I introduced the parallel flows only in the background distribution function as a term v_par*u_par*F0 added to the usual unshifted Maxwellian F0 and followed Antonsen & Lane to compute the GK terms. This introduces a lot of terms and does not satisfy the Galilean invariance property. For many years I have required that users set ALPHA_MACH=0.0 if they want to USE_BPER=T. In other words, you cannot do parallel flows with perpendicular magnetic flutter. Note that VPAR_MODEL_IN = 0 is the only option (depreciated) so the presence of parallel flows are controlled by the multiplier ALPHA_MACH.
For 44c4776<https://urldefense.us/v2/url?u=https-3A__github.com_gafusion_gacode_pull_328_commits_44c47768cf6530d33a092d4d896aaaeff2cb618c&d=DwMCaQ&c=v4IIwRuZAmwupIjowmMWUmLasxPEgYsgNI-O7C4ViYc&r=oeuRADaXAsQ3sdYZ1H8MBFj5rBszAefFmjI2QqoKTK8&m=csRnt7QNm7QRPiuFfIwSZfaM3FCPmWjXbmm5k1Cr_BsY-eMREDNABaC54vVGwG5E&s=acsWUQ2itdbVWBWTroBKYB1TwNF-6whfsuVWO1NOKuo&e=>
The term kpar_gp1b0 should be the same as kpar_hp1b0 other than the g & h. (h refers to full velocity space integration, g to just the trapped region). Since the code has
kpar_hp1b0 = k_par0*ave_kparhp1b0(is,ib,jb)
I think
kpar_gp1b0 = k_par0*ave_kpargp1p0(is,ib,jb)
Is a true bug.
The line in tglf_matrix.f90
ave_kparhr13bp(is,ib,jb) = kp_hr13b0
is inconsistent with its counterpart
ave_kpargr13bp(is,ib,jb) = kp_gr13bp
so it also is a bug.
For 119c491<https://urldefense.us/v2/url?u=https-3A__github.com_gafusion_gacode_pull_328_commits_119c4912917b572b11d5f7641d2313a096c8822f&d=DwMCaQ&c=v4IIwRuZAmwupIjowmMWUmLasxPEgYsgNI-O7C4ViYc&r=oeuRADaXAsQ3sdYZ1H8MBFj5rBszAefFmjI2QqoKTK8&m=csRnt7QNm7QRPiuFfIwSZfaM3FCPmWjXbmm5k1Cr_BsY-eMREDNABaC54vVGwG5E&s=Ik1DC8EjgDw2wdgWw1mn6zAAO1_YQPAJGYmZ-j9tJa4&e=>
These two are true bugs.
For 9e951aa<https://urldefense.us/v2/url?u=https-3A__github.com_gafusion_gacode_pull_328_commits_9e951aa4782c8c33c41bbab9948b9b6e73fc1912&d=DwMCaQ&c=v4IIwRuZAmwupIjowmMWUmLasxPEgYsgNI-O7C4ViYc&r=oeuRADaXAsQ3sdYZ1H8MBFj5rBszAefFmjI2QqoKTK8&m=csRnt7QNm7QRPiuFfIwSZfaM3FCPmWjXbmm5k1Cr_BsY-eMREDNABaC54vVGwG5E&s=6ibGORErCz_tP5IopbWrkQiZ7_XihUVkkC2pr1GJ1V0&e=>
This too looks like a real bug. Must be very old. It would only impact adiabatic electron runs.
For 6aae4f2<https://urldefense.us/v2/url?u=https-3A__github.com_gafusion_gacode_pull_328_commits_6aae4f20c2f4fdfcc058fb32a1dcb01b4bc7d715&d=DwMCaQ&c=v4IIwRuZAmwupIjowmMWUmLasxPEgYsgNI-O7C4ViYc&r=oeuRADaXAsQ3sdYZ1H8MBFj5rBszAefFmjI2QqoKTK8&m=csRnt7QNm7QRPiuFfIwSZfaM3FCPmWjXbmm5k1Cr_BsY-eMREDNABaC54vVGwG5E&s=p-4vvPS4lZTUwDuSmMw_ky--zAVCm-tqvYGxD3bY7QU&e=>
This is also a bug.
I approve these bug fixes. Thank you for finding them. Did your student use some sort of debugger?
Gary
|
Thank you, Gary! |
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.
My SULI student Danny Sun (@dannysun91) and I have been looking at TGLF, and found five minor bugs. For
kpar_gp1b0
,ave_wdhr13b0
andave_kparhr13bp
there is no obvious effect on any of the fluxes for the DIII-D validation database, e.g. heat flux:For
q_par
, the effect is small and by design only affects momentum flux:For
betae_sig
, using non-default parametersUSE_MHD_RULE = F
andUSE_BPAR = T
, the effect is larger but comparable to the effect ofUSE_MHD_RULE = F/T
(not shown):Hopefully these edits will also help with @gmstaebler's development of the updated eigenvalue solver GFS.