Repository navigation
Preserve surface site inventories in VCS TP equilibrium - #2200
Kiril1Shevtsov wants to merge 3 commits into
Conversation
Add scoped neutral ideal-surface support and regression tests. Addresses Cantera#1720.
|
I realize this is not marked as ready for review yet, but I had one question about the choice of scoping this to constant TP solves only. Given all the other constraint options for the VCS solver are just loops over constant TP solves, is there a reason not to support those constraints here? Unless I'm missing something, it wouldn't require anything else from the implementation; just perhaps a few additional tests. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2200 +/- ##
==========================================
- Coverage 78.44% 77.53% -0.92%
==========================================
Files 463 470 +7
Lines 55884 57244 +1360
Branches 9166 9215 +49
==========================================
+ Hits 43839 44384 +545
- Misses 8978 9791 +813
- Partials 3067 3069 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks, @speth. You were right about HP and SP. I started with TP to test the site balance in the simplest setting, not because HP or SP needs a different inner solve. I’ve added HP and SP to this PR for explicit I’ve left the volume-constrained modes guarded. The current loop divides by the target volume, which is zero for a surface-only system. One idea is to handle zero volume explicitly and test the existing iteration separately on positive-volume gas–surface mixtures. That part isn’t validated yet. I’m still getting to know Cantera’s internals, and I hope to contribute more as I learn my way around. Thanks for pointing me in this direction. Codex assisted with the HP/SP patch and validation; I reviewed the changes. |
Changes proposed in this pull request
This adds support for conserving surface-site inventories in mixtures with neutral ideal surfaces and equal positive species site sizes. The supported modes are TP with
solver="vcs"orauto, and HP or SP with explicitsolver="vcs". The existing HP/SP outer loops are unchanged.Addresses #1720. This is deliberately scoped support, not a general solution for every surface model or equilibrium constraint.
Validation
The original TP-only revision was tested against
25c1ab1c397e2991c77560b1ad5154919a12c733:scons test -j1 -k, 8058 passed, 0 failed, one reused test group.The full native run was performed on 11 November and the original-composition checks on 12 November; neither is claimed as a new run today. Fresh preparation checks verified clean patch application to current main and Python syntax for all three changed Python files. The native build enabled Python and GoogleTest and disabled HDF5 and Fortran.
On the current HP/SP follow-up (
db0a8a1), the targeted run passed 79 tests, including 16 new HP/SP cases with and without a gas phase. An independent reference agreed within 3 µK in final temperature. The full native suite was not rerun on this follow-up. Details.AI Statement (required)
Extensive use of generative AI. Generative AI was used for code review, as well as for writing part of the routine code. All code was reviewed by me personally.
Checklist