Skip to content

🧲 Added plasma magnetic energy#3906

Merged
clmould merged 2 commits intomainfrom
plasma_magnetic_energy
Oct 14, 2025
Merged

🧲 Added plasma magnetic energy#3906
clmould merged 2 commits intomainfrom
plasma_magnetic_energy

Conversation

@chris-ashe
Copy link
Copy Markdown
Collaborator

This pull request introduces the calculation and tracking of plasma stored magnetic energy throughout the codebase. The main changes include adding a new variable, computing its value, and updating outputs and plots to include this information.

Addition and handling of plasma stored magnetic energy:

  • Added new variable e_plasma_magnetic_stored to physics_variables.py to represent plasma stored magnetic energy, including its initialization in init_physics_variables() and setting its default value to 0.0.
  • Computed e_plasma_magnetic_stored in the physics method as 0.5 * ind_plasma * plasma_current ** 2.

Output and visualization updates:

  • Included plasma stored magnetic energy in the output file via the outplas method, using the ovarre function to write its value.
  • Updated the main plasma information plot to display plasma stored magnetic energy (converted to GJ) alongside other plasma parameters.## 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 self-assigned this Oct 14, 2025
@chris-ashe chris-ashe added the Physics Relating to the physics models label Oct 14, 2025
@chris-ashe chris-ashe marked this pull request as ready for review October 14, 2025 12:37
@chris-ashe chris-ashe requested a review from clmould October 14, 2025 12:37
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.40%. Comparing base (9fc4b8b) to head (5aef984).

Files with missing lines Patch % Lines
process/physics.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3906   +/-   ##
=======================================
  Coverage   46.40%   46.40%           
=======================================
  Files         123      123           
  Lines       28173    28178    +5     
=======================================
+ Hits        13073    13076    +3     
- Misses      15100    15102    +2     

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

@clmould clmould merged commit a4a0028 into main Oct 14, 2025
14 of 18 checks passed
@clmould clmould deleted the plasma_magnetic_energy branch October 14, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Variables Physics Relating to the physics models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants