Skip to content

Conversation

@speth
Copy link
Member

@speth speth commented Oct 23, 2025

Changes proposed in this pull request

  • Revise calculation of density for surface phases to correctly account for species that occupy multiple sites. This affects the concentrations (calculated in Phase as $C_k = \rho Y_k / W_k$) which in turn affects reaction rate calculations.

This resolves a regression introduced in #1350 that affects Cantera 3.0 and 3.1. The effect is most noticeable for phases where major species occupy multiple sites, such as in SiF4_NH3_mec.yaml where all the species have multiple occupancy.

If applicable, fill in the issue number this pull request is fixing

If applicable, provide an example illustrating new features this pull request is introducing

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@speth speth added the Thermo label Oct 23, 2025
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.47%. Comparing base (5e351a1) to head (bb95641).
⚠️ Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2016      +/-   ##
==========================================
+ Coverage   75.43%   75.47%   +0.04%     
==========================================
  Files         454      454              
  Lines       56773    56804      +31     
  Branches     9345     9357      +12     
==========================================
+ Hits        42825    42872      +47     
+ Misses      10785    10764      -21     
- Partials     3163     3168       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ischoegl
Copy link
Member

Mentioning Cantera/enhancements#154, although I am unsure whether this is a tangent.

@speth
Copy link
Member Author

speth commented Oct 23, 2025

I don't think that enhancement idea is relevant to the issue here. For phases, the state needs to be an intensive property, so I think the composition always needs to be in terms of relative amounts of one sort or another. The challenge here comes from the fact that there are three different conventions available for expressing this in the case of surface phases.

@speth speth marked this pull request as ready for review October 23, 2025 16:01
Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @speth. Based on my reading of test_multi_site_density, this looks good to me!

@ischoegl ischoegl merged commit fd4d005 into Cantera:main Oct 24, 2025
53 checks passed
@speth speth deleted the fix-surf-concentrations branch October 24, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plug flow reactor: silicon nitride deposition example: sdot and pressure increase issues

2 participants