Skip to content

Particle balance constraint#4139

Open
chris-ashe wants to merge 42 commits into
mainfrom
particle_balance_constraint
Open

Particle balance constraint#4139
chris-ashe wants to merge 42 commits into
mainfrom
particle_balance_constraint

Conversation

@chris-ashe

@chris-ashe chris-ashe commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces significant improvements to the plasma fuelling model, including new documentation, expanded input variables, and updates to output data and plotting routines. The changes enhance the clarity, flexibility, and scientific accuracy of plasma fuelling calculations and reporting.

Key changes include:

1. Plasma Fuelling Model Documentation and Inputs

  • Added a comprehensive new documentation page (plasma_fuelling.md) describing the plasma fuelling model, governing equations, constraints, and references. This improves transparency and usability for end users.
  • Introduced several new input variables in process/core/input.py to support detailed plasma fuelling modeling, including recycling fractions, fuelling efficiency, injected rates, and fuel species fractions.

2. Output Data and Variable Naming

  • Updated output files for several example tokamak cases to change the burn-up fraction variable name from burnup to f_plasma_fuel_burnupma_fuel_burnup for clarity and consistency.

3. Plotting and Reporting Enhancements

  • Improved the main plasma information and fusion rate plots to use the new variable names and provide more precise outputs (e.g., more significant digits for power, updated units for densities, and inclusion of additional fusion rate details).
  • Added the new plasma fuelling documentation page to the MkDocs navigation for easier access.

4. Constants and Codebase Maintenance

  • Defined AVOGADRO_NUMBER in process/core/constants.py for scientific consistency and future use.
  • Removed the unused or deprecated tauratio input variable to clean up the codebase.

5. Internal Model Integration

  • Imported the new PlasmaFuelling model into the plotting module to enable future extensions and tighter integration of the fuelling model with data visualization.

These changes collectively improve the accuracy, documentation, and maintainability of the plasma fuelling model and its associated outputs.## 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 Physics Relating to the physics models Plotting labels Mar 23, 2026
@chris-ashe chris-ashe force-pushed the particle_balance_constraint branch 2 times, most recently from 1397135 to 7687c7b Compare March 31, 2026 09:25
@chris-ashe chris-ashe marked this pull request as ready for review March 31, 2026 09:27
@chris-ashe chris-ashe requested a review from a team as a code owner March 31, 2026 09:28
@chris-ashe chris-ashe requested a review from jonmaddock March 31, 2026 09:28
@chris-ashe

Copy link
Copy Markdown
Collaborator Author

Opening this up now just to get the ball rolling with the review. @jonmaddock a discussion should be had about how we implement this into the regression tests, e.g is the 4 balance constraints always on as default

@jonmaddock

Copy link
Copy Markdown
Contributor

As this is contingent on the wider "solution mode" work going in (which I am currently working on), I am converting this to a draft until that is merged.

@jonmaddock jonmaddock marked this pull request as draft April 20, 2026 15:11
@chris-ashe chris-ashe force-pushed the particle_balance_constraint branch 3 times, most recently from 1dd8c7f to 49236ad Compare June 2, 2026 09:39
@chris-ashe chris-ashe force-pushed the particle_balance_constraint branch 2 times, most recently from 40ad502 to b37ac1f Compare June 17, 2026 12:58
@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 32.65993% with 200 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.81%. Comparing base (d84e9dd) to head (3e5c5fd).

Files with missing lines Patch % Lines
process/core/io/plot/summary.py 4.13% 139 Missing ⚠️
process/models/physics/fuelling.py 43.54% 35 Missing ⚠️
process/models/physics/physics.py 5.55% 17 Missing ⚠️
process/core/solver/constraints.py 82.60% 4 Missing ⚠️
process/models/physics/fusion_reactions.py 0.00% 3 Missing ⚠️
process/core/scan.py 0.00% 1 Missing ⚠️
process/models/stellarator/stellarator.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4139      +/-   ##
==========================================
- Coverage   48.86%   48.81%   -0.06%     
==========================================
  Files         151      152       +1     
  Lines       29461    29671     +210     
==========================================
+ Hits        14397    14484      +87     
- Misses      15064    15187     +123     

☔ 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 force-pushed the particle_balance_constraint branch 2 times, most recently from 0d49bab to 43e8f8c Compare June 17, 2026 13:15
@chris-ashe chris-ashe added Variable rename Input/Output Files Issues related to the input and output data files labels Jun 17, 2026
@chris-ashe chris-ashe marked this pull request as ready for review June 17, 2026 14:50
@chris-ashe chris-ashe requested a review from j-a-foster June 17, 2026 15:02
@chris-ashe chris-ashe force-pushed the particle_balance_constraint branch 2 times, most recently from 90086ef to 37c5d94 Compare June 17, 2026 15:36
… rate parameters, and update plotting functions for alpha particle flow rate and fusion DT rate.
…ple files and update related calculations and tests
…iles and update related calculations and tests
…ated plotting functions for tritium, deuterium, and alpha particle flow rates
…uel burnup fraction computation across models
…ing class and update plotting function calls for consistency
…uelling_required' and update references to 'molflow_plasma_fuelling_vv_injected' across models and tests
…ficiency and recycling coefficient, and introduce METIS Alpha Confinement model
… for tritium, deuterium, helium-3, and alpha particle balances
…clarify recycling coefficient, and introduce fuel burnup fraction equations
@chris-ashe chris-ashe force-pushed the particle_balance_constraint branch from 37c5d94 to 3e5c5fd Compare June 17, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Input/Output Files Issues related to the input and output data files Physics Relating to the physics models Plotting Variable rename

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants