Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
:3260 update the fusion reactions section of the plasma docs to full …
…account for all models and details (#3345) * refactor: Update Fusion Reactions navigation structure * Fix some variable names for clairty * Convert physics functions to Python * Add new duterium_branching() function from Bosch-Hale to calculate the difference in D-D reactions * Update electron mass constant to use the more accurate value 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 * Update proton mass constant to use the more accurate value 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 * Add new constants for the deuteron, triton, neutron, alpha particle and helion mass. Fix broken links for the electron and proton mass * Revert variable names back to lowercase due to parsing issue with f2py * Update electron mass constant to use the more accurate value. Add new 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 * Add new constants for the speed of light, D-T reaction energy, D-3He reaction energy and both D-D reactions * Refactor bosch_hale function to use more descriptive name and update function signature * Add new constants for fusion reaction energy fractions 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. * Refactor fint() into fusion_rate_integral() to be more descriptive and make function more explicit * Refactor variable name palppv to alpha_power_density for clarity and consistency * Refactor variable name palppv to alpha_power_density for clarity and consistency * Refactor variable name pneutpv to neutron_power_density for clarity and consistency * Refactor variable names for fusion reactions in physics calculations * Refactor variable names fusionrate to fusion_rate_density * Refactor variable names for alpha particle production rate - Renamed `alpharate` variable to `alpha_rate_density` for clarity and consistency. * Refactor variable names for proton rate density in physics calculations * Refactor variable name pdd to dd_power_density for clarity and consistency * Refactor variable name pdtpv to dt_power_density for clarity and consistency * Refactor variable names for helium-3 power density in physics calculations * Refactor variable name sigvdt to sigmav_dt_average for clarity and consistency * Refactor sum_fusion_rates() to be more explicit and pythonic * Refactor set_physics_variables() to update global and module variables with fusion power densities and reaction rates * Refactor the fusion reaction function. Docstring and type hints added with internal variables renamed for clarity * Refactor the fusion reaction function. Docstring and type hints added with internal variables renamed for clarity * Implement the new reaction energies and product particle fractions from constants.f90 * Rename pdt to dt_power to be more explicit * Rename pdhe3 to dhe3_power to be more descriptive * Rename pdd to dd_power for more clarity * Rename "vol" to "plasma_volume" in multiple files to improve code readability and maintain consistency with other variable names. * Add type hints and expand docstring to palph2() * Add new variable alpha_power_plasma that represents the alpha power 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. * Rename palpnb to alpha_power_beams for more clarity and consistency * Rename "palpmw" to "alpha_power_total" for clarity and consistency * Add new variable neutron_power_plasma that represents the neutron power 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. * Rename pneutmw to neutron_power_total for more clarity and consistency * Add new variable to output called neutron_power_beams to show the breakdown of total fusion power * Rename pchargemw to non_alpha_charged_power for clarity * Add charged_particle_power as a new physics variable and add it to the output * Rename powfmw to fusion_power for clarity * Rename palpipv to alpha_power_ion_density for clarity * Rename palpepv to alpha_power_electron_density for clarity * Add alpha_power_electron_density and alpha_power_electron_density to output * Add main bulk of FusionReaction class documentation descriptions * Update BoschHale docs section * Update variable name for charged particle power in stellarator.py and physics_variables.f90 * Remove ealphadt variable for the alpha particle energy in D-T reactions. New constant dt_alpha_energy is now called from the constants file in functions * Update the variable name falpha to f_alpha_plasma for clarity and consistency * Add new atomic mass unit and kilo electron volt constant. Rename palphabm() to alpha_power_beam(). Replace use of the proton mass instead of the amu unit * Update atomic mass units for deuterium and tritium and change multiplied constant form proton mass to amu mass * Add NBI beam fusion sections to new beam_reactions.md file. Rename xbrak() to beam_energy_to_ions(). Update beam energy to ions docs * Update beam_reactions.md with NBI beam fusion sections and function name changes * Rename sgvhot() to beam_reaction_rate() * Rename _sigbmfus() to _beam_fusion_cross_section() and add to docs * Refactor the _hot_beam_fusion_reaction_rate_integrand() function to improve readability and clarity. Update the function to use more descriptive variable names and add comments for better understanding. * Refactor output.f90 format strings for improved spacing and readability * Refactor palph2() to set_fusion_powers() and update naming of variables and test names * Rename beamfus() to beam_fusion() and re-arrange beam fusion docs page * Rename cnbeam to beam_current * Rename enbeam to beam_energy * Rename ftritbm to f_tritium_beam * Rename beam_energy_to_ions() to _fast_ion_pressure_integral(). Add about derivations for beamcalc() * Updated references to `dnbeam2` to `beam_density_out` in relevant files * Rename betanb to beta_beam for consistency * Beam reactions doc page structure refactor * Rename falpe to f_alpha_electron and falpi to f_alpha_ion * Refactor variable names for fuel ion fractions * Remove the fast alpha beta contribution from set_fusion_powers() and put it into fast_alpha_beta(). neutron and alpha power densities are now split into separate plasma only and total variables. * Add image showing the deuterium branching ratio and add discussion about plasma fuelling and add warning about reactions not covered * Refactor bosch hale reactivity and replace electron with ion density * Update the dt_power, alpha_rate_density, fusion_rate_density to now has distinct total and plasma only variants * Add variables to obsolete variables dictionary and fix unit tests * Add constraint equations to docs and tidy * Revoke new outfile spacing and append fusion_power to pass integration tests * pre-commit file fix * Update Bosch-Hale documentation for clarity and consistency * Revert deni to dene to prevent profile normalisation errors * Add f_dd_branching_trit attribute and update fusion reaction calculations --------- Co-authored-by: Timothy Nunn <timothy.nunn@ukaea.uk>
- Loading branch information