Skip to content

Add all ion rad contributions - #4684

Merged
timothy-nunn merged 10 commits into
mainfrom
add_all_ion_rad_contributions
Oct 16, 2026
Merged

timothy-nunn merged 10 commits into
mainfrom
add_all_ion_rad_contributions

Conversation

@chris-ashe

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

Copy link
Copy Markdown
Member

This pull request introduces detailed tracking, calculation, and visualization of plasma radiation power contributions from individual ion species and synchrotron radiation. The changes enhance both the data structure and output reporting, and add a new plot summarizing these contributions. Below are the most important changes grouped by theme:

Data Structure Enhancements:

  • Added new attributes to PhysicsData for storing the radiation power (in MW) contributed by each supported ion species (e.g., hydrogen, helium, beryllium, etc.), as well as impurity (Z>2) and synchrotron radiation fractions. This allows for fine-grained analysis and output of plasma radiation sources. [1] [2]

Computation and Output of Species Radiation Power:

  • Implemented calculate_species_radiation_powers in the ImpurityRadiation model to compute and store the volume-averaged and total radiation power for each species, and aggregate impurity contributions.
  • Added output_species_radiation_power_density and updated outplas in the main physics model to output the specific radiation power of each ion species, as well as the impurity and synchrotron fractions, to the results file. [1] [2]
  • Updated the physics run loop to calculate and store the fractions of total plasma radiation due to synchrotron, ions, and impurities.

Visualization Improvements:

  • Added a new plotting function, plot_radiation_power_contributions, to generate a horizontal bar chart summarizing the contributions of synchrotron and each ion species to the total plasma radiation power, including percentage annotations and a legend.
  • Integrated the new plot into the summary plotting API, so it appears as part of the "line_brem_power" summary page. [1] [2]
image image

Internal Consistency and Infrastructure:

  • Defined a centralized tuple, SPECIES_POWER_ATTRIBUTES, to map species labels to their corresponding attribute names, ensuring consistency between calculation and output.
  • Improved handling of temperature binning in impurity radiation calculations to use the correct table length for each species.## 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 added the Radiation Plasma radiated power label Oct 15, 2026
@chris-ashe
chris-ashe force-pushed the add_all_ion_rad_contributions branch from 2939375 to 4312540 Compare October 15, 2026 10:10
@codecov-commenter

codecov-commenter commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 44.00000% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.26%. Comparing base (dd8bbbc) to head (74713bf).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
process/core/io/plot/summary/plasma/physics.py 8.33% 22 Missing ⚠️
process/models/physics/physics.py 5.00% 19 Missing ⚠️
process/models/physics/impurity_radiation.py 22.22% 14 Missing ⚠️
process/core/io/plot/summary/api.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4684      +/-   ##
==========================================
- Coverage   50.26%   50.26%   -0.01%     
==========================================
  Files         181      181              
  Lines       30513    30627     +114     
==========================================
+ Hits        15338    15395      +57     
- Misses      15175    15232      +57     

☔ 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
chris-ashe marked this pull request as ready for review October 15, 2026 10:51
@chris-ashe
chris-ashe requested a review from a team as a code owner October 15, 2026 10:51
@chris-ashe
chris-ashe requested a review from grmtrkngtn October 15, 2026 10:51

@grmtrkngtn grmtrkngtn 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.

Since calculate_species_radiation_powers() independently recalculates the species radiation at output rather than decomposing a quantity already calculated by the main physics model, could we add a test demonstrating that the summed species contributions reproduce the existing PROCESS radiation power to numerical tolerance?

Comment thread process/models/physics/impurity_radiation.py Outdated
@chris-ashe
chris-ashe requested a review from grmtrkngtn October 16, 2026 09:32
Comment thread process/core/io/plot/summary/plasma/physics.py Outdated
@chris-ashe
chris-ashe requested a review from grmtrkngtn October 16, 2026 11:23

@grmtrkngtn grmtrkngtn 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.

Modelling changes look good - this is a useful addition to output.

@timothy-nunn timothy-nunn self-assigned this Oct 16, 2026
@timothy-nunn
timothy-nunn merged commit 39e7dcd into main Oct 16, 2026
8 of 11 checks passed
@timothy-nunn
timothy-nunn deleted the add_all_ion_rad_contributions branch October 16, 2026 13:47
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