Skip to content

Detailed plasma part 2#4088

Merged
timothy-nunn merged 15 commits intomainfrom
detailed_plasma_part_2
Feb 13, 2026
Merged

Detailed plasma part 2#4088
timothy-nunn merged 15 commits intomainfrom
detailed_plasma_part_2

Conversation

@chris-ashe
Copy link
Collaborator

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

This pull request significantly extends support for deuteron and triton species in the plasma physics module. It introduces new variables, calculations, and plotting routines for deuteron and triton thermal velocities, Coulomb logarithms, and Larmor frequencies, alongside corresponding updates to the data structure and output routines. Additionally, it refactors some core physics calculations to be more general and physically accurate.

The most important changes are:

Physics variable and calculation extensions:

  • Added new variables and calculations for deuteron and triton thermal velocities, Coulomb logarithms (electron-deuteron, electron-triton), and toroidal Larmor frequencies in physics_variables.py and their initialization in init_physics_variables() and run() methods.
  • Output routines updated to write these new variables to file, ensuring they are available for post-processing and analysis.

Physics calculation improvements:

  • Refactored the calculation of the classical distance of closest approach to use reduced mass and relative velocity, making it more general and accurate for arbitrary particle pairs.
  • Introduced helper methods for calculating reduced mass and average relative velocity between two particles, improving code clarity and reuse.

Plotting enhancements:

  • Extended plotting routines to visualize deuteron and triton velocity profiles, Larmor frequencies, and Coulomb logarithms, with clear labelling and colour coding for each species.

API and interface updates:

  • Updated function signatures and docstrings to reflect new parameters and improved clarity, particularly for plotting and physics calculation functions.

These changes collectively improve the fidelity of the plasma physics modelling for multi-species plasmas and provide better tools for analysis and visualization.

image

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 Physics Relating to the physics models New Variables labels Feb 8, 2026
@chris-ashe chris-ashe force-pushed the detailed_plasma_part_2 branch from 3e67fbb to f59f60d Compare February 12, 2026 09:11
@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 52.23881% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.57%. Comparing base (e827793) to head (d138800).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
process/io/plot_proc.py 13.04% 20 Missing ⚠️
process/physics.py 53.84% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4088      +/-   ##
==========================================
+ Coverage   46.49%   46.57%   +0.07%     
==========================================
  Files         124      124              
  Lines       28955    29042      +87     
==========================================
+ Hits        13464    13526      +62     
- Misses      15491    15516      +25     

☔ 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 12, 2026 09:53
@chris-ashe chris-ashe requested a review from a team as a code owner February 12, 2026 09:53
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.

One code comment, will await Jack's comments for anything further

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

@timothy-nunn timothy-nunn enabled auto-merge (squash) February 13, 2026 08:42
@timothy-nunn timothy-nunn merged commit 9b6c78a into main Feb 13, 2026
8 of 10 checks passed
@timothy-nunn timothy-nunn deleted the detailed_plasma_part_2 branch February 13, 2026 08:46
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