-
Notifications
You must be signed in to change notification settings - Fork 18
3385 Update the plasma composition docs to include all new models #3386
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
Merged
timothy-nunn
merged 48 commits into
main
from
3385-update-the-plasma-composition-docs-to-include-all-new-models
Jan 29, 2025
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
ae10e27
Rename and reorganize plasma documentation: separate radiation conten…
chris-ashe e5f1d6d
🔄 Rename impurity species count variable from nimp to n_impurities fo…
chris-ashe 6be0dda
🔄 Rename afuel variable to m_fuel_amu for consistency across the code…
chris-ashe c4dfd3d
🔄 Update fuel species mass calculations to use constants for improved…
chris-ashe 7d8422c
🔄 Rename abeam variable to m_beam_amu for consistency across document…
chris-ashe 11bfe6c
:white_check_mark: Update unit tests failing due to using proper fuel…
chris-ashe f110d6f
🔄 Rename dnalp variable to nd_alphas for consistency across the codebase
chris-ashe bab654d
🔄 Rename dnprot variable to nd_protons for consistency across the cod…
chris-ashe ea55e80
🔄 Rename protium variable to f_nd_protium_electrons for consistency a…
chris-ashe 715e05d
🔄 Rename dnbeam variable to nd_beam_ions for consistency across the c…
chris-ashe 46f9f7a
🔄 Rename dnitot variable to nd_ions_total for consistency across the …
chris-ashe 642b58e
🔄 Rename dnz variable to nd_impurities for consistency across the cod…
chris-ashe 69da8c6
🔄 Rename aion variable to m_ions_total_amu for consistency across the…
chris-ashe c8e0470
🔄 Add atomic mass constants for various elements to improve code clar…
chris-ashe 4c1dca1
:memo: Update documentation to reflect changes in plasma composition …
chris-ashe ebf3bdd
🔄 Rename pradmw variable to p_plasma_rad_mw for consistency across th…
chris-ashe 9ba0635
🔄 Rename photon_wall variable to p_fw_rad_mw for consistency across t…
chris-ashe 1865bb0
🔄 Rename peakradwallload variable to p_fw_rad_max_mw for consistency …
chris-ashe 451326c
🔄 Rename pinnerzoneradmw variable to p_plasma_inner_rad_mw for consis…
chris-ashe 4569b43
🔄 Rename pouterzoneradmw variable to p_plasma_outer_rad_mw for consis…
chris-ashe eecca63
🔄 Rename peakfactrad variable to f_fw_rad_max for consistency across …
chris-ashe 86287d0
:recycle: Rename p_fw_rad_mw and p_fw_rad_max_mw to pflux_fw_rad_mw a…
chris-ashe cc0e940
🔄 Rename radpwr() to calculate_radiation_power() and add type hints a…
chris-ashe 384cad8
🔄 Rename psyncpv to pden_plasma_sync_mw for consistency across the co…
chris-ashe e74b5e6
:bug: fix old nimp variable name for new init.py
chris-ashe 8f10e26
🔄 Rename pradpv to pden_plasma_rad_mw for consistency across the code…
chris-ashe 9c1be03
:art: Update plasma radiation documentation and improve psync_albajar…
chris-ashe 3ef18e2
:bug: Add the tbeta parameter to the synchrotron power calculations a…
chris-ashe 7e8a319
:bug: Remove unused kap variable from psync_albajar_fidone function a…
chris-ashe 53c92ff
🔄 Rename ssync to f_sync_reflect for clarity and consistency across t…
chris-ashe 40718a0
:truck: Move coulomb logarithm definitions to the appropriate section…
chris-ashe 1103792
:heavy_plus_sign: Add new m_proton_amu variable and multiply it by th…
chris-ashe dd0e2c0
:bug: Refactor zeffai calculation to use mass-weighted plasma effecti…
chris-ashe 78ed5a1
:art: Update plasma_composition() doc section
chris-ashe abcbaa3
:art: Enhance plasma radiation documentation with detailed loss funct…
chris-ashe 84afb44
🔄 Rename 'ralpne' to 'f_nd_alpha_electron' for clarity and consistenc…
chris-ashe 6f7a9f4
🔄 Rename 'rnbeam' to 'f_nd_beam_electron' for clarity and consistency…
chris-ashe 5ed2d6e
🔄 Rename 'deni' to 'nd_fuel_ions' for clarity and consistency across …
chris-ashe bc8832f
:art: Update ion density labels for clarity and consistency in output
chris-ashe 09f29ad
:fire: Remove the ATOMIC_MASS_DEUTERIUM and ATOMIC_MASS_TRITIUM from …
chris-ashe daad9e0
:memo: Add output for average mass of fuel and beam ions in physics c…
chris-ashe e12e24c
🚚 Move density limit output to correct section
chris-ashe 9693f6d
:art: Update output labels for electron and ion densities for clarity…
chris-ashe c072d63
:art: Add new variable mappings for peak factor, impurities, and beam…
chris-ashe a1c90fc
:art: Clean up obsolete_vars.py and add separators in physics.py for …
chris-ashe ae33c60
:art: Enhance plasma composition documentation with impurity species …
chris-ashe fecf4a8
Requested review changes
chris-ashe 924826d
:art: Refactor total calculation in Power class for improved readability
chris-ashe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
237 changes: 237 additions & 0 deletions
237
documentation/proc-pages/physics-models/plasma_composition.md
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,237 @@ | ||
| # Plasma composition and impurities. | ||
|
|
||
| Within `PROCESS` we always assume the plasma is quasi-neutral eg: | ||
|
|
||
| $$ | ||
| n_{\text{e}} = \underbrace{Z_{\text{fuel}}n_{\text{i}}}_{\text{Fuel Ions}} + \underbrace{2n_{\text{e}}f_{\alpha}}_{\text{Alpha particles}} + \underbrace{n_{\text{e}}f_{\text{beam}}}_{\text{Neutral beams}} + \underbrace{\sum_j Z_j n_{\text{e}} f_j}_{\text{Impurities}} | ||
| $$ | ||
|
|
||
| * Since only deuterium and tritium can be placed into the beams the charge coefficient on the $n_{\text{e}}f_{\text{beam}}$ is just 1. | ||
|
|
||
| -------------------- | ||
|
|
||
| ## Setting the impurity composition | ||
|
|
||
|
|
||
|
|
||
| The impurity number density fractions relative to the electron density are constant and are set | ||
| using input array `fimp(1,...,14)`. The available species along with their `fimp()` index and iteration variable number are as follows: | ||
|
|
||
|
|
||
| - `fimp(1)`: Hydrogen isotopes (fraction calculated by code) | ||
| - `fimp(2)`: Helium (fraction calculated by code) | ||
| - `fimp(3)`: Beryllium, (`ixc = 125`) | ||
| - `fimp(4)`: Carbon, (`ixc = 126`) | ||
| - `fimp(5)`: Nitrogen, (`ixc = 127`) | ||
| - `fimp(6)`: Oxygen, (`ixc = 128`) | ||
| - `fimp(7)`: Neon, (`ixc = 129`) | ||
| - `fimp(8)`: Silicon, (`ixc = 130`) | ||
| - `fimp(9)`: Argon, (`ixc = 131`) | ||
| - `fimp(10)`: Iron, (`ixc = 132`) | ||
| - `fimp(11)`: Nickel, (`ixc = 133`) | ||
| - `fimp(12)`: Krypton, (`ixc = 134`) | ||
| - `fimp(13)`: Xenon, (`ixc = 135`) | ||
| - `fimp(14)`: Tungsten, (`ixc = 136`) | ||
|
|
||
| As stated above, the number density fractions for hydrogen (all isotopes) and | ||
| helium should not be set, as they are calculated by the code. This is to ensure | ||
| plasma quasi-neutrality taking into account the fuel ratios | ||
| `f_deuterium`, `f_tritium` and `f_helium3`, and the alpha particle fraction `f_nd_alpha_electron` which may | ||
| be input by the user or selected as an iteration variable. | ||
|
|
||
| The impurity fraction of any one of the elements listed in array `fimp` (other than hydrogen | ||
| isotopes and helium) may be used as an iteration variable. | ||
|
|
||
| **The impurity fraction to be varied can be set simply with `fimp(i) = <value>`, where `i` is the corresponding number value for the desired impurity in the table above.** | ||
|
|
||
| ---------------- | ||
|
|
||
| ## Plasma Composition Calculation | `plasma_composition()` | ||
|
|
||
| This function sets the fractional makeups and determines the relative density and charges of different plasma species. | ||
|
|
||
| All of the plasma composites are normally given as a fraction of the volume averaged plasma electron density. | ||
|
|
||
| 1. **Alpha Ash Portion Calculation** | ||
|
|
||
| - Calculate the number density of alpha particles (`nd_alphas`) using the electron density (`dene`) and the alpha particle to electron ratio (`f_nd_alpha_electron`). | ||
| - `f_nd_alpha_electron` can be set as an iteration variable (`ixc = 109`) or set directly. | ||
|
|
||
| $$ | ||
| n_{\alpha} = \mathtt{f\_nd\_alpha\_electron}\times n_{\text{e}} | ||
| $$ | ||
|
|
||
|
|
||
| 2. **Protons Calculation** | ||
| - The calculation of proton density (`nd_protons`) depends on whether the alpha rate density has been calculated. This should only happen in the first function call as the rates are calculated later on in the code. | ||
|
|
||
| - If the alpha rate density is not yet calculated, use a rough estimate. | ||
|
|
||
| $$ | ||
| \texttt{nd_protons} | n_{\text{p}} = \\ | ||
| \text{max}\left[\texttt{f_nd_protium_electrons} \times n_{\text{e}}, n_{\alpha}\times \left(f_{\text{3He}} + 0.001\right)\right] | ||
| $$ | ||
|
|
||
| - Otherwise, use the calculated proton rate density. | ||
|
|
||
| $$ | ||
| \texttt{nd_protons} | n_{\text{p}} = \\ | ||
| \text{max}\left[\texttt{f_nd_protium_electrons} \times n_{\text{e}}, n_{\alpha}\times \frac{r_{\text{p}}}{r_{\alpha,\text{total}}}\right] | ||
| $$ | ||
|
|
||
| where $r_{\text{p}}$ is the rate of proton production and $r_{\alpha,\text{total}}$ is the rate of total alpha particle production, which includes beam fusion (if present). | ||
|
|
||
| 3. **Beam Hot Ion Component** | ||
|
|
||
| - Calculate the number density of beam ions (`nd_beam_ions`), using the electron density (`dene`) and the beam ion to electron ratio (`f_nd_beam_electron`). If the plasma is ignited, set it to zero. | ||
| - `f_nd_beam_electron` can be set as an iteration variable (`ixc = 7`) or set directly. | ||
|
|
||
| $$ | ||
| \mathtt{nd\_beam\_ions} | n_{\text{beam}} = \mathtt{f\_nd\_beam\_electron} \times n_{\text{e}} | ||
| $$ | ||
|
|
||
| 4. **Sum of charge number density for all impurity ions** | ||
|
|
||
| - Sum the product of charge number (`Zi`) and number density for all impurity ions with charge greater than helium. | ||
|
|
||
| $$ | ||
| \mathtt{znimp} = \sum_j Z_j n_{\text{e}} f_j | ||
| $$ | ||
|
|
||
| 5. **Fuel Portion - Conserve Charge Neutrality** | ||
| - Calculate the fuel portion (`znfuel`) by conserving charge neutrality. | ||
|
|
||
| $$ | ||
| \mathtt{znfuel} | \underbrace{Z_{\text{fuel}}n_{\text{i}}}_{\text{Fuel Ions}} = n_{\text{e}} - \underbrace{2n_{\text{e}}f_{\alpha}}_{\text{Alpha particles}} - \underbrace{n_{\text{e}}f_{\text{beam}}}_{\text{Neutral beams}} - \underbrace{\sum_j Z_j n_{\text{e}} f_j}_{\text{Impurities}} | ||
| $$ | ||
|
|
||
| 6. **Fuel Ion Density Calculation** | ||
|
|
||
| $$ | ||
| \mathtt{nd\_fuel\_ions} | n_{\text{i}} = \frac{\mathtt{znfuel}}{1+f_{\text{3He}}} | ||
| $$ | ||
|
|
||
| - Calculate the fuel ion density (`nd_fuel_ions`). | ||
|
|
||
| 7. **Set Hydrogen and Helium Impurity Fractions** | ||
|
|
||
| - Set the impurity fractions for hydrogen and helium species. | ||
|
|
||
| $$ | ||
| \frac{n_{\text{H}}}{n_{\text{e}}} = n_{\text{protons}} + \left(f_{\text{deuterium}}+f_{\text{tritium}}\right)n_{\text{i}}+ n_{\text{beam}} | ||
| $$ | ||
|
|
||
| $$ | ||
| \frac{n_{\text{He}}}{n_{\text{e}}} = f_{\text{3He}}n_{\text{i}}+\mathtt{f\_nd\_alpha\_electron} | ||
| $$ | ||
|
|
||
| 8. **Total Impurity Density Calculation** | ||
|
|
||
| - Calculate the total impurity density (`nd_impurities`). | ||
|
|
||
| $$ | ||
| \mathtt{nd\_impurities} | n_{\text{impurities}} = \sum_j n_{\text{e}} f_j | ||
| $$ | ||
|
|
||
| 9. **Total Ion Density Calculation** | ||
|
|
||
| - Calculate the total ion density (`nd_ions_total`). | ||
|
|
||
| $$ | ||
| \mathtt{nd\_ions\_total} | n_{\text{i,total}} = n_{\text{i}} + n_{\alpha}+n_{\text{protons}}+ n_{\text{beam}}+n_{\text{impurities}} | ||
| $$ | ||
|
|
||
| 10. **Set Impurity Fraction Variables** | ||
|
|
||
| - Set global impurity fraction variables for other routines. | ||
|
|
||
| $$ | ||
| \mathtt{rncne} = \frac{n_{\text{C}}}{n_{\text{e}}}, \quad \mathtt{rnone} = \frac{n_{\text{O}}}{n_{\text{e}}} \quad \mathtt{rnfene} = \frac{n_{\text{Fe}}+ n_{\text{Ar}}}{n_{\text{e}}} | ||
| $$ | ||
|
|
||
| The variable above are set as global physics variables to be used in the [`sigbeam()`](../eng-models/heating_and_current_drive/NBI/nbi_overview.md#beam-stopping-cross-section--sigbeam) routine, which calculates the beam stopping cross-section. | ||
|
|
||
| 11. **Effective Charge Calculation** | ||
|
|
||
| - Calculate the effective charge (`zeff`), which is given by: | ||
|
|
||
| $$ | ||
| Z_{\text{eff}} = \frac{\sum_j Z^2_j n_{\text{i}}}{\sum_j Z_j n_{\text{i}}} | ||
| $$ | ||
|
|
||
| As we assume the plasma is quai-neutral then: | ||
|
|
||
| $$ | ||
| \sum_j Z_j n_{\text{i}} = n_{\text{e}} | ||
| $$ | ||
|
|
||
| Thus we can write: | ||
|
|
||
| $$ | ||
| \mathtt{zeff} | Z_{\text{eff}} = \frac{\sum_j Z^2_j n_{\text{e}} f_j}{n_{\text{e}}} | ||
| $$ | ||
|
|
||
| More info can be found [here](https://wiki.fusion.ciemat.es/wiki/Effective_charge_state). | ||
|
|
||
|
|
||
| 12. **Fraction of Alpha Energy to Ions and Electrons** | ||
|
|
||
| - Calculate the fraction of alpha energy going to electrons and ions. | ||
|
|
||
| $$ | ||
| \mathtt{f\_alpha\_electron} = 0.88155\exp{\left[-\langle T_{\text{e}} \rangle \frac{(1+\alpha_n)(1+\alpha_T)}{67.4036(1+\alpha_T+\alpha_n)}\right]} | ||
| $$ | ||
|
|
||
| $$ | ||
| \mathtt{f\_alpha\_ion} = (1.0 - \mathtt{f\_alpha\_electron}) | ||
| $$ | ||
|
|
||
| 13. **Average Atomic Masses of Injected Fuel Species** | ||
|
|
||
| - Calculate the average atomic masses of injected fuel species. | ||
|
|
||
| $$ | ||
| \mathtt{m\_fuel\_amu} | m_{\text{fuel,amu}} = \left(m_{\text{D}}f_{\text{D}}\right) + \left(m_{\text{T}}f_{\text{T}}\right) + \left(m_{\text{3He}}f_{\text{3He}}\right) | ||
| $$ | ||
|
|
||
| 14. **Average Atomic Masses of Injected Fuel Species in Neutral Beams** | ||
|
|
||
| - Calculate the average atomic masses of injected fuel species in the neutral beams. | ||
|
|
||
| $$ | ||
| \mathtt{m\_beam\_amu} | m_{\text{beam,amu}} = \left(m_{\text{D}}(1-f_{\text{T,beam}}\right)) + \left(m_{\text{T}}f_{\text{T,beam}}\right) | ||
| $$ | ||
|
|
||
| 15. **Density Weighted Mass Calculation** | ||
|
|
||
| - Calculate the density-weighted mass of ions. | ||
|
|
||
| $$ | ||
| \mathtt{m\_ions\_total\_amu} = \\ | ||
| \left[\frac{\left(m_{\text{fuel}}n_{\text{i}}\right) + \left(m_{\alpha}n_{\alpha}\right) + \left(m_{\text{p}}n_{p}\right) + \left(m_{\text{beam}}n_{\text{beam}}\right) + \sum_j m_{j} n_{\text{e}} f_j}{n_{\text{i,total}}}\right] | ||
| $$ | ||
|
|
||
| 16. **Mass Weighted Plasma Effective Charge** | ||
|
|
||
| - Calculate the mass-weighted plasma effective charge (`zeffai`). Similar to the calculation of the effective charge except each element is divided by its mass | ||
|
|
||
| $$ | ||
| \mathtt{zeffai} | Z_{\text{eff,m}} = \frac{\sum_j \frac{Z^2_j n_{\text{e}} f_j}{m_{\text{j}}}}{n_{\text{e}}} | ||
| $$ | ||
|
|
||
| --------------- | ||
|
|
||
|
|
||
| ## Key Constraints | ||
|
|
||
|
|
||
| ### Reinke criterion, divertor impurity fraction lower limit | ||
|
|
||
| This constraint can be activated by stating `icc = 78` in the input file. | ||
|
|
||
| The minimum impurity fraction required from the Reinke module can be set with, `fzmin` | ||
|
|
||
| The scaling value `freinke` can be varied also. | ||
|
|
||
|
|
||
| [^1]: H. Lux, R. Kemp, D.J. Ward, M. Sertoli, Impurity radiation in DEMO systems modelling, Fusion Engineering and Design, Volume 101, 2015, Pages 42-51, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2015.10.002. | ||
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.