Skip to content

Fix nbi power: correct shine-through, use plasma-coupled power instead of raw power; corrected wall-plug power conversion#4187

Merged
je-cook merged 6 commits intomainfrom
4186-fix-neutral-beam-shine-through-and-power-accounting-bugs
Apr 20, 2026
Merged

Fix nbi power: correct shine-through, use plasma-coupled power instead of raw power; corrected wall-plug power conversion#4187
je-cook merged 6 commits intomainfrom
4186-fix-neutral-beam-shine-through-and-power-accounting-bugs

Conversation

@grmtrkngtn
Copy link
Copy Markdown
Collaborator

Description

  • We were applying f_p_beam_shine_through incorrectly in two ways:
    • f_p_beam_shine_through represents the fraction of beam power that is not absorbed, but we were using (1 - f_p_beam_shine_through)
    • the fraction was only being applied to part of the power term due to operator precedence, rather than the total beam power
  • Fixed ion/electron power split:
    • previously based on injected beam power
    • now correctly based on plasma-coupled beam power
  • Fixed wall-plug power calculation (pwpnb):
    • previously only part of the power term was divided by injector efficiency
    • now the full beam power term is divided by efficiency

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

…d of raw power; corrected wall-plug power conversion
@grmtrkngtn grmtrkngtn requested a review from a team as a code owner April 14, 2026 12:59
@grmtrkngtn grmtrkngtn linked an issue Apr 14, 2026 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 52.07%. Comparing base (4c99916) to head (9c9ea34).

Files with missing lines Patch % Lines
process/models/physics/physics.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4187      +/-   ##
==========================================
- Coverage   52.07%   52.07%   -0.01%     
==========================================
  Files         148      148              
  Lines       30321    30319       -2     
==========================================
- Hits        15791    15789       -2     
  Misses      14530    14530              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@grmtrkngtn grmtrkngtn self-assigned this Apr 17, 2026
@grmtrkngtn grmtrkngtn requested a review from kj5248 April 17, 2026 08:33
Copy link
Copy Markdown
Collaborator

@kj5248 kj5248 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked through it and I think the changes to how we use f_p_beam_shine_through is definitely correct as is switching to using the deposited beam power for the ion/electron power split calculation. Good catch with the wall-plug power calculation someone definitely stuck the brackets in the wrong place. If you double check the sigbeam function and probably just change the function description and push that I will approve it.

Comment thread process/models/physics/current_drive.py
Copy link
Copy Markdown
Collaborator

@je-cook je-cook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge once the conflicts are fixed

@je-cook je-cook requested review from kj5248 and removed request for kj5248 April 20, 2026 08:28
@je-cook je-cook merged commit 4631887 into main Apr 20, 2026
10 of 11 checks passed
@je-cook je-cook deleted the 4186-fix-neutral-beam-shine-through-and-power-accounting-bugs branch April 20, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix neutral beam shine-through and power accounting bugs

4 participants