♻️ Refactor CS coil 1#3962
Merged
timothy-nunn merged 7 commits intomainfrom Nov 4, 2025
Merged
Conversation
…r handling and documentation
…ial_stress` and update references in tests
…nd update references in PFCoil and CSCoil classes
… update references in PFCoil and CSCoil classes
…l stress at coil interface
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3962 +/- ##
==========================================
+ Coverage 45.98% 46.04% +0.05%
==========================================
Files 123 123
Lines 28550 28549 -1
==========================================
+ Hits 13129 13144 +15
+ Misses 15421 15405 -16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…al force, and stress in the plot output 🔄 - Refactor test cases for calculate_cs_self_peak_midplane_axial_stress to ensure proper assertions and formatting
Collaborator
timothy-nunn
left a comment
There was a problem hiding this comment.
Happy with the code changes, will approve and merge once @j-a-foster has done his bit. One question re test reference values.
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 and improves the calculation and handling of axial stress and axial force at the midplane of the central solenoid (CS) due to its own field. The changes include renaming variables and functions for clarity, updating documentation, refactoring the main calculation routine, and improving unit test coverage for the new function. These updates enhance code readability, maintainability, and scientific accuracy.
🔄 Renames
axial_stress()->calculate_cs_self_peak_midplane_axial_stress()sig_axial->stress_z_cs_self_peak_midplaneaxial_force->forc_z_cs_self_peak_midplaneCentral solenoid axial stress and force calculation improvements:
axial_stress()withcalculate_cs_self_peak_midplane_axial_stress(), which uses elliptic integrals for more accurate computation and has improved documentation and parameterization.sig_axial→stress_z_cs_self_peak_midplaneandaxial_force→forc_z_cs_self_peak_midplanethroughout the codebase, including initialization, output, and plotting routines.Documentation updates:
Testing improvements:
calculate_cs_self_peak_midplane_axial_stress()across typical, zero-current, extreme geometry, and invalid input scenarios, improving reliability and coverage.axial_stress()function.Other codebase maintenance:
These changes collectively improve the scientific accuracy, clarity, and maintainability of the central solenoid stress calculations in the codebase.
Checklist
I confirm that I have completed the following checks: