Skip to content

Tidy TF resistive #3465

Merged
timothy-nunn merged 29 commits intomainfrom
tidy_tf_power_supplies
Feb 13, 2025
Merged

Tidy TF resistive #3465
timothy-nunn merged 29 commits intomainfrom
tidy_tf_power_supplies

Conversation

@chris-ashe
Copy link
Copy Markdown
Collaborator

@chris-ashe chris-ashe commented Jan 13, 2025

Description

Namespace changes

Functions


Variables

  • tfbusl -> len_tf_bus
  • rhotfbus -> rho_tf_bus
  • tfbusmas -> m_tf_bus
  • n_tf -> n_tf_coils
  • jbus -> j_tf_bus
  • tflegres -> res_tf_leg
  • presleg -> p_tf_leg_resisitive
  • ztot -> res_tf_system_total
  • prescp -> p_cp_resisitive
  • ritfc -> c_tf_total
  • tfleng -> len_tf_coil
  • rhotfleg -> rho_tf_leg
  • fcoolleg -> f_a_tf_cool_outboard
  • tlegav -> temp_tf_legs_outboard
  • rhocp -> rho_cp
  • arealeg -> a_tf_leg_outboard

✨ New additions


🐛 Bugs

  • The default value for rho_tf_bus was 2.62E-8 which is that of Aluminium even though the busbar assumes a copper density. It has been updated to the value of 1.86E-8 which is that of GLIDCOP AL-15 (C15715).
  • The values of frholeg and frhocp were being divded by 0.92 before multiplying the resistivity value output
  • The calculation of the outboard TF leg resistance p_tf_leg_resistance was taking the square of the total TF currents then dividing by the number of TF coils instead of dividing the total current by the number of coils then squaring the current value. This is then multiplied by the total number of TF coils to get the total TF leg resistance

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 changed the title 🔌 Tidy TF power supplies 🚧 Tidy TF power supplies Jan 13, 2025
@chris-ashe chris-ashe changed the title 🚧 Tidy TF power supplies 🚧 Tidy TF resistive Jan 13, 2025
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 13, 2025

Codecov Report

❌ Patch coverage is 38.70968% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.88%. Comparing base (6bac4f3) to head (8ce78d9).
⚠️ Report is 492 commits behind head on main.

Files with missing lines Patch % Lines
process/sctfcoil.py 51.16% 21 Missing ⚠️
process/io/plot_proc.py 7.14% 13 Missing ⚠️
process/power.py 10.00% 9 Missing ⚠️
process/stellarator.py 14.28% 6 Missing ⚠️
process/buildings.py 0.00% 3 Missing ⚠️
process/build.py 60.00% 2 Missing ⚠️
process/init.py 0.00% 2 Missing ⚠️
process/costs.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3465      +/-   ##
==========================================
- Coverage   31.21%   29.88%   -1.33%     
==========================================
  Files          81       81              
  Lines       19432    22455    +3023     
==========================================
+ Hits         6065     6710     +645     
- Misses      13367    15745    +2378     

☔ 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 self-assigned this Jan 13, 2025
@chris-ashe chris-ashe added the TF Coil Toroidal field coil label Jan 13, 2025
@chris-ashe chris-ashe force-pushed the tidy_tf_power_supplies branch from c496b13 to a213299 Compare January 15, 2025 09:10
Copy link
Copy Markdown
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 the changes made and happy for this to be merged.

Do any docs need to be updated?

@chris-ashe chris-ashe marked this pull request as ready for review January 31, 2025 13:16
@chris-ashe chris-ashe force-pushed the tidy_tf_power_supplies branch from 5d172f1 to bf95989 Compare January 31, 2025 13:22
@chris-ashe chris-ashe changed the title 🚧 Tidy TF resistive Tidy TF resistive Jan 31, 2025
Copy link
Copy Markdown
Collaborator

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

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

Code looks fine

Comment thread process/sctfcoil.py
! For some reasons these lines are needed to make VMCON CONVERGE ....
if ( i_tf_sup == 0 ) then ! Copper case
tcpav = tcpav - 273.15D0
temp_cp_average = temp_cp_average - 273.15D0
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.

