Skip to content

4163 inconsistent bosch hale correction in beam fusion calculation#4164

Open
grmtrkngtn wants to merge 26 commits intomainfrom
4163-inconsistent-bosch-hale-correction-in-beam-fusion-calculation
Open

4163 inconsistent bosch hale correction in beam fusion calculation#4164
grmtrkngtn wants to merge 26 commits intomainfrom
4163-inconsistent-bosch-hale-correction-in-beam-fusion-calculation

Conversation

@grmtrkngtn
Copy link
Copy Markdown
Collaborator

@grmtrkngtn grmtrkngtn commented Apr 7, 2026

Description

The beam fusion model is used to calculation fusion power from beam/plasma interactions.

beam_fusion() -> beamcalc() -> alpha_power_beam() -> bosch_hale_reactivity()

bosch_hale_reactivity should be passed a profile, currently it is passed a volume averaged temperature.

This results in a much higher value of beam_fusion being calculated than might be expected and is inconsistent with the way the function should work according to its own doc-string and reference..

This is also inconsistent with how the calculation is done elsewhere in the code, where fusion_rate_integral() is used.

This affects a correction ratio for the reactivity in alpha_power_beam() and has a significant impact on the beam fusion power calculated by PROCESS.

To amend this, we should pass in an ion temperature profile directly; and integrate this as is done elsewhere in the code, and use this integral to calculate the correction ratio.

With this change PROCESS now produces a beam fusion power in line with another code - METIS - for a machine of similar size and operation.

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 7, 2026 15:37
@grmtrkngtn grmtrkngtn linked an issue Apr 7, 2026 that may be closed by this pull request
@chris-ashe chris-ashe self-assigned this Apr 8, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.55%. Comparing base (09c52f5) to head (4b7d80e).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4164      +/-   ##
==========================================
+ Coverage   48.04%   49.55%   +1.51%     
==========================================
  Files         144      148       +4     
  Lines       30211    29736     -475     
==========================================
+ Hits        14515    14736     +221     
+ Misses      15696    15000     -696     

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


- J. W. Sheffield, “The physics of magnetic fusion reactors,” vol. 66, no. 3, pp. 1015-1103,
Jul. 1994, doi: https://doi.org/10.1103/revmodphys.66.1015.
- J. W. Sheffield, “The physics of magnetic fusion reactors,”
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.

Can I ask that the clickable DOI link is preserved

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.

Added

fusion_rate_integral(
plasma_profile,
BoschHaleConstants(**REACTION_CONSTANTS_DT),
),
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.

I am confused as to how this is different from what was already being done. Also have you weighted the densities and temperatures to match those for the ions and not the electrons?

# Calculate the fusion reaction rate integral using Simpson's rule
        sigmav = integrate.simpson(
            fusion_rate_integral(self.plasma_profile, dt),
            x=self.plasma_profile.neprofile.profile_x,
            dx=self.plasma_profile.neprofile.profile_dx,
        )

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.

We aren't changing the assumption about the ion temperature and density profiles. In the old version and the new version they are both scaled by the volume averaged quantities (is there a better way to do this?)

The real change of this PR is:

      ratio = (
          sigmav_dt
          / bosch_hale_reactivity(
              np.array([temp_plasma_ion_vol_avg_kev]),
              BoschHaleConstants(**REACTION_CONSTANTS_DT),
          ).item()
      )

We were passing volume average temp instead of the profile.

# and the Bosch-Hale reactivity evaluated with the same profile integral.
sigmav_dt_correction = sigmav_dt_average / bh_profile_average

hot_deuterium_rate = 1e-4 * beam_reaction_rate(
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.

Why 1e-4 in these cases?

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.

I am not sure to be honest, this is from the old code not something I introduced. I'll take a look into it.

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.

I believe it's to convert from cm^{2} to m^{2}.

_beam_fusion_cross_section outputs in cm^{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.

Ah ok, Can I ask that the variable name is changed to represent what it really is. Looking at the docstring of beam_reaction_rate it says it gives out float: Hot beam fusion reaction rate (m^3/s).. In this case the fusden_ prefix should be used. Also if it actually in per cm cubed then please add _cm to the end of the name

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.

I've moved this conversion into the beam_reaction_rate function. I think this is better as it now outputs SI units. Also updated the docstring.

range of beam velocities up to the critical velocity.

References:
- H.-S. Bosch and G. M. Hale, “Improved formulas for fusion cross-sections and thermal reactivities,”
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.

Why have references been removed

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.

Mistake, I've added them back in.

@timothy-nunn
Copy link
Copy Markdown
Collaborator

Once @chris-ashe approves I will check this out and do a code review

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.

Looks good logically. Are we not adding the profile correction for the beam width? Should be easy enough to do.

The docs also need to be updated.

I am not asking to replace everything, but can new variables you add please follow the style guide

# and the Bosch-Hale reactivity evaluated with the same profile integral.
sigmav_dt_correction = sigmav_dt_average / bh_profile_average

hot_deuterium_rate = 1e-4 * beam_reaction_rate(
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.

Ah ok, Can I ask that the variable name is changed to represent what it really is. Looking at the docstring of beam_reaction_rate it says it gives out float: Hot beam fusion reaction rate (m^3/s).. In this case the fusden_ prefix should be used. Also if it actually in per cm cubed then please add _cm to the end of the name

constants.M_TRITON_AMU, tritium_critical_energy_speed, e_beam_kev
)

deuterium_beam_alpha_power = alpha_power_beam(
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.

As per style guide. p_beam_deuterium_dt is the recommended name`

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.

Resolved.

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.

i changed hot_deuterium_rate to sigv_beam_deuterium. It's not a fusion density so I don't think fusden is right.

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.

I changed quite a few additional variable names

@grmtrkngtn
Copy link
Copy Markdown
Collaborator Author

grmtrkngtn commented Apr 10, 2026

Looks good logically. Are we not adding the profile correction for the beam width? Should be easy enough to do.

I would prefer to keep this PR for the correction + refactor, then make a separate issue for the beam width (new phyiscs)

@grmtrkngtn
Copy link
Copy Markdown
Collaborator Author

The docs also need to be updated.

Updated the docs now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent Bosch-Hale correction in beam fusion calculation

4 participants