WIP: isotopic diffusion - #14
Open
swjones wants to merge 10 commits into
Open
Conversation
…to operate on isotopes
… move diffusion loops to use flux views and var views to condense code
Collaborator
|
@par-hermes format |
Yurlungur
reviewed
Sep 9, 2026
Collaborator
There was a problem hiding this comment.
I wonder if down the line we should split out an isotopics package in addition to the materials package. Food for thought.
Comment on lines
+40
to
+51
| struct diffusion_halo_t { | ||
| static constexpr int npoints = 4; | ||
|
|
||
| KOKKOS_INLINE_FUNCTION | ||
| static constexpr int dk(const int n) { return n == 0 ? -1 : 0; } | ||
|
|
||
| KOKKOS_INLINE_FUNCTION | ||
| static constexpr int dj(const int n) { return n == 1 ? -1 : 0; } | ||
|
|
||
| KOKKOS_INLINE_FUNCTION | ||
| static constexpr int di(const int n) { return n == 2 ? -1 : 0; } | ||
| }; |
Collaborator
There was a problem hiding this comment.
is there a parthenon proper supported halo we can use?
| ++iso_idx; | ||
| } | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
this doesn't look device safe
| ccbulk::total_material_energy()); | ||
| RiotLoop::inner(idx_range, [&](const auto kji) { | ||
| const auto [k, j, i] = idx_range.GetKJI(kji); | ||
| const Real dxinv = 1.0 / (coords.Dxc(X1DIR, k, j, i) + 1e-20); |
Collaborator
There was a problem hiding this comment.
I wonder if parthenon should provide some coords logic here that can use the flat kji
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds isotopic diffusion in the ionisation package. If isotopes are not specified, materials are still diffused using mean properties.
PR Summary
Adds diffusive fluxes to material densities, isotopic densities, and total energy. The Chapman-Enskog truncation closure means that no diffusive terms appear in the total momentum equation.
PR Checklist
scripts/format.shcommand or by using@par-hermes formatplan_historiesfolder, with a filename the same as the MR number.If preparing for a new release, in addition please check the following: