Repository navigation
4692 bug avoid eta cd dimensionless hcd primary nan when p hcd primary injected mw 0 - #4694
Merged
timothy-nunn merged 2 commits intoOct 16, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4694 +/- ##
=======================================
Coverage 50.28% 50.28%
=======================================
Files 181 181
Lines 30532 30532
=======================================
Hits 15353 15353
Misses 15179 15179 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
chris-ashe
approved these changes
Oct 16, 2026
timothy-nunn
approved these changes
Oct 16, 2026
timothy-nunn
deleted the
4692-bug-avoid-eta_cd_dimensionless_hcd_primary-nan-when-p_hcd_primary_injected_mw-0
branch
October 16, 2026 12:12
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.
Description
Issue
PROCESS calculates three current-drive efficiency quantities for the primary H&CD system:
eta_cd_hcd_primary: absolute current-drive efficiency in A/W.eta_cd_norm_hcd_primary: normalised current-drive efficiency, which scaleseta_cd_hcd_primaryby plasma density and major radius.eta_cd_dimensionless_hcd_primary: dimensionless current-drive efficiency, which additionally normalises the efficiency using the plasma electron temperature.Currently,
eta_cd_dimensionless_hcd_primaryis calculated using:However, when no auxiliary current drive is required, PROCESS can produce:
This causes
0 / 0, giving:eta_cd_hcd_primaryis already calculated from the selectedi_hcd_primarymodel, soeta_cd_dimensionless_hcd_primaryshould useeta_cd_hcd_primarydirectly rather than recalculating the same efficiency from realised current and power.Proposed fix
Refactor
calculate_dimensionless_current_drive_efficiency()to takeeta_cd_hcdinstead ofc_hcd_drivenandp_hcd_injectedChecklist
I confirm that I have completed the following checks: