Optimisation: exploiting symmetry of binary diffusion coefficients#595
Merged
baperry2 merged 49 commits intoAMReX-Combustion:developmentfrom Jul 22, 2025
Merged
Optimisation: exploiting symmetry of binary diffusion coefficients#595baperry2 merged 49 commits intoAMReX-Combustion:developmentfrom
baperry2 merged 49 commits intoAMReX-Combustion:developmentfrom
Conversation
Instead of evaluation T2= T*T and T3=T*T*T do T3=T2*T Co-authored-by: Terence Lehmann <[email protected]>
…into jf_dibin_reduction
…into jf_dibin_reduction
dibin reduction
baperry2
requested changes
Jul 18, 2025
Contributor
baperry2
left a comment
There was a problem hiding this comment.
Looks good, this is a pretty solid performance gain.
But before merging we also need the qss mechanisms to be regenerated: https://amrex-combustion.github.io/PelePhysics/Ceptr.html#batched-generation-of-pele-compatible-mechanisms
baperry2
approved these changes
Jul 18, 2025
Contributor
baperry2
left a comment
There was a problem hiding this comment.
Now I get 0 diffs for TranEval for both LiDryer and CH4_lean_qss.
But it seems some extraneous changes came when regenerating the qss mechs due to the sympy stuff. I'll don't get those diffs when I regenerate so I'll push my versions. I think part but not all of the variability comes from us not being strict enough about the sympy version in pyproject.toml.
QSS Mechs with fewer diffs
This was referenced Jul 30, 2025
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.
This pull request changes how diffusion coefficients are evaluated to exploit the symmetric nature of the D_ij matrix. The NUM_SPECIES^2 loops and arrays are now over a size NUM_SPECIES*(NUM_SPECIES+1)/2, which roughly halves the computational cost of evaluating diffusion coefficients.
Here is a tiny profile from the 2D flamesheet case in LMeX with the original implementation:

With the new implementation:

There's also a small tweak in the NASA polynomial computations that reuses the T2 and T3 values in computing the polynomial.