Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
581 stars 342 forks source link

Add option for mass gradient-based fluxes #1668

Closed g3bk47 closed 3 months ago

g3bk47 commented 4 months ago

Changes proposed in this pull request

Add a new option to compute species diffusive fluxes with respect to their mass fraction gradients for 1D flames. See https://github.com/Cantera/enhancements/issues/195 for extended discussion. All changes are fully backward compatible.

After some brainstoming, I settled on flux_gradient_basis as the new property's name, i.e. using mole or mass fraction gradients for computing species fluxes. If you have a better idea, feel free to let me know. I also changed the API to use the established basis enum. Performance-wise, this should not have an impact, since the comparison m_fluxGradientBasis == ThermoBasis::molar is a simple hard-coded comparison against zero.

Checklist

g3bk47 commented 3 months ago

Thanks, @speth! I rebased and incorporated all requested changes.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 86.04651% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 72.78%. Comparing base (64ed2b7) to head (c2a9322).

Files Patch % Lines
interfaces/cython/cantera/_onedim.pyx 66.66% 3 Missing :warning:
src/oneD/StFlow.cpp 88.46% 1 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1668 +/- ## ========================================== + Coverage 72.77% 72.78% +0.01% ========================================== Files 375 375 Lines 56632 56667 +35 Branches 20590 20603 +13 ========================================== + Hits 41212 41244 +32 - Misses 12398 12399 +1 - Partials 3022 3024 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.