-
Notifications
You must be signed in to change notification settings - Fork 7
InnerLayer.SLAYER - BUGFIX! - Normalize D by the electron diamagnetic share, not the temperature ratio #434
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
Open
d-burg
wants to merge
5
commits into
develop
Choose a base branch
from
bugfix/slayer-dnorm-iota-e
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a5dea9f
InnerLayer.SLAYER - BUGFIX! - Normalize D by the electron diamagnetic…
d-burg 8df7535
InnerLayer.SLAYER - MINOR - Deduplicate the iota_e normalization comm…
d-burg 9b44f8c
InnerLayer.SLAYER - MINOR - Restore the D-normalization formula citation
d-burg e32740a
InnerLayer.SLAYER - TEST - Give the shared fixtures the physical oppo…
d-burg c371c89
Merge branch 'develop' into bugfix/slayer-dnorm-iota-e
d-burg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,7 @@ de-normalization. The parametrization uses `P_perp`, `P_tor`, and | |
| | `tau` | T_i / T_e | | ||
| | `lu` | Lundquist number S = τ_R / τ_H | | ||
| | `c_beta` | Compressibility √(β_local / (1 + β_local)) | | ||
| | `D_norm` | (d_β/r_s) · S^(1/3) · √(τ/(1+τ)) (Fitzpatrick normalized scale) | | ||
| | `D_norm` | (d_β/r_s) · S^(1/3) · √ι_e (Fitzpatrick normalized scale) | | ||
| | `P_perp` | Perpendicular Prandtl number τ_R / τ_⊥ | | ||
| | `P_tor` | Toroidal-direction Prandtl number τ_R / τ_‖tor | | ||
| | `Q_e` | Normalized electron diamagnetic: −tauk · ω_*e | | ||
|
|
@@ -329,6 +329,19 @@ function slayer_parameters(; | |
| ) | ||
| ) | ||
| iota_e = Q_e / Q_e_minus_Q_i | ||
| # D below takes sqrt(iota_e). iota_e lies in (0,1) whenever ω_*e and ω_*i have | ||
| # opposite signs — the physical case and the convention stated above. Surface a | ||
| # negative value as a clear error rather than a bare DomainError. | ||
| iota_e > 0 || | ||
| throw( | ||
| ArgumentError( | ||
| "slayer_parameters: iota_e = Q_e/(Q_e - Q_i) = $iota_e is " * | ||
| "not positive, so the ion-sound-radius normalization " * | ||
| "D_norm = (d_beta/r_s)·S^(1/3)·sqrt(iota_e) is undefined. " * | ||
| "Check the diamagnetic-frequency inputs ω_*e, ω_*i — they " * | ||
| "are expected to carry opposite signs." | ||
| ) | ||
| ) | ||
|
|
||
| # Plasma beta and compressibility | ||
| lbeta = (5.0 / 3.0) * MU_0 * n_e * E_CHG * (t_e + t_i) / bt^2 | ||
|
|
@@ -342,7 +355,10 @@ function slayer_parameters(; | |
|
|
||
| # Normalized beta-related width and Δ-normalization | ||
| d_beta = c_beta * d_i | ||
| D_norm = (d_beta / rs) * lu^(1.0 / 3.0) * sqrt(tau / (1.0 + tau)) | ||
| # D = S^(1/3)·iota_e^(1/2)·(d_beta/r_s), Fitzpatrick's ion-sound-radius normalization. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment also feels kinda "Claude explaining code that it removed that quickly becomes out of date". Not sure if this even needs a comment, or if it does, maybe just a reference to the relevant equation in Fitzpatrick's paper if desired |
||
| # iota_e is the electron share of the total diamagnetic frequency; it reduces to | ||
| # 1/(1+tau) only when the electron and ion pressure-gradient scale lengths match. | ||
| D_norm = (d_beta / rs) * lu^(1.0 / 3.0) * sqrt(iota_e) | ||
| delta_n = lu^(1.0 / 3.0) / rs | ||
|
|
||
| # Critical-Δ offset from chi_parallel matching | ||
|
|
||
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this comment - the error text is self explanatory