Skip to content
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

3385 Update the plasma composition docs to include all new models #3386

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Nov 8, 2024

Description

This PR was originally meant to cover the radiation section of the code as well but will be put into a separate issue to prevent conflicts.

  • zeffai now added to output.

Namespace changes

Functions

  • radpwr() -> calculate_radiation_powers()

Variables

Plasma Composition

  • afuel -> m_fuel_amu: This has now been added to output
  • abeam -> m_beam_amu: This has now been added to output
  • dnalp -> nd_alphas
  • dnprot -> nd_protons
  • protium -> f_nd_protium_electrons
  • dnbeam -> nd_beam_ions
  • dnitot -> nd_ions_total
  • dnz -> nd_impurities
  • aion -> m_ions_total_amu
  • ralpne -> f_nd_alpha_electron
  • rnbeam -> f_nd_beam_electron
  • deni -> nd_fuel_ions

⚡ Radiation

  • pradpv -> pden_plasma_rad_mw
  • pradmw -> p_plasma_rad_mw
  • peakfactrad -> f_fw_rad_max
  • pouterzoneradmw -> p_plasma_outer_rad_mw
  • pinnerzoneradmw -> p_plasma_inner_rad_mw
  • photon_wall -> pflux_fw_rad_mw
  • peakradwallload -> pflux_fw_rad_max_mw
  • psyncpv -> pden_plasma_sync_mw
  • ssync -> f_sync_reflect

✨ New additions

The new constants have been added to constants.f90 for the different fuel species atomic masses from NIST. These updated mass values caused the plasma composition and first wall heating unit tests to fail.

  • m_deuteron_amu: 2.0 -> 2.013553212544
  • m_helion_amu: 3.0 -> 3.014932246932
  • m_triton_amu: 3.0 -> 3.01550071597
  • m_alpha_amu: 4.0 -> 4.001506179129
  • m_proton_amu:1.0 -> 1.0072764665789

The ATOMIC_MASS_DEUTERIUM and ATOMIC_MASS_TRITIUM local variables in physics_functions.py has been replaced with the values above.

The same has been done for the impurity species taking in impurity_radiation.py:

  • m_protium_amu: 1.01 -> 1.00782503223
  • m_helium_amu: 4.003 -> 4.002602
  • m_beryllium_amu: 9.01 -> 9.0121831
  • m_carbon_amu: 12.01 -> 12.0096
  • m_nitrogen_amu: 14.01 -> 14.00643
  • m_oxygen_amu: 15.999 -> 15.99903
  • m_neon_amu: 20.18 -> 20.1797
  • m_silicon_amu: 28.09 -> 28.084
  • m_argon_amu: 39.95 -> 39.948
  • m_iron_amu: 55.85 -> 55.845
  • m_nickel_amu: 58.70 -> 58.6934
  • m_krypton_amu: 83.80 -> 83.798
  • m_xenon_amu: 131.30 -> 131.293
  • m_tungsten_amu: 183.85 -> 183.84

🐛 Bugs

  • In psync_albajar_fidone() the temperature profile parameter tbeta was not used as intended by the model authors but was just fixed to a value of 2.0.
  • In psync_albajar_fidone() the plasma elongation kappa is not given to the function as intded, instead it was calculated internally as follows:
kap = physics_variables.plasma_volume / (
        2.0e0 * np.pi**2 * physics_variables.rmajor * physics_variables.rminor**2
    )
  • In the calculation of the density weighted mass of all ions in plasma_composition() the proton density was not multiplied by its true mass value and was just set to 1.0.
  • Calculation the mass-weighted effective charge (zeffai) did not use the true masses of the particles in atomic mass units. Impleneting the true masses causes a change in unit tests as such:
Obtained: 0.43056686748101997
Expected: 0.4325898512799211 ± 4.3e-07

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.

@chris-ashe chris-ashe linked an issue Nov 8, 2024 that may be closed by this pull request
@chris-ashe chris-ashe changed the title 3385 update the plasma composition docs to include all new models 🚧 3385 update the plasma composition docs to include all new models Nov 8, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 34.09091% with 87 lines in your changes missing coverage. Please review.

Project coverage is 30.41%. Comparing base (04b487e) to head (c5c962b).

Files with missing lines Patch % Lines
process/physics.py 47.27% 29 Missing ⚠️
process/stellarator.py 0.00% 18 Missing ⚠️
process/io/sankey_funcs.py 0.00% 10 Missing ⚠️
process/physics_functions.py 52.38% 10 Missing ⚠️
process/current_drive.py 11.11% 8 Missing ⚠️
process/io/plot_proc.py 0.00% 5 Missing ⚠️
process/power.py 0.00% 2 Missing ⚠️
process/dcll.py 66.66% 1 Missing ⚠️
process/divertor.py 0.00% 1 Missing ⚠️
process/init.py 66.66% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3386   +/-   ##
=======================================
  Coverage   30.41%   30.41%           
=======================================
  Files          80       80           
  Lines       19389    19373   -16     
=======================================
- Hits         5897     5893    -4     
+ Misses      13492    13480   -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chris-ashe chris-ashe force-pushed the 3385-update-the-plasma-composition-docs-to-include-all-new-models branch from 229400e to 80e5a83 Compare January 7, 2025 15:18
@chris-ashe chris-ashe added Documentation Improvements or additions to documentation Impurities Plasma impurities labels Jan 7, 2025
@chris-ashe chris-ashe force-pushed the 3385-update-the-plasma-composition-docs-to-include-all-new-models branch 2 times, most recently from d0adab7 to b24d113 Compare January 8, 2025 11:21
@chris-ashe chris-ashe changed the title 🚧 3385 update the plasma composition docs to include all new models 🚧 3385 Update the plasma composition and radiation docs to include all new models Jan 8, 2025
@chris-ashe chris-ashe force-pushed the 3385-update-the-plasma-composition-docs-to-include-all-new-models branch from c98dec3 to e4c93b2 Compare January 24, 2025 14:45
@chris-ashe chris-ashe changed the title 🚧 3385 Update the plasma composition and radiation docs to include all new models 🚧 3385 Update the plasma composition docs to include all new models Jan 24, 2025
@chris-ashe chris-ashe marked this pull request as ready for review January 24, 2025 14:55
@chris-ashe chris-ashe changed the title 🚧 3385 Update the plasma composition docs to include all new models 3385 Update the plasma composition docs to include all new models Jan 24, 2025
@chris-ashe chris-ashe self-assigned this Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Impurities Plasma impurities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the plasma composition docs to include all new models
2 participants