3013 add class methods for each current drive efficiency calc along with suitable tests#3621
Merged
timothy-nunn merged 41 commits intomainfrom Apr 24, 2025
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3621 +/- ##
==========================================
+ Coverage 36.24% 36.39% +0.15%
==========================================
Files 88 88
Lines 22090 22051 -39
==========================================
+ Hits 8006 8025 +19
+ Misses 14084 14026 -58 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
03abbe9 to
0029c39
Compare
Contributor
There was a problem hiding this comment.
Copilot reviewed 53 out of 62 changed files in this pull request and generated no comments.
Files not reviewed (9)
- examples/data/csv_output_large_tokamak_MFILE.DAT: Language not supported
- examples/data/large_tokamak_1_MFILE.DAT: Language not supported
- examples/data/large_tokamak_2_MFILE.DAT: Language not supported
- examples/data/large_tokamak_3_MFILE.DAT: Language not supported
- examples/data/large_tokamak_4_MFILE.DAT: Language not supported
- examples/data/large_tokamak_IN.DAT: Language not supported
- examples/data/large_tokamak_once_through_IN.DAT: Language not supported
- examples/data/scan_MFILE.DAT: Language not supported
- examples/data/scan_example_file_IN.DAT: Language not supported
Contributor
There was a problem hiding this comment.
Copilot reviewed 58 out of 67 changed files in this pull request and generated 2 comments.
Files not reviewed (9)
- examples/data/csv_output_large_tokamak_MFILE.DAT: Language not supported
- examples/data/large_tokamak_1_MFILE.DAT: Language not supported
- examples/data/large_tokamak_2_MFILE.DAT: Language not supported
- examples/data/large_tokamak_3_MFILE.DAT: Language not supported
- examples/data/large_tokamak_4_MFILE.DAT: Language not supported
- examples/data/large_tokamak_IN.DAT: Language not supported
- examples/data/large_tokamak_once_through_IN.DAT: Language not supported
- examples/data/scan_MFILE.DAT: Language not supported
- examples/data/scan_example_file_IN.DAT: Language not supported
2e7713b to
9585e4a
Compare
48d92a3 to
349df47
Compare
…ch current drive type
…frequency and update references in CurrentDrive class
…ting efficiency and update documentation
…ron cyclotron heating efficiency and update related documentation
… drive efficiency and update documentation
…nstein Wave current drive efficiency and refactor CurrentDrive class to utilize this new method
…clotron current drive efficiency and refactor CurrentDrive class to utilize this new method
…calculations using a dictionary of models and remove redundant code
… introduce new variables for driven current fractions
…sistency in current drive calculations
…ons_mw and update injected power handling for ion cyclotron cases
…ated calculations in current drive and heat transport modules
…s for primary heating power in heat transport module
…e cases and improve wall plug power efficiency
…e for improved clarity and maintainability
…oupled to plasma after losses
…ve power and improve wall plug efficiency
…lated calculations and tests
…er and update related tests
…mproving efficiency calculations
…related data files and calculations
…ty and update related calculations and documentation
… update related calculations and data files
…ter organization and clarity
349df47 to
351576f
Compare
timothy-nunn
approved these changes
Apr 23, 2025
…eam classes directly
351576f to
255258c
Compare
grmtrkngtn
pushed a commit
that referenced
this pull request
May 16, 2025
…uitable tests (#3621) * ♻️ Refactor CurrentDrive initialization to include new classes for each current drive type * ❇️ Add lower_hybrid_fenstermacher function to calculate lower hybrid frequency and update references in CurrentDrive class * ✨ Add ion_cyclotron_ipdg89 function for calculating ion cyclotron heating efficiency and update documentation * ✨ Add electron_cyclotron_fenstermacher function for calculating electron cyclotron heating efficiency and update related documentation * ✨ Add lower_hybrid_ehst function for calculating Lower Hybrid current drive efficiency and update documentation * ✨ Add electron_berstein_freethy function for calculating Electron Bernstein Wave current drive efficiency and refactor CurrentDrive class to utilize this new method * ✨ Add electron_cyclotron_freethy function for calculating Electron Cyclotron current drive efficiency and refactor CurrentDrive class to utilize this new method * ✨ Refactor CurrentDrive class to streamline current drive efficiency calculations using a dictionary of models and remove redundant code * 🔄 Make eta_cd_hcd_secondary a proper current_drive variable * ➕ Add calculation for the normalised secondary efficiency * ✨ Create new current driven variables for the hcd systems * ✨ Add calculations for secondary heating current drive efficiency and introduce new variables for driven current fractions * 🔄 Rename pinjwpfix to p_hcd_secondary_electric_mw for clarity and consistency in current drive calculations * 🔄 Rename variable plhybd to p_hcd_lowhyb_injected_total_mw for clarity and consistency in current drive calculations * 🔄 Rename variable pnbeam to p_hcd_beam_injected_total_mw for clarity and consistency in current drive calculations * ✨ Introduce p_hcd_primary_injected_mw variable and update calculations for primary heating power in current drive module * ✨ Add variables for ion cyclotron and electron Bernstein wave injection power in current drive module * ✨ Add injector wall plug efficiency variables for ion cyclotron and electron Bernstein wave in current drive module * ♻️ Refactor current drive calculations to introduce p_hcd_secondary_ions_mw and update injected power handling for ion cyclotron cases * 🔄 Rename pinjwp to p_hcd_electric_total_mw for clarity and update related calculations in current drive and heat transport modules * ✨ Introduce p_hcd_primary_electric_mw variable and update calculations for primary heating power in heat transport module * ♻️ Update current drive calculations to handle electron Bernstein wave cases and improve wall plug power efficiency * ♻️ Refactor primary heating power calculations in current drive module for improved clarity and maintainability * ✨ Add p_beam_plasma_coupled_mw variable to track neutral beam power coupled to plasma after losses * 🔄 Rename echwpow to p_hcd_ecrh_electric_mw for clarity and update related data files * ♻️ Update current drive calculations to include electron Bernstein wave power and improve wall plug efficiency * ♻️ Rename pwplh to p_hcd_lowhyb_electric_mw for clarity and update related calculations and tests * ✨ Add p_ebw_injected_mw variable to track electron Bernstein wave power and update related tests * 📝 Enhance current drive reporting by adding extra power metrics and improving efficiency calculations * 🔄 Rename fvsbrnni to f_c_plasma_non_inductive for clarity and update related data files and calculations * 🔄 Rename inductive_current_fraction to f_c_plasma_inductive for clarity and update related calculations and documentation * 🔄 Rename aux_current_fraction to f_c_plasma_auxiliary for clarity and update related calculations and data files * 📝 Fix nbi in output * Post rebase updates * 🔄 Move legend function from CurrentDrive to ElectronCyclotron for better organization and clarity * 🔄 Add initial data files and documentation for heating and current drive systems * 🔄 Add p_hcd_injected_current_total_mw as a variable * 🔄 Refactor current drive method calls for clarity and consistency * 🔄 Refactor current drive method calls for clarity and consistency * Re make current drive unit tests to new style, create case for lower hybrid * 🔄 Refactor CurrentDrive initialization to instantiate cyclotron and beam classes directly
grmtrkngtn
pushed a commit
that referenced
this pull request
May 16, 2025
…uitable tests (#3621) * ♻️ Refactor CurrentDrive initialization to include new classes for each current drive type * ❇️ Add lower_hybrid_fenstermacher function to calculate lower hybrid frequency and update references in CurrentDrive class * ✨ Add ion_cyclotron_ipdg89 function for calculating ion cyclotron heating efficiency and update documentation * ✨ Add electron_cyclotron_fenstermacher function for calculating electron cyclotron heating efficiency and update related documentation * ✨ Add lower_hybrid_ehst function for calculating Lower Hybrid current drive efficiency and update documentation * ✨ Add electron_berstein_freethy function for calculating Electron Bernstein Wave current drive efficiency and refactor CurrentDrive class to utilize this new method * ✨ Add electron_cyclotron_freethy function for calculating Electron Cyclotron current drive efficiency and refactor CurrentDrive class to utilize this new method * ✨ Refactor CurrentDrive class to streamline current drive efficiency calculations using a dictionary of models and remove redundant code * 🔄 Make eta_cd_hcd_secondary a proper current_drive variable * ➕ Add calculation for the normalised secondary efficiency * ✨ Create new current driven variables for the hcd systems * ✨ Add calculations for secondary heating current drive efficiency and introduce new variables for driven current fractions * 🔄 Rename pinjwpfix to p_hcd_secondary_electric_mw for clarity and consistency in current drive calculations * 🔄 Rename variable plhybd to p_hcd_lowhyb_injected_total_mw for clarity and consistency in current drive calculations * 🔄 Rename variable pnbeam to p_hcd_beam_injected_total_mw for clarity and consistency in current drive calculations * ✨ Introduce p_hcd_primary_injected_mw variable and update calculations for primary heating power in current drive module * ✨ Add variables for ion cyclotron and electron Bernstein wave injection power in current drive module * ✨ Add injector wall plug efficiency variables for ion cyclotron and electron Bernstein wave in current drive module * ♻️ Refactor current drive calculations to introduce p_hcd_secondary_ions_mw and update injected power handling for ion cyclotron cases * 🔄 Rename pinjwp to p_hcd_electric_total_mw for clarity and update related calculations in current drive and heat transport modules * ✨ Introduce p_hcd_primary_electric_mw variable and update calculations for primary heating power in heat transport module * ♻️ Update current drive calculations to handle electron Bernstein wave cases and improve wall plug power efficiency * ♻️ Refactor primary heating power calculations in current drive module for improved clarity and maintainability * ✨ Add p_beam_plasma_coupled_mw variable to track neutral beam power coupled to plasma after losses * 🔄 Rename echwpow to p_hcd_ecrh_electric_mw for clarity and update related data files * ♻️ Update current drive calculations to include electron Bernstein wave power and improve wall plug efficiency * ♻️ Rename pwplh to p_hcd_lowhyb_electric_mw for clarity and update related calculations and tests * ✨ Add p_ebw_injected_mw variable to track electron Bernstein wave power and update related tests * 📝 Enhance current drive reporting by adding extra power metrics and improving efficiency calculations * 🔄 Rename fvsbrnni to f_c_plasma_non_inductive for clarity and update related data files and calculations * 🔄 Rename inductive_current_fraction to f_c_plasma_inductive for clarity and update related calculations and documentation * 🔄 Rename aux_current_fraction to f_c_plasma_auxiliary for clarity and update related calculations and data files * 📝 Fix nbi in output * Post rebase updates * 🔄 Move legend function from CurrentDrive to ElectronCyclotron for better organization and clarity * 🔄 Add initial data files and documentation for heating and current drive systems * 🔄 Add p_hcd_injected_current_total_mw as a variable * 🔄 Refactor current drive method calls for clarity and consistency * 🔄 Refactor current drive method calls for clarity and consistency * Re make current drive unit tests to new style, create case for lower hybrid * 🔄 Refactor CurrentDrive initialization to instantiate cyclotron and beam classes directly
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.
This PR focusses on refactoring
current_drive.pyso that it has separate classes for each of the current drive schemes and tidies up and expands the output.Naming changes
New variables
eta_cd_hcd_secondaryp_hcd_injected_current_total_mwVariable changes
pinjwpfix->p+hcd_secondary_electric_mwpinjwp->p_hcd_electric_total_mwplhybd->p_hcd_lowhyb_injected_total_mwpnbeam->p_hcd_beam_injected_total_mwechpow->p_hcd_ecrh_electric_mwfvsbrnni->f_c_plasma_non_inductiveinductive_current_fraction->f_c_plasma_inductiveaux_current_fraction->f_c_plasma_auxiliaryCode structure
Previous
New
Code output
Previous
New
🐛 Bugs
Checklist
I confirm that I have completed the following checks: