Fixed detonation wave upstream enthalpy calc and legacy interface upstream MW#33
Merged
markleader merged 1 commit intonasa:mainfrom Feb 19, 2026
Merged
Conversation
…tream molecular weight
Contributor
|
Approved - thanks @dfnca |
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.
Summary
The upstream enthalpy for detonation problems was incorrect when the mixture contains species whose heat of formation is not defined as zero at 298.15 K. This resulted in an incorrect CJ speed.
In addition, the upstream molecular weight was printed as its inverse on the legacy interface.
This PR addresses Issue #31
Changes
Enthalpy of pre-detonation mixture was originally computed as h(T) - h(298.15 K), which resulted in an incorrect mixture enthalpy for cases where species with non-zero heat of formation were present (e.g., hydrocarbon fuels). The calculation was corrected to not subtract h(298.15 K).
Removed calculation that inverted the upstream mixture molecular weight when using the legacy interface.
Testing
Passed integration harness, pytest on Win 11 w/ifx compiler set.
Sample ethylene-O2 detonation problem from Issue #31 now produces results consistent with CEA2 and the CJ speed is as expected.
Compatibility / Numerical behavior
Upstream enthalpy H1, molecular weight M1, and detonation velocity now match CEA2 results for the sample ethylene - O2 problem. CJ speed is now within 0.03% of an independent calculation using Cantera.