Skip to content

Create plasma exhaust class#4096

Open
chris-ashe wants to merge 11 commits intomainfrom
create_plasma_exhaust_class
Open

Create plasma exhaust class#4096
chris-ashe wants to merge 11 commits intomainfrom
create_plasma_exhaust_class

Conversation

@chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Feb 12, 2026

This pull request introduces a new PlasmaExhaust class to encapsulate plasma exhaust calculations and refactors the codebase to use this class for computing key divertor and separatrix power metrics. It also updates variable names and output handling for consistency and clarity, and updates related plotting and metadata. The changes improve modularity and maintainability of the plasma physics calculations, and ensure that important exhaust-related metrics are consistently calculated and reported.

Core Physics Refactor and New Calculations

  • Introduced the new PlasmaExhaust class (process/models/physics/exhaust.py) to handle calculations for separatrix power, separatrix power per major radius, and the EU DEMO divertor protection metric, with references and documentation for each calculation.
  • Refactored the Physics class (process/models/physics/physics.py) to use the new PlasmaExhaust class for all relevant calculations, updating the initialization and the main physics routine to delegate to PlasmaExhaust methods.

Variable and Output Handling

  • Added new variables to physics_variables.py for the new metrics (p_plasma_separatrix_rmajor_mw, p_div_bt_q_aspect_rmajor_mw), updated their initialization, and ensured they are included in the variable setup.
  • Updated output routines to use the new variable names and calculations for reporting separatrix/divertor power metrics, ensuring consistent output and variable naming.

Plotting and Metadata

  • Updated plotting code to use the new variable names for separatrix/divertor power metrics in plot_proc.py.
  • Updated variable metadata to reflect the new variable names and latex descriptions.

Testing

  • Updated unit tests to import and use the new PlasmaExhaust class in both tokamak and stellarator test suites, ensuring the new structure is tested.

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 force-pushed the create_plasma_exhaust_class branch from a4ce96b to 87e20e8 Compare February 26, 2026 13:02
@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 78.57143% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.91%. Comparing base (4741c15) to head (7eeb9de).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
process/models/physics/exhaust.py 81.25% 3 Missing ⚠️
process/models/physics/physics.py 50.00% 2 Missing ⚠️
process/main.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4096      +/-   ##
==========================================
+ Coverage   46.88%   46.91%   +0.02%     
==========================================
  Files         136      137       +1     
  Lines       29253    29280      +27     
==========================================
+ Hits        13715    13736      +21     
- Misses      15538    15544       +6     

☔ 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 marked this pull request as ready for review February 26, 2026 14:51
@chris-ashe chris-ashe requested a review from a team as a code owner February 26, 2026 14:51
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.

2 participants