Skip to content

Conversation

@chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Jul 29, 2025

For the calculation of the superconducting inboard TF (dr_tf_inboard) and WP thickness (dr_tf_wp_with_insulation) there was always a $\cos\left(\frac{\pi}{N_{TF}}\right)$ term in the summation of the radial components. This seems non sensical as this term will always reduce the total value for the summed components. It was discovered that this was put in long ago to prevent the WP from clipping into the end of the plasma case no matter what the value was.

A better approach has been added that preserved the summation of the radial components and their total value. In the calculation of the radial thickness of the plasma case (dr_tf_plasma_case) the same logic to prevent collision has been applied to create a minimum value

$$ \mathrm{d}R_{\text{TF,plasma-case}} \ge \left(R_{\text{TF,inner}}+\mathrm{d}R_{\text{TF,inboard}}\right) \times \left(1 -\cos\left(\frac{\pi}{N_{TF}}\right)\right) $$

Error Handling Enhancements:

  • Added a new error (Error 290) to handle cases where dr_tf_plasma_case is too small to accommodate the winding pack (WP), forcing it to a minimum value. This includes updates to errorlist.json and logic in tf_coil.py. [1] [2] [3]

Visualization Improvements:

  • Added a dashed vertical line to plots in plot_proc.py to mark r_tf_inboard_out, improving clarity in TF coil visualizations.

✅Tests

Below is the one of the regression test failures, notice how the area of the plasma case has gone down even though the radial thickness has increased.

image

This will hopefully close #1884 #1709

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.

@chris-ashe chris-ashe self-assigned this Jul 29, 2025
@chris-ashe chris-ashe added Bug TF Coil Toroidal field coil labels Jul 29, 2025
@chris-ashe chris-ashe changed the title Tf coil area error TF coil plasma case area error Jul 29, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.26%. Comparing base (eb30b0d) to head (876b91d).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
process/build.py 0.00% 2 Missing ⚠️
process/io/plot_proc.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3748      +/-   ##
==========================================
+ Coverage   38.80%   40.26%   +1.46%     
==========================================
  Files          92       93       +1     
  Lines       23336    24699    +1363     
==========================================
+ Hits         9055     9945     +890     
- Misses      14281    14754     +473     

☔ View full report in Codecov by Sentry.
📢 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 timothy-nunn July 30, 2025 08:27
@chris-ashe chris-ashe marked this pull request as ready for review July 30, 2025 08:28
@chris-ashe chris-ashe requested a review from j-a-foster July 30, 2025 08:28
Copy link
Collaborator

@j-a-foster j-a-foster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with changes.

@timothy-nunn timothy-nunn merged commit 5c265ce into main Jul 30, 2025
14 of 18 checks passed
@timothy-nunn timothy-nunn deleted the tf_coil_area_error branch July 30, 2025 10:42
@je-cook je-cook added the Bug Something isnt working label Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isnt working TF Coil Toroidal field coil

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a_tf_steel becoming negative

5 participants