Skip to content

Conversation

@timothy-nunn
Copy link
Collaborator

Adds dr_tf_inboard = 0.9 to spherical_tokamak_eval.IN.DAT, the value is taken from the st_regression.IN.DAT optimised solution.

This was causing the winding pack to become excessively large, meaning the cable plotting algorithm was iterating over trillions of elements:

  1. dr_tf_inboard was 0 (its default) which caused dr_tf_wp_with_insulation to become negative

    PROCESS/process/build.py

    Lines 1783 to 1790 in 40782b5

    # WP radial thickness [m]
    # Calculated only if not used as an iteration variable
    if 140 not in numerics.ixc[0 : numerics.nvar]:
    tfcoil_variables.dr_tf_wp_with_insulation = (
    build_variables.dr_tf_inboard
    - tfcoil_variables.dr_tf_plasma_case
    - tfcoil_variables.dr_tf_nose_case
    )
  2. Which causes j_tf_wf to become 1
    tfcoil_variables.j_tf_wp = max(
    1.0e0,
    tfcoil_variables.c_tf_total
    / (
    tfcoil_variables.n_tf_coils
    * superconducting_tf_coil_variables.a_tf_wp_no_insulation
    ),
    )
  3. Which causes the turn area to become excessively large (6 orders of magnitude larger than in st_regression.IN.DAT) and dx_tf_turn_general is consequently larger (~250m rather than a couple of cm/mm).
    a_tf_turn = c_tf_turn / j_tf_wp
    # Dimension of square cross-section of each turn including inter-turn insulation [m]
    dx_tf_turn_general = np.sqrt(a_tf_turn)
  4. In plot_proc, this unreasonably large winding pack causes the number of rows and columns in the cable plotting routine to become large (n_rows = 340377, n_cols = 294775) which causes the for loop to iterate ~ $10^{11}$ times rather than the few hundred times it iterates for st_regression.IN.DAT

@timothy-nunn timothy-nunn requested a review from a team as a code owner February 3, 2026 13:42
@timothy-nunn timothy-nunn linked an issue Feb 3, 2026 that may be closed by this pull request
@timothy-nunn
Copy link
Collaborator Author

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.46%. Comparing base (40782b5) to head (c037936).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4081   +/-   ##
=======================================
  Coverage   46.46%   46.46%           
=======================================
  Files         122      122           
  Lines       28838    28838           
=======================================
  Hits        13401    13401           
  Misses      15437    15437           

☔ 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.

@je-cook je-cook requested a review from chris-ashe February 3, 2026 14:45
@je-cook je-cook self-assigned this Feb 3, 2026
@je-cook je-cook merged commit 0078bb3 into main Feb 3, 2026
8 of 10 checks passed
@je-cook je-cook deleted the 4078-bug-cannot---full-output-spherical-tokamak-eval-file branch February 3, 2026 15:00
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.

🐛 Cannot --full-output spherical tokamak eval file

5 participants