♻️ Refactor TF coil stress calculations to use a_cs_poloidal a… #3986
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 the calculation of the central solenoid (CS) cross-sectional area in the toroidal field (TF) coil stress routine. The main change is to remove the dependence on the geometric parameters
z_tf_inside_halfandf_z_cs_tf_internaland instead use a new parameter,a_cs_poloidal, which represents the CS poloidal cross-sectional area. This simplifies the interface and makes the code more robust and maintainable. The changes are consistently applied across the main codebase and the unit tests.Refactoring of CS cross-sectional area calculation:
stressclfunction inprocess/tf_coil.pynow takesa_cs_poloidalas an argument instead of calculating the CS area fromz_tf_inside_halfandf_z_cs_tf_internal. The code for this calculation has been removed, and all usages now referencea_cs_poloidaldirectly.runmethods in bothprocess/resistive_tf_coil.pyandprocess/superconducting_tf_coil.pyhave been updated to passa_cs_poloidaltostresscl, and the now-unused parameters have been removed from the function calls.Updates to unit tests:
StressclParamtest parameter class and all test cases intests/unit/test_tfcoil.pyhave been updated to usea_cs_poloidalinstead ofz_tf_inside_halfandf_z_cs_tf_internal. All relevant test code and expected values have been modified accordingly.Description
Checklist
I confirm that I have completed the following checks: