Skip to content

Conversation

@ym1906
Copy link
Collaborator

@ym1906 ym1906 commented Feb 9, 2026

Description

Updates pfpwr equation to account for additional components in pf power management: busbar, power supply and storage system.

  1. We have added separate functions to calculate the power loss for each component.
  2. pfpwr has been adapted to use these new functions to account for the pf power supply - previously they were lumped into one value.
  3. A mild refactor of pfpwr function (modularising it a bit, renaming some variables)

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.

@ym1906 ym1906 requested a review from a team as a code owner February 9, 2026 16:07
@ym1906 ym1906 linked an issue Feb 9, 2026 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.53%. Comparing base (0078bb3) to head (1b908dd).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4089      +/-   ##
==========================================
+ Coverage   46.46%   46.53%   +0.06%     
==========================================
  Files         122      124       +2     
  Lines       28838    28965     +127     
==========================================
+ Hits        13401    13480      +79     
- Misses      15437    15485      +48     

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

@ym1906
Copy link
Collaborator Author

ym1906 commented Feb 10, 2026

@j-a-foster I've pushed my changes here for your review

@chris-ashe chris-ashe self-requested a review February 10, 2026 10:31
Copy link
Collaborator

@chris-ashe chris-ashe left a comment

Choose a reason for hiding this comment

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

Noticing quite a few large regression changes. Have made some initial minor comments

Unsurprisingly it has changed the PF power profile, though has it changed the PF current profile diagram in plot_proc?

This is the standard inductive energy expression:

$$
E = \frac{1}{2} I^T M I
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the superscript T in this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It represents the transpose of the vector of currents


$$
ELoss_{ps,n} =
\frac{k_{ps}}{2}
Copy link
Collaborator

Choose a reason for hiding this comment

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

$k_{ps}$ and $k_{s}$ are both defined in this section. I'm assuming $k_{ps}$ is the power supply efficiency?. Make sure one is chosen and that subscript italics are removed if it is non-iterable

Copy link
Collaborator

Choose a reason for hiding this comment

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

$k_s$ is the energy storage % loss and $k_{ps}$ is the power supply % loss so both are needed.

@timothy-nunn timothy-nunn self-assigned this Feb 10, 2026
@timothy-nunn timothy-nunn requested a review from mkovari February 10, 2026 14:14
@timothy-nunn
Copy link
Collaborator

I'll add @mkovari to review since he made the original issue

@j-a-foster
Copy link
Collaborator

Should've fixed all subscripts in docs now.

Copy link
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.

Mainly comments on index names

Comment on lines 302 to 304
# pfcoil_variables.n_pf_cs_plasma_circuits : total number of PF coils (including Central Solenoid and plasma)
# plasma is #n_pf_cs_plasma_circuits, and Central Solenoid is #(pfcoil_variables.n_pf_cs_plasma_circuits-1)
# plasma is #n_pf_cs_plasma_circuits, and Central Solenoid is #(pfcoil_variables.n_pf_cs_plasma_circuits-1)
# pfcoil_variables.ind_pf_cs_plasma_mutual(i,j) : mutual inductance between coil i and j
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove the dead code while we are making edits here

Copy link
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.

Thanks Graeme. Happy with the code, will approve and merge when the others reviewers are happy.

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.

PF power supplies accounting 2

5 participants