I've seen you changing 273 to 293 elsewhere. Just to confirm this should be left as it.

! For some reasons these lines are needed to make VMCON CONVERGE ....
if ( i_tf_sup == 0 ) then ! Copper case
tcpav = tcpav + 273.15D0
temp_cp_average = temp_cp_average + 273.15D0
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.

"

@chris-ashe chris-ashe force-pushed the tidy_tf_power_supplies branch 2 times, most recently from 406f724 to a7fd6c8 Compare February 11, 2025 13:13
Copy link
Copy Markdown
Collaborator

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

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

Quality job on CI failing
https://github.com/ukaea/PROCESS/actions/runs/13263761673/job/37026044400?pr=3465#step:5:34

Need to rebase onto main to get fixes to Stellarator confinement time and new regression tests

@chris-ashe chris-ashe force-pushed the tidy_tf_power_supplies branch from a7fd6c8 to f3d2288 Compare February 12, 2025 13:43
Copy link
Copy Markdown
Collaborator

@timothy-nunn timothy-nunn 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 code changes

"iradloss": "i_rad_loss",
"ipnlaws": "n_confinement_scalings",
"iinvqd": None,
"n_tf": "n_tf_coils",
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.

Need to add rhotfbus, jbus, fcoolleg

@chris-ashe chris-ashe force-pushed the tidy_tf_power_supplies branch from e410b27 to 8ce78d9 Compare February 13, 2025 15:43
@timothy-nunn timothy-nunn merged commit b61a1c5 into main Feb 13, 2025
@timothy-nunn timothy-nunn deleted the tidy_tf_power_supplies branch February 13, 2025 16:04
ajpearcey pushed a commit that referenced this pull request Feb 26, 2025
* 🔄 Rename tfbusl to len_tf_bus for clarity and consistency across the codebase

* ➕ Add len_tf_bus as a input variable

* 🔄 Rename tfbusl to rho_tf_bus for clarity and consistency;  Change initial value to that of GLIDCOP copper as the current value was that of Aluminium though the mass of copper was used for the bus bar

* 🔄 Refactor tfbusmas to m_tf_bus for clarity and consistency

* 🔄 Rename n_tf to n_tf_coils for clarity and consistency across the codebase

* 🔄 Rename jbus to j_tf_bus for clarity and consistency;

* 🔄 Refactor tflegres to res_tf_leg for clarity and consistency across the codebase

* 🔄 Rename presleg to p_tf_leg_resistive for clarity and consistency;

* 🐛 Fix TF resistive power calc that used the total TF current instead of that for an individual coil

* 🔄 Rename ztot to res_tf_system_total

* 🔄 Rename prescp to p_cp_resistive for clarity and consistency across the codebase

* 🐛 Remove 0.92 fudge value to frholeg

* 🐛 Remove 0.92 fudge value from frhocp

* 🔄 Rename 'ritfc' to 'c_tf_total' for consistency across the codebase

* 🔄 Update comment for rho_tf_bus to specify GLIDCOP AL-15 as the default material

* 🐛 Refactor TF leg resistive power calculations to account for all legs

* 🔄 Rename 'tfleng' to 'len_tf_coil' for consistency across the codebase

* 🔄 Rename 'rhotfleg' to 'rho_tf_leg' for consistency across the codebase

* 🔄 Rename 'fcoolleg' to 'f_a_tf_cool_outboard' for consistency across the codebase

* 🔄 Rename 'tcpav' to 'temp_cp_average' for consistency across the codebase

* 🔄 Rename 'tlegav' to 'temp_tf_legs_outboard' for consistency across the codebase

* 🔄 Rename 'rhocp' to 'rho_cp' for consistency across the codebase

* 🔄 Rename 'arealeg' to 'a_tf_leg_outboard' for consistency across the codebase

* 🔄 Update resistive heating calculations and improve method documentation for clarity

* 🎨 Pre commit check

* 🔄 Improve documentation for resistivity parameters and add comments for clarity

* Removed undefined variable

* lint fix

* 🔄 Add new obsolete variable mappings for TF parameters

---------

Co-authored-by: Jack <jack.foster@ukaea.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants