4163 inconsistent bosch hale correction in beam fusion calculation#4164
4163 inconsistent bosch hale correction in beam fusion calculation#4164grmtrkngtn wants to merge 26 commits intomainfrom
Conversation
Pass plasma profiles to the beam fusion power calculation to ensure consistent reactivity evaluation.
…cstrings. Passed plasma_profile. Renamed and refactored beamcalc()
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
|
||
| - 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,” |
There was a problem hiding this comment.
Can I ask that the clickable DOI link is preserved
| fusion_rate_integral( | ||
| plasma_profile, | ||
| BoschHaleConstants(**REACTION_CONSTANTS_DT), | ||
| ), |
There was a problem hiding this comment.
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,
)There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Why 1e-4 in these cases?
There was a problem hiding this comment.
I am not sure to be honest, this is from the old code not something I introduced. I'll take a look into it.
There was a problem hiding this comment.
I believe it's to convert from cm^{2} to m^{2}.
_beam_fusion_cross_section outputs in cm^{2}
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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,” |
There was a problem hiding this comment.
Why have references been removed
There was a problem hiding this comment.
Mistake, I've added them back in.
|
Once @chris-ashe approves I will check this out and do a code review |
chris-ashe
left a comment
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
As per style guide. p_beam_deuterium_dt is the recommended name`
There was a problem hiding this comment.
i changed hot_deuterium_rate to sigv_beam_deuterium. It's not a fusion density so I don't think fusden is right.
There was a problem hiding this comment.
I changed quite a few additional variable names
I would prefer to keep this PR for the correction + refactor, then make a separate issue for the beam width (new phyiscs) |
… commented. updated function call and tests. renamed hot_deuterium_rate to sigv_beam_deuterium
Updated the docs now |
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: