-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚧 3260 update the fusion reactions section of the plasma docs to full account for all models and details #3345
Draft
chris-ashe
wants to merge
69
commits into
main
Choose a base branch
from
3260-update-the-fusion-reactions-section-of-the-plasma-docs-to-full-account-for-all-models-and-details
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…the-plasma-docs-to-full-account-for-all-models-and-details
…update-the-fusion-reactions-section-of-the-plasma-docs-to-full-account-for-all-models-and-details
…e difference in D-D reactions
…the-plasma-docs-to-full-account-for-all-models-and-details
chris-ashe
added
Documentation
Improvements or additions to documentation
Physics
Relating to the physics models
labels
Oct 9, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3345 +/- ##
==========================================
+ Coverage 26.65% 27.01% +0.36%
==========================================
Files 76 76
Lines 17610 17812 +202
==========================================
+ Hits 4694 4812 +118
- Misses 12916 13000 +84 ☔ View full report in Codecov by Sentry. |
The commit updates the electron mass constant in multiple files to use the more accurate value provided by the NIST. This ensures that calculations involving the electron mass are more precise. Explicitly written float values has now also been set to this variable
chris-ashe
changed the title
3260 update the fusion reactions section of the plasma docs to full account for all models and details
🚧 3260 update the fusion reactions section of the plasma docs to full account for all models and details
Oct 9, 2024
The commit updates the proton mass constant in multiple files to use the more accurate value provided by the NIST. This ensures that calculations involving the electron mass are more precise. Variable name has been changed from pmass to PROTON_MASS
…nd helion mass. Fix broken links for the electron and proton mass
…the-plasma-docs-to-full-account-for-all-models-and-details
… variable for electron_volt The commit updates the electron mass constant in multiple files to use the more accurate value provided by the NIST. This ensures that calculations involving the electron mass are more precise. Variable name has been changed from emass to electron_mass
…reaction energy and both D-D reactions
…function signature
This commit adds new constants for the energy fractions carried by neutrons and protons in various fusion reactions. These constants are used to calculate the energy released in fusion reactions involving deuterium, tritium, helium-3, and protons. The energy fractions are calculated assuming a non-relativistic center of mass frame. The following constants have been added: - dt_neutron_energy_fraction: Energy fraction carried by neutron in deuterium-tritium reaction - dd_neutron_energy_fraction: Energy fraction carried by neutron in deuterium-deuterium (helium-3 producing) reaction - dd_proton_energy_fraction: Energy fraction carried by proton in deuterium-deuterium (triton producing) reaction - dhelium_proton_energy_fraction: Energy fraction carried by proton in deuterium-helion (helium-3) reaction These constants will be used in further calculations related to fusion reactions.
…d make function more explicit
- Renamed `alpharate` variable to `alpha_rate_density` for clarity and consistency.
…er produced just by reactions in the plasma. Has been added to output to show the breakdown of the total alpha power from the plasma and NBI contribution.
…akdown of total fusion power
…the-plasma-docs-to-full-account-for-all-models-and-details
… physics_variables.f90
…ns. New constant dt_alpha_energy is now called from the constants file in functions
…habm() to alpha_power_beam(). Replace use of the proton mass instead of the amu unit
…ied constant form proton mass to amu mass
…rak() to beam_energy_to_ions(). Update beam energy to ions docs
…mprove readability and clarity. Update the function to use more descriptive variable names and add comments for better understanding.
…es and test names
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes multiple changes across various documentation files and source code to improve the clarity and accuracy of the fusion reaction models and related constants. The most important changes include renaming variables for consistency, adding detailed documentation for fusion reaction methods, and updating references to reflect these changes.
Documentation Enhancements:
documentation/proc-pages/physics-models/fusion_reactions/beam_reactions.md
: Added detailed sections on NBI Fusion, including derivations and equations for beam fusion cross-section, reaction rates, and power.documentation/proc-pages/physics-models/fusion_reactions/plasma_reactions.md
: Added detailed documentation for fusion reactions, including initialization, calculation methods, and attributes.documentation/proc-pages/physics-models/fusion_reactions/plasma_bosch_hale.md
: Added new documentation for Bosch-Hale methods and constants used in fusion reaction calculations.Navigation and Organization:
mkdocs.yml
: Updated the navigation structure to include a more detailed breakdown of fusion reactions, separating the overview and Bosch-Hale methods.Bugs 🐛
The value for the mass of deuterium (
ATOMIC_MASS_DEUTERIUM
) and tritium (ATOMIC_MASS_TRITIUM
) in atomic mass units was in correctly given and then multiplied by the mass of the proton instead of the atomic mass unit value inphysics_functions.py
.One of the term values in
beam_energy_to_ions()
used an approximate value which is now calculated directlyThe
_hot_beam_fusion_reaction_rate_integrand()
was using proton mass instead of atomic mass unitNew features
The fusion energies and reaction product energy branching ratios have been enhanced with more precise variables and are calculated implicitly
Code cleanup and test updates ♻️ :
OUT.DAT
and variable name widths have been widened to allow for more variable name space and labelsNamespace changes
Constants
Several constants in
constants.f90
have been made more verbose. Sadly they have not been able to be put into all uppercase form to be more Pythonic (PEP8).This is due to a parsing problem with f2py. The values have also been made more precise by taking values from NIST (https://physics.nist.gov/cuu/Constants/index.html). Comments are now also above the constants with link references to their values.Some changes below are:
emass
->electron_mass
; Value:9.10938370D-31
->9.1093837139D-31
. This new value has been applied to explicitly written floats incfnbi()
andeccdef()
. This has been updated in the docs alsopmass
->proton_mass
; Value:1.6726231D-27
->1.67262192595D-27
.echarge
->electron_charge
; Value1.60217733D-19
->1.602176634D-19
.New additions:
deuteron_mass
,triton_mass
,neutron_mass
,alpha_mass
,helion_mass
.speed_light
electron_volt
: This new value has been applied to explicitly written floats ineccdef()
,acc2272()
. This has been updated in the docs also. This has been added to be more syntactically correct when working with energy units instead of just callingkiloelectron_volt
: This has been added as a lot of conversions would previously multiply by1000.0
across the code. This should increase readability.atomic_mass_unit
: Lots of functions are calling different fundamental mass values that are close but not technically correct, this is added to correct these errors.electron_charge
d_t_energy
,d_helium_energy
,dd_helium_energy
,dd_triton_energy
. These are the reaction energy constants and are calculated implicitly from the mass differences of products and reactantsdt_alpha_energy
. This is created to compliment the removal ofealphadt
from the variables listdt_neutron_energy_fraction
,dd_neutron_energy_fraction
,dd_proton_energy_fraction
,dhelium_proton_energy_fraction
. These are the calculated fractions my mass difference of the shared reaction energy between the fusion products.alpha_power_plasma
: This is a new output file variable to differentiate between the alpha power from the plasma and that from beams.neutron_power_plasma
: This is a new output file variable to differentiate between the neutron power from the plasma and that from beams.neutron_power_beams
: This is a new output file variable to differentiate between the neutron power from the plasma and that from beams.Functions
Re-named to be more descriptive about what the function does
bosch_hale()
->bosch_hale_reactivity()
fint()
->fusion_rate_integral()
dt()
->dt_reaction()
dhe3()
->dhe3_reaction()
dd1()
->dd_helion_reaction()
dd2()
->dd_triton_reaction()
palphabm()
->alpha_power_plasma()
xbrak()
->beam_energy_to_ions()
sgvhot()
->beam_reaction_rate()
_sigbmfus()
->_beam_fusion_cross_section()
palph2()
->set_fusion_powers()
beamfus() ->
beam_fusion()`Variables
A handful of variables are not quite descriptive/explicit enough in their naming and tend to lead to misinterpretation if it presents a per unit volume or a total value. Thus the following internal variables have been changed:
palppv
->alpha_power_density
pchargepv
->charged_power_density
pneutpv
->neutron_power_density
fusionrate
->fusion_rate_density
alpharate
->alpha_rate_density
protonrate
->proton_rate_density
pddpv
->dd_power_density
pdtpv
->dt_power_density
pdhepv
->dhe3_power_density
sigvdt
->sigmav_dt_average
pdt
->dt_power
pdhe3
->dhe3_power
pdd
->dd_power
palpnb
->alpha_power_beams
palpmw
->alpha_power_total
pneutmw
->neutron_power_total
pchargemw
->non_alpha_charged_power
. This was a misleading name as it doesn't account for alphas so was re-namedpfuscmw
->charged_particle_power
: This is a new output file variable which is now added tophysics_variables.f90
It was output bypalph2()
but was never written to output. It now is.palpipv
-> alpha_power_ion_density`. This variable has now also been added to the outputpalpepv
-> alpha_power_electron_density`. This variable has now also been added to the outputcnbeam
->beam_current
enbeam
->beam_energy
ftritbm
->f_tritium_beam
vol
->plasma_volume
. This was changed due to conflicting understanding depending on the context of the module and to make it easier to search and find.powfmw
->fusion_power
falpha
->f_alpha_plasma
. Docs section created showing origin of default value.Removals
ealphadt
. Removed as it was a constants value, though down as an input variable. Replaced bydt_alpha_energy
constant.Checklist
I confirm that I have completed the following checks: