Skip to content

Fixed detonation wave upstream enthalpy calc and legacy interface upstream MW#33

Merged
markleader merged 1 commit intonasa:mainfrom
dfnca:bug/detEnthalpy
Feb 19, 2026
Merged

Fixed detonation wave upstream enthalpy calc and legacy interface upstream MW#33
markleader merged 1 commit intonasa:mainfrom
dfnca:bug/detEnthalpy

Conversation

@dfnca
Copy link
Contributor

@dfnca dfnca commented Feb 17, 2026

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

  • No expected changes to numerical results
  • [ X] Expected changes (explain and provide validation)
    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.

@markleader
Copy link
Contributor

Approved - thanks @dfnca

@markleader markleader merged commit c9afe57 into nasa:main Feb 19, 2026
23 checks passed
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

Comments