Skip to content

ImproveReactorSurface handling and reimplement advanceCoverages#2075

Merged
ischoegl merged 11 commits intoCantera:mainfrom
speth:reactor-init-surf-only
Jan 31, 2026
Merged

ImproveReactorSurface handling and reimplement advanceCoverages#2075
ischoegl merged 11 commits intoCantera:mainfrom
speth:reactor-init-surf-only

Conversation

@speth
Copy link
Member

@speth speth commented Jan 12, 2026

This builds on top of #2069, which should be reviewed/merged first. I'll rebase this once that is done, but thought it would be worth seeing some of the additional things that are enabled by that PR.

Changes proposed in this pull request

  • Refactor ReactorNet initialization so that ReactorSurface objects can be attached to Reservoirs. This allows solving the case where the the surface evolves while holding the bulk phase composition fixed.
  • Update handling of steady-state constraints so that ReactorSurface, ConstPressureMoleReactor, and IdealGasConstPressureMoleReactor can be used with ReactorNet::solveSteady.
  • Use a ReactorNet composed of a ReactorSurface and Reservoir objects to provide the implementation of InterfaceKinetics::advanceCoverages and InterfaceKinetics::solvePseudoSteadyStateProblem; Remove the now obsolete ImplicitSurfChem and SolveSP classes which were previously used for this purpose.
  • Modify setting of ReactorNet tolerances so they can be modified after the integrator is initialized.

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

AI Statement (required)

  • Limited use of generative AI.
    Standard or boilerplate code snippets were generated with AI and manually reviewed;
    all design, logic, and implementation decisions were made by the contributor.
    Examples: IDE code-completions or brief LLM queries for common patterns.

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
  • AI Statement is included
  • The pull request is ready for review

@speth speth force-pushed the reactor-init-surf-only branch 2 times, most recently from 9ef8155 to 0a4a31d Compare January 12, 2026 17:33
@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 89.96416% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.34%. Comparing base (bd8f886) to head (8089b25).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/zeroD/ReactorNet.cpp 89.31% 2 Missing and 12 partials ⚠️
include/cantera/zeroD/ReactorBase.h 0.00% 5 Missing ⚠️
src/numerics/CVodesIntegrator.cpp 69.23% 3 Missing and 1 partial ⚠️
src/kinetics/InterfaceKinetics.cpp 94.11% 1 Missing and 1 partial ⚠️
src/zeroD/IdealGasConstPressureReactor.cpp 75.00% 1 Missing and 1 partial ⚠️
include/cantera/zeroD/FlowReactor.h 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2075      +/-   ##
==========================================
+ Coverage   77.21%   77.34%   +0.13%     
==========================================
  Files         456      451       -5     
  Lines       52952    52494     -458     
  Branches     8966     8847     -119     
==========================================
- Hits        40885    40602     -283     
+ Misses       9041     8917     -124     
+ Partials     3026     2975      -51     

☔ 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.

@speth speth force-pushed the reactor-init-surf-only branch 6 times, most recently from 7924fa2 to 3c7ccb3 Compare January 14, 2026 18:27
@ischoegl ischoegl mentioned this pull request Jan 27, 2026
6 tasks
@speth speth force-pushed the reactor-init-surf-only branch 3 times, most recently from 5714f5c to 3870f2f Compare January 29, 2026 03:52
Fix a regression introduced in c0e0831. This caused some tests
to fail when compiling with assertions enabled.
@speth speth force-pushed the reactor-init-surf-only branch 3 times, most recently from c1b45e0 to 0993bda Compare January 29, 2026 16:24
@speth speth force-pushed the reactor-init-surf-only branch from 0993bda to 8089b25 Compare January 29, 2026 16:41
@speth speth marked this pull request as ready for review January 29, 2026 18:43
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! This all looks great.

One caveat is that this (significant) improvement does not resolve the original intent of Cantera/enhancements#61

From my perspective, I strongly dislike

d = ct.Interface("diamond.yaml", "diamond_100")
[...]
d.advance_coverages_to_steady_state()

as in the diamond_cvd.py example. Anything that integrates belongs to the zero-D reactor approach. With a major version bump, there's an opening to clarify this once and for all.

Given that my bandwidth limitations will not resolve anytime soon, I'm 👍 with any way forward.

@ischoegl ischoegl merged commit 49481e6 into Cantera:main Jan 31, 2026
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants