Vectorize Redlich-Kwong property calculations#2099
Draft
speth wants to merge 5 commits intoCantera:mainfrom
Draft
Vectorize Redlich-Kwong property calculations#2099speth wants to merge 5 commits intoCantera:mainfrom
speth wants to merge 5 commits intoCantera:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2099 +/- ##
==========================================
- Coverage 77.63% 77.57% -0.06%
==========================================
Files 451 452 +1
Lines 53045 52944 -101
Branches 8853 8805 -48
==========================================
- Hits 41179 41071 -108
- Misses 8889 8895 +6
- Partials 2977 2978 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Changes proposed in this pull request
RedlichKwongMFTPRedlichKwongMFTPto have simpler, more clear namesThis should wait until after #2087 is resolved to avoid introducing merge conflicts there -- I'll resolve those conflicts in this PR.
If applicable, provide an example illustrating new features this pull request is introducing
Besides simplifying the implementation, this provides a substantial speed benefit to the calculations -- more than I was expecting. Average time for the cases in the
non_ideal_shock_tube.pyexample (using themainbranch after merging #2094 as a baseline):MoleReactor(no preconditioner): 5.525 sIdealGasMoleReactorwithout preconditioner: 1.988 sIdealGasMoleReactorwith preconditioner: 1.004 sMoleReactor(no preconditioner): 1.131 sIdealGasMoleReactorwithout preconditioner: 0.345 sIdealGasMoleReactorwith preconditioner: 0.228 sSo this provides another factor of 4 speed up, on top of the performance gains from #2094, and brings the Redlich-Kwong integration time to within about a factor of 2 compared to a calculation using the ideal gas model.
AI Statement (required)
logic and implementation decisions. All generated code and documentation were reviewed and understood by the contributor. Prepared with the help of ChatGPT Codex 5.3.
Checklist
scons build&scons test) and unit tests address code coverage