Skip to content

4193 revamp beam fusion calculations#4200

Open
grmtrkngtn wants to merge 24 commits intomainfrom
4193-revamp-beam_fusion-calculations
Open

4193 revamp beam fusion calculations#4200
grmtrkngtn wants to merge 24 commits intomainfrom
4193-revamp-beam_fusion-calculations

Conversation

@grmtrkngtn
Copy link
Copy Markdown
Collaborator

@grmtrkngtn grmtrkngtn commented Apr 17, 2026

Description

Refactored beam_fusion model.

The model now directly computes beam alpha power from:

  • fast beam ion density (from a slowing-down model)
  • beam-weighted thermal target density
  • beam-target fusion reactivity
  • plasma volume

The previous thermal reactivity correction (Bosch-Hale) has been removed.

This was not physically consistent:

  • thermal fusion involves two Maxwellian populations

  • beam-target fusion involves one fast population and one thermal population

  • the beam reactivity already includes fast-ion averaging

  • See the docs for outline of the routine. I haven't changed much else of the physics but it's been listed more clearly in the docs in the new functional form.

  • Most of the changes are clarifying what each function is actually calculating and changing docstring and name accordingly.

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.

@grmtrkngtn grmtrkngtn requested a review from a team as a code owner April 17, 2026 15:35
@grmtrkngtn grmtrkngtn linked an issue Apr 17, 2026 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.12%. Comparing base (25b9f07) to head (a6e43d8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4200      +/-   ##
==========================================
+ Coverage   52.10%   52.12%   +0.01%     
==========================================
  Files         148      148              
  Lines       30389    30401      +12     
==========================================
+ Hits        15835    15847      +12     
  Misses      14554    14554              

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

@grmtrkngtn grmtrkngtn requested a review from chris-ashe April 17, 2026 15:44
Copy link
Copy Markdown
Collaborator

@je-cook je-cook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just comments on code and docstrings. I havent reviewed the model changes

Comment thread tests/unit/models/physics/test_fusion_reactions.py Outdated
Comment thread process/models/physics/fusion_reactions.py Outdated
Comment thread process/models/physics/fusion_reactions.py Outdated
Comment thread process/models/physics/fusion_reactions.py Outdated
Comment thread process/models/physics/fusion_reactions.py Outdated
Comment thread process/models/physics/fusion_reactions.py
Comment thread process/models/physics/fusion_reactions.py Outdated
@je-cook je-cook self-assigned this Apr 20, 2026
Copy link
Copy Markdown
Collaborator

@je-cook je-cook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewise happy, leaving the model thoughts to @chris-ashe

Copy link
Copy Markdown
Collaborator

@chris-ashe chris-ashe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the mathematics in the docs is not rendering and the links are broken.

Just use

$$

<math_block>

$$

Will review the rest once I can see the equations

Comment thread documentation/source/physics-models/fusion_reactions/beam_reactions.md Outdated
Comment thread documentation/source/physics-models/fusion_reactions/beam_reactions.md Outdated
Comment thread documentation/source/physics-models/fusion_reactions/beam_reactions.md Outdated
Comment thread documentation/source/physics-models/fusion_reactions/beam_reactions.md Outdated
Comment thread documentation/source/physics-models/fusion_reactions/beam_reactions.md Outdated
Comment thread documentation/source/physics-models/fusion_reactions/beam_reactions.md Outdated
@grmtrkngtn
Copy link
Copy Markdown
Collaborator Author

All of the mathematics in the docs is not rendering and the links are broken.

Just use

$$

<math_block>

$$

Will review the rest once I can see the equations

image

It's rendering for me when I view the file on github. Could you show me what you're seeing?

Copy link
Copy Markdown
Collaborator

@chris-ashe chris-ashe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some CS changes from another branch have creeped in. I also cant get the summary file to plot. It just hangs.

Comment thread process/models/physics/fusion_reactions.py
* beam_deposited_energy
* beam_state.nd_beam_hot
* beam_state.e_beam_deposited_kev
/ (b_plasma_toroidal_on_axis**2 + b_plasma_poloidal_average**2)
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.

Just thinking if this is actually meant be the total field given by $\sqrt{B^2 + B^2}$?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the denominator? It's supposed to be $B^{2}$

$\beta = \frac{2 \mu_0 p}{B^2}$

Where B is the total magnetic field

Comment thread process/models/build.py Outdated
Comment thread process/models/pfcoil.py Outdated
Comment thread documentation/source/physics-models/fusion_reactions/beam_reactions.md Outdated
Comment thread documentation/source/physics-models/fusion_reactions/beam_reactions.md Outdated
Comment thread documentation/source/physics-models/fusion_reactions/beam_reactions.md Outdated
@grmtrkngtn grmtrkngtn force-pushed the 4193-revamp-beam_fusion-calculations branch from 1e7c095 to b657973 Compare April 27, 2026 12:48
@grmtrkngtn grmtrkngtn force-pushed the 4193-revamp-beam_fusion-calculations branch from b657973 to f147f3a Compare April 27, 2026 12:48
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.

Revamp beam_fusion calculations

4 participants