Skip to content

Refactor TF coil models to remove internal cross-section parameters a…#4371

Open
chris-ashe wants to merge 1 commit into
mainfrom
remove_internal_cs_calc_stresscl
Open

Refactor TF coil models to remove internal cross-section parameters a…#4371
chris-ashe wants to merge 1 commit into
mainfrom
remove_internal_cs_calc_stresscl

Conversation

@chris-ashe

@chris-ashe chris-ashe commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This pull request refactors how the Central Solenoid (CS) poloidal cross-sectional area is handled in the TF coil stress calculations. Instead of calculating the CS area inside the stresscl function using several geometric parameters, the area is now passed directly as a parameter (a_cs_poloidal). This change simplifies the interface and removes the need for the previously used parameters. The refactor is applied across the main code and the unit tests.

Refactoring of CS poloidal area handling:

  • The stresscl function in process/models/tfcoil/base.py now takes a_cs_poloidal as a direct argument and no longer requires z_tf_inside_half or f_z_cs_tf_internal. The area calculation inside the function has been removed, and all references to the removed parameters are deleted.

  • All calls to stresscl in process/models/tfcoil/resistive.py and process/models/tfcoil/superconducting.py are updated to pass a_cs_poloidal instead of the removed parameters.
    Test updates:

  • The StressclParam test data structure in tests/unit/models/tfcoil/test_tfcoil.py is updated to remove z_tf_inside_half and f_z_cs_tf_internal, and to add a_cs_poloidal. All test cases and calls to stresscl are updated accordingly.

Description

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

…nd replace with area of CS poloidal cross-section
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 48.78%. Comparing base (23787f8) to head (5276ca8).

Files with missing lines Patch % Lines
process/models/tfcoil/base.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4371   +/-   ##
=======================================
  Coverage   48.77%   48.78%           
=======================================
  Files         151      151           
  Lines       29390    29387    -3     
=======================================
  Hits        14336    14336           
+ Misses      15054    15051    -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chris-ashe chris-ashe requested a review from clmould June 23, 2026 14:24
@clmould clmould self-assigned this Jun 23, 2026
@chris-ashe chris-ashe marked this pull request as ready for review June 25, 2026 14:28
@chris-ashe chris-ashe requested a review from a team as a code owner June 25, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants