Simplify Reactor evaluation/synchronization logic#2069
Simplify Reactor evaluation/synchronization logic#2069ischoegl merged 17 commits intoCantera:mainfrom
Conversation
9ade7a5 to
4e04870
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2069 +/- ##
==========================================
- Coverage 77.22% 77.17% -0.05%
==========================================
Files 456 456
Lines 53026 52870 -156
Branches 8998 8951 -47
==========================================
- Hits 40947 40805 -142
- Misses 9035 9045 +10
+ Partials 3044 3020 -24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
204d46f to
b12fc94
Compare
b12fc94 to
fa5cadf
Compare
fa5cadf to
971ed9e
Compare
ischoegl
left a comment
There was a problem hiding this comment.
Thanks, @speth - sorry for not getting around to this sooner, and I apologize that I still don't have sufficient bandwidth for a full review.
With the caveat that we should bump the version to 4.0.0a1 prior to merging this PR, I am overall 👍 with the approach. I trust that our test suite is sufficiently thorough to catch regressions (caveat: I did notice some significant deviations of code in the flow reactor, where I don't think we have a comparison to numerical results in place).
Co-authored-by: Anthony Walker <walkanth@oregonstate.edu>
971ed9e to
9fae77d
Compare
Changes proposed in this pull request
This PR implements changes to how reactor governing equations are implemented to make use of the new requirement that all reactors have unique/independent contents.
syncStateandrestoreStatemethods of reactor objects. These steps are no longer necessary.ReactorSurfaceobjects are now responsible for calculating their own governing equations (for the surface coverages or moles). As a result, thegetSurfaceInitialConditionsandevalSurfacesmethods are no longer necessary.ReactorSurfaceFactoryclass for handling distinct reactor surface types. There are two versions of thenewReactorSurfacemethod, one which takes an explicit model type parameter, and another which creates the "right" type ofReactorSurfacedepending on the types of the adjacentReactors (for exampleFlowReactorSurfacefor surfaces adjacent to aFlowReactor.ExtensibleReactorSurfaceclass to Python, which allows customization of the governing equations for surfaces.vector<Triplet>where components indices are global indices within the network rather than reactor-local. This allows reactors to add terms for dependence on state variables of other reactors. Mostly supersedes Extensible jacobian and network jacobian interfaces #1634.ExtensibleReactoror otherwise creates derived types from theReactorclasses will likely need to be updated. Merging this PR commits us to a major version bump.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
A simple example of an
ExtensibleReactorSurface(fromtest_reactor.py) now looks like this:Previously, this required implementing an
ExtensibleReactortype and using that to replace the rate calculations for the attached surface even though the bulk phase governing equations were not being modified.AI Statement (required)
all design, logic, and implementation decisions were made by the contributor.
Checklist
scons build&scons test) and unit tests address code coverage