Skip to content

♻️ Move 'dcond' variable into SuperconductorModel - #4644

Open
chris-ashe wants to merge 2 commits into
mainfrom
move_dcond_into_enum
Open

chris-ashe wants to merge 2 commits into
mainfrom
move_dcond_into_enum

Conversation

@chris-ashe

@chris-ashe chris-ashe commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

This pull request refactors how superconductor material densities are handled throughout the codebase. Instead of using the dcond array for density values, the code now retrieves densities directly from the SuperconductorModel. This change improves maintainability and clarity by centralizing material properties. The update also removes the dcond field from data structures, input definitions, and tests, and updates expected test values to reflect the new density values.

The most important changes are:

Core logic and data structure updates

  • Replaced all usages of the dcond density array for superconductor materials with lookups from SuperconductorModel(...).material.density in all relevant models and calculations, including TF coil, PF coil, and cost models.
  • Removed the dcond field from the TFData data structure and from the input variable definitions.

Superconductor material definition

  • Updated the SuperconductorMaterial enum to include density as a property, and added a density dynamic attribute for direct access.

Test suite updates

  • Removed all references to dcond from test parameter definitions, monkeypatching, and test logic in test_costs_1990.py, test_pfcoil.py, and test_sctfcoil.py.

Test value updates

  • Updated expected values in tests to reflect the new density values from SuperconductorModel, ensuring consistency with the refactored logic.

These changes centralize material properties for superconductors, reduce redundancy, and make the codebase easier to maintain and extend.…eferences

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.

@chris-ashe
chris-ashe requested a review from a team as a code owner October 2, 2026 16:52
@chris-ashe chris-ashe changed the title Refactor: Move 'dcond' variable into SuperconductorModel ♻️ Move 'dcond' variable into SuperconductorModel Oct 2, 2026
@clmould clmould self-assigned this Oct 2, 2026
@codecov-commenter

codecov-commenter commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.79%. Comparing base (c7056b0) to head (208dd07).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4644      +/-   ##
==========================================
- Coverage   49.97%   49.79%   -0.19%     
==========================================
  Files         151      151              
  Lines       30270    30271       +1     
==========================================
- Hits        15128    15073      -55     
- Misses      15142    15198      +56     

☔ 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

Copy link
Copy Markdown
Member Author

Can I ask someone from @ukaea/process-model-review to check the new superconductor density values. I feel some of the values before were gravely wrong.

@chris-ashe
chris-ashe requested a review from a team October 2, 2026 17:05

@kj5248 kj5248 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Change seems like a good one but why are the density values changed from the dcond values? Probably need some justification for these value changes, even if just a source for the new density values.

Comment thread process/models/superconductors.py
@chris-ashe

Copy link
Copy Markdown
Member Author

Change seems like a good one but why are the density values changed from the dcond values? Probably need some justification for these value changes, even if just a source for the new density values.

Please see the comment I made when opening the PR (#4644 (comment)). Doing a quick google search of the values gives very different results

@kj5248

kj5248 commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Change seems like a good one but why are the density values changed from the dcond values? Probably need some justification for these value changes, even if just a source for the new density values.

Please see the comment I made when opening the PR (#4644 (comment)). Doing a quick google search of the values gives very different results

For large differences I assume it is likely the difference between the density of the bulk material vs the density of a cable making use of the bulk material? Smaller differences are probably just how even the mixture is. For NbTi to get 6.4 g/cm3 it is a mix of high density Nb and lower density Ti so varying the mix can lead to the variations for the composite around the 6.4 mark.

Like you I am really struggling to find what the previous density values correlate to though. For 6080 I only found liquid gallium which is used in MHD, but seeems weird. However for 8500 you get REBCO tape rather than the ceramic layer itself. This paper has REBCO tape with that density: Study of a Superconducting Magnetic Diverter for the ATHENA X-Ray Space Telescope, DOI:10.1109/TASC.2018.2811862.

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.

4 participants