Skip to content

WIP: isotopic diffusion - #14

Open
swjones wants to merge 10 commits into
mainfrom
swjones/isotopic-diffusion
Open

WIP: isotopic diffusion#14
swjones wants to merge 10 commits into
mainfrom
swjones/isotopic-diffusion

Conversation

@swjones

@swjones swjones commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

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

  • Adds a test for any bugs fixed. Adds tests for new features.
  • Format your changes by using the scripts/format.sh command or by using @par-hermes format
  • Document any new features, update documentation for changes made.
  • Make sure the copyright notice on any files you modified is up to date.
  • LANL employees: make sure tests pass both on the github CI and on the re-git CI
  • If ML was used, make sure to add a disclaimer at the top of a file indicating ML was used to assist in generating the file.
  • If Agentic AI was used, have the AI generate a "proposed changes" markdown file and store it in the plan_histories folder, with a filename the same as the MR number.

If preparing for a new release, in addition please check the following:

  • Update the version in cmake.

@Yurlungur

Copy link
Copy Markdown
Collaborator

@par-hermes format

@swjones swjones changed the title isotopic diffusion WIP: isotopic diffusion Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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; }
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a parthenon proper supported halo we can use?

++iso_idx;
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if parthenon should provide some coords logic here that can use the flat kji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants