Refactor pf coil placement#3840
Merged
timothy-nunn merged 20 commits intomainfrom Sep 25, 2025
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3840 +/- ##
==========================================
- Coverage 46.57% 46.57% -0.01%
==========================================
Files 122 123 +1
Lines 27898 28130 +232
==========================================
+ Hits 12994 13102 +108
- Misses 14904 15028 +124 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
863735d to
465d5ce
Compare
09eda88 to
523471d
Compare
… improved clarity and maintainability
…e references throughout the PFCoil module and integration tests
…e references in PFCoil module and integration tests
…rences in PFCoil module and integration tests
…update references in PF coil logic and tests
…pdate references in PF coil logic and tests
…od for clarity and maintainability
…pdate references in Build and PFCoil classes and integration tests
…arity in TF coil height difference representation
…ity and update references in related files
…arity and maintainability
…including new equations and descriptions for outside TF coil placement
…ous configurations
523471d to
1107d76
Compare
timothy-nunn
approved these changes
Sep 25, 2025
grmtrkngtn
pushed a commit
that referenced
this pull request
Oct 10, 2025
* Refactor PF coil placement logic for improved readability and consistency * Refactor PF coil placement logic by introducing a helper function for improved clarity and maintainability * 🔄 - Rename rcls to r_pf_coil_middle_group_array for clarity and update references throughout the PFCoil module and integration tests * 🔄 - Rename zcls to z_pf_coil_middle_group_array for clarity and update references in PFCoil module and integration tests * 🔄 - Rename rpf1 to dr_pf_cs_middle_offset for clarity and update references in PFCoil module and integration tests * 🔄 - Rename 'routr' to 'dr_pf_tf_outboard_out_offset' for clarity and update references in PF coil logic and tests * 🔄 - Rename 'rclsnorm' to 'r_pf_outside_tf_midplane' for clarity and update references in PF coil logic and tests * 🔄 - Refactor PF coil placement logic and add 'place_pf_above_tf' method for clarity and maintainability * 🔄 - Rename 'hpfdif' to 'dz_tf_upper_lower_midplane' for clarity and update references in Build and PFCoil classes and integration tests * 🐛 Fix calculated value of dz_tf_upper_lower_midplan * 🎨 Add 'dz_tf_upper_lower_midplane' to plot and output for improved clarity in TF coil height difference representation * 🔄 - Rename 'i_sup_pf_shape' to 'i_r_pf_outside_tf_placement' for clarity and update references in related files * 🐛 Fix false association between TF coil shape and conductor type * ♻️ Add new function for placing PF coils outside the TF * ♻️ Refactor PF coil placement logic into a new method for improved clarity and maintainability * 🎨 Update PF coil positioning documentation for clarity and accuracy, including new equations and descriptions for outside TF coil placement * ♻️ Add parameterized test for placing PF coils above the CS with various configurations * ♻️ Add unit tests for placing PF coils above TF with various configurations * Update r/z_pf_coil_middle_group_array in the general case * ♻️ Update obsolete variable mappings for PF coil placement offsets --------- Co-authored-by: Timothy Nunn <timothy.nunn@ukaea.uk>
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 pull request refactors how PF coil and TF coil positional parameters are named and handled throughout the codebase, improving clarity, consistency, and maintainability. It replaces ambiguous variable names with more descriptive ones, updates documentation to match the new conventions, and ensures all related modules, input handling, plotting, and tests use the updated parameters. Additionally, the documentation for PF coil placement logic is expanded and clarified.
🔄 Renames
rcls->r_pf_coil_middle_group_arrayzcls->z_pf_coil_middle_group_arrayrpf1->dr_pf_cs_middle_offsetroutr->dr_pf_tf_outboard_out_offsetrclsnorm->r_pf_outside_tf_midplanehpfdif->dz_tf_upper_lower_midplanei_sup_pf_shape->i_r_pf_outside_tf_placement🐛 Bugs
Wrong assumption between PF conductor type and location of PF coils. Is now based on coil shape
❌
✅
Documentation and logic updates:
i_pf_location(j)and the new/renamed variables, with explicit equations and placement routines.Plotting and visualization:
dz_tf_upper_lower_midplaneparameter in TF coil structure plots for enhanced visualization.Testing updates:
Checklist
I confirm that I have completed the following checks: