Skip to content

Conversation

rwest
Copy link
Member

@rwest rwest commented Oct 19, 2025

Motivation or Problem

Sometimes you have a pressure-dependent network that has been studied in great detail and put in a seed mechanism or reaction library, (such as CH2O2) and you don't want RMG to add reactions to the network and your model, because doing so will make it worse.
Any net reactions that are in your seed mechanism won't be changed by RMG's estimates, but currently if RMG finds a new reaction then it will add it. If the original authors did a thorough job and still left out a reaction, it's because they think it is slow, and adding RMG's estimate will probably make your model worse.
@Nora-Khalil has been running into this problem (it's not just hypothetical), although I'm not sure if we have an issue open for it yet.

Description of Changes

This PR adds an option that lets you specify in the input file that you don't want RMG to expand certain networks further.
You specify them with a line in your pressureDependence block of your input file like

completedNetworks = ['CH2O2'],

This can be a list of things, specified by chemical formula of the potential energy surface that has been explored.

Testing

I added a line to an example input file, for testing, but this is poor example (preventing ethane from reacting in the ethane oxidation example!) and we should change it before shipping this, so we're not distributing bad examples.
But for now, it demonstrates the new feature.

Reviewer Tips

See if it works as intended, in a better example than the one I gave. Something where the PDep network is complete in the seed mechanism.

Up for debate

I wasn't sure where in the input file this should go.
The list of networks is stored in the rmg.reaction_model object, not the rmg.pressure_dependence, but I think it only makes sense when you have pressure dependence on, so I put it in the pressureDependence block of the input file. I also considered the generatedSpeciesConstraints block. Or another block. But maybe we're rewriting all the input files in yaml soon anyway...

We also considered in off-line discussion whether this should in fact live in the reaction library or seed mechanism, and you get networks marked as "complete" according to the seed mechanism you use. But that would involve editing the database also, and so for this testing of the concept I didn't try that. But would that be better in the long run?

Still to do (WIP)

  • Documentation
  • Unit tests?
  • A sensible example

@rwest rwest requested a review from Nora-Khalil October 19, 2025 04:13
@rwest rwest force-pushed the feat/complete_network branch from 372e086 to 39d6510 Compare October 19, 2025 04:14
@github-actions
Copy link

Regression Testing Results

⚠️ One or more regression tests failed.
Please download the failed results and run the tests locally or check the log to see why.

Detailed regression test results.

Regression test aromatics:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:50
Current: Execution time (DD:HH:MM:SS): 00:00:00:49
Reference: Memory used: 746.95 MB
Current: Memory used: 747.33 MB

aromatics Passed Core Comparison ✅

Original model has 15 species.
Test model has 15 species. ✅
Original model has 11 reactions.
Test model has 11 reactions. ✅

aromatics Failed Edge Comparison ❌

Original model has 106 species.
Test model has 106 species. ✅
Original model has 358 reactions.
Test model has 358 reactions. ✅

Non-identical thermo! ❌
original: C=CC1C=CC2=CC1C=C2
tested: C=CC1C=CC2=CC1C=C2

Hf(300K) S(300K) Cp(300K) Cp(400K) Cp(500K) Cp(600K) Cp(800K) Cp(1000K) Cp(1500K)
83.22 82.78 35.48 45.14 53.78 61.40 73.58 82.20 95.08
83.22 84.16 35.48 45.14 53.78 61.40 73.58 82.20 95.08

Identical thermo comments:
thermo: Thermo group additivity estimation: group(Cs-(Cds-Cds)(Cds-Cds)CsH) + group(Cs-(Cds-Cds)(Cds-Cds)CsH) + group(Cds-Cds(Cds-Cds)(Cds-Cds)) + group(Cds- CdsCsH) + group(Cds-CdsCsH) + group(Cds-CdsCsH) + group(Cds-CdsCsH) + group(Cds-Cds(Cds-Cds)H) + group(Cds-Cds(Cds-Cds)H) + group(Cds-CdsHH) + Estimated bicyclic component: polycyclic(s3_5_6_ane) - ring(Cyclohexane) - ring(Cyclopentane) + ring(1,3-Cyclohexadiene) + ring(Cyclopentadiene)

Observables Test Case: Aromatics Comparison

✅ All Observables varied by less than 0.500 on average between old model and new model in all conditions!

aromatics Passed Observable Testing ✅

Regression test liquid_oxidation:

Reference: Execution time (DD:HH:MM:SS): 00:00:02:01
Current: Execution time (DD:HH:MM:SS): 00:00:01:53
Reference: Memory used: 847.41 MB
Current: Memory used: 846.05 MB

liquid_oxidation Passed Core Comparison ✅

Original model has 37 species.
Test model has 37 species. ✅
Original model has 241 reactions.
Test model has 241 reactions. ✅

liquid_oxidation Failed Edge Comparison ❌

Original model has 214 species.
Test model has 214 species. ✅
Original model has 1590 reactions.
Test model has 1593 reactions. ❌
The tested model has 3 reactions that the original model does not have. ❌
rxn: CC(CC(C)OO)O[O](90) + CC(CCCOO)O[O](108) <=> oxygen(1) + CC([O])CC(C)OO(110) + CC([O])CCCOO(123) origin: Peroxyl_Disproportionation
rxn: CC(CC(C)OO)O[O](90) + CC(CCCOO)O[O](108) <=> oxygen(1) + CC(=O)CC(C)OO(105) + CC(O)CCCOO(152) origin: Peroxyl_Termination
rxn: CC(CC(C)OO)O[O](90) + CC(CCCOO)O[O](108) <=> oxygen(1) + CC(=O)CCCOO(112) + CC(O)CC(C)OO(143) origin: Peroxyl_Termination

Non-identical kinetics! ❌
original:
rxn: CCC(CC)O[O](37) + CCCCCO[O](35) <=> oxygen(1) + CCC([O])CC(69) + CCCCC[O](67) origin: Peroxyl_Disproportionation
tested:
rxn: CCC(CC)O[O](35) + CCCCCO[O](37) <=> oxygen(1) + CCC([O])CC(67) + CCCCC[O](69) origin: Peroxyl_Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): 7.83 7.49 7.23 7.02 6.68 6.42 5.95 5.61
k(T): 3.54 4.28 4.73 5.02 5.39 5.62 5.91 6.06

kinetics: Arrhenius(A=(3.18266e+20,'cm^3/(mol*s)'), n=-2.694, Ea=(0,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-5R-R_7R!H->C_N-7C-inRing in family Peroxyl_Disproportionation.""")
kinetics: Arrhenius(A=(3.2e+12,'cm^3/(mol*s)'), n=0, Ea=(4.064,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-5R-R_7R!H->C_N-7C-inRing_Ext-5R-R in family Peroxyl_Disproportionation.""")
kinetics: Estimated from node Root_Ext-5R-R_7R!H->C_N-7C-inRing in family Peroxyl_Disproportionation.
kinetics: Estimated from node Root_Ext-5R-R_7R!H->C_N-7C-inRing_Ext-5R-R in family Peroxyl_Disproportionation.

Observables Test Case: liquid_oxidation Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

liquid_oxidation Passed Observable Testing ✅

Regression test nitrogen:

Reference: Execution time (DD:HH:MM:SS): 00:00:01:03
Current: Execution time (DD:HH:MM:SS): 00:00:01:01
Reference: Memory used: 843.70 MB
Current: Memory used: 848.32 MB

nitrogen Passed Core Comparison ✅

Original model has 41 species.
Test model has 41 species. ✅
Original model has 360 reactions.
Test model has 360 reactions. ✅

nitrogen Failed Edge Comparison ❌

Original model has 133 species.
Test model has 133 species. ✅
Original model has 983 reactions.
Test model has 983 reactions. ✅

Non-identical thermo! ❌
original: O1[C]=N1
tested: O1[C]=N1

Hf(300K) S(300K) Cp(300K) Cp(400K) Cp(500K) Cp(600K) Cp(800K) Cp(1000K) Cp(1500K)
141.64 58.66 12.26 12.27 12.09 11.96 12.26 12.72 12.15
116.46 53.90 11.62 12.71 13.49 13.96 14.14 13.85 13.58

thermo: Thermo group additivity estimation: group(O2s-CdN3d) + group(N3d-OCd) + group(Cd-HN3dO) + ring(oxirene) + radical(CdJ-NdO)
thermo: Thermo group additivity estimation: group(O2s-CdN3d) + group(N3d-OCd) + group(Cd-HN3dO) + ring(Cyclopropene) + radical(CdJ-NdO)

Non-identical kinetics! ❌
original:
rxn: NCO(66) <=> O1[C]=N1(126) origin: Intra_R_Add_Endocyclic
tested:
rxn: NCO(66) <=> O1[C]=N1(126) origin: Intra_R_Add_Endocyclic

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -66.25 -46.19 -34.19 -26.21 -16.28 -10.36 -2.54 1.31
k(T): -49.54 -33.65 -24.16 -17.85 -10.01 -5.35 0.80 3.82

kinetics: Arrhenius(A=(6.95187e+18,'s^-1'), n=-1.628, Ea=(111.271,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Backbone0_N-2R!H-inRing_N-1R!H-inRing_Sp-2R!H-1R!H in family Intra_R_Add_Endocyclic.""")
kinetics: Arrhenius(A=(6.95187e+18,'s^-1'), n=-1.628, Ea=(88.327,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Backbone0_N-2R!H-inRing_N-1R!H-inRing_Sp-2R!H-1R!H in family Intra_R_Add_Endocyclic.""")
Identical kinetics comments:
kinetics: Estimated from node Backbone0_N-2R!H-inRing_N-1R!H-inRing_Sp-2R!H-1R!H in family Intra_R_Add_Endocyclic.

Observables Test Case: NC Comparison

✅ All Observables varied by less than 0.200 on average between old model and new model in all conditions!

nitrogen Passed Observable Testing ✅

Regression test oxidation:

Reference: Execution time (DD:HH:MM:SS): 00:00:01:50
Current: Execution time (DD:HH:MM:SS): 00:00:01:47
Reference: Memory used: 733.91 MB
Current: Memory used: 733.90 MB

oxidation Passed Core Comparison ✅

Original model has 59 species.
Test model has 59 species. ✅
Original model has 694 reactions.
Test model has 694 reactions. ✅

oxidation Passed Edge Comparison ✅

Original model has 230 species.
Test model has 230 species. ✅
Original model has 1526 reactions.
Test model has 1526 reactions. ✅

Observables Test Case: Oxidation Comparison

✅ All Observables varied by less than 0.500 on average between old model and new model in all conditions!

oxidation Passed Observable Testing ✅
Errors occurred during observable testing ⚠️ WARNING:root:Initial mole fractions do not sum to one; normalizing.

Regression test sulfur:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:39
Current: Execution time (DD:HH:MM:SS): 00:00:00:38
Reference: Memory used: 841.54 MB
Current: Memory used: 842.26 MB

sulfur Passed Core Comparison ✅

Original model has 27 species.
Test model has 27 species. ✅
Original model has 74 reactions.
Test model has 74 reactions. ✅

sulfur Failed Edge Comparison ❌

Original model has 89 species.
Test model has 89 species. ✅
Original model has 227 reactions.
Test model has 227 reactions. ✅
The original model has 1 reactions that the tested model does not have. ❌
rxn: O(4) + SO2(15) (+N2) <=> SO3(16) (+N2) origin: primarySulfurLibrary
The tested model has 1 reactions that the original model does not have. ❌
rxn: O(4) + SO2(15) (+N2) <=> SO3(16) (+N2) origin: primarySulfurLibrary

Observables Test Case: SO2 Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

sulfur Passed Observable Testing ✅

Regression test superminimal:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:25
Current: Execution time (DD:HH:MM:SS): 00:00:00:25
Reference: Memory used: 937.28 MB
Current: Memory used: 932.81 MB

superminimal Passed Core Comparison ✅

Original model has 13 species.
Test model has 13 species. ✅
Original model has 21 reactions.
Test model has 21 reactions. ✅

superminimal Passed Edge Comparison ✅

Original model has 18 species.
Test model has 18 species. ✅
Original model has 28 reactions.
Test model has 28 reactions. ✅

Regression test RMS_constantVIdealGasReactor_superminimal:

Reference: Execution time (DD:HH:MM:SS): 00:00:02:54
Current: Execution time (DD:HH:MM:SS): 00:00:02:15
Reference: Memory used: 2409.93 MB
Current: Memory used: 2285.57 MB

RMS_constantVIdealGasReactor_superminimal Passed Core Comparison ✅

Original model has 13 species.
Test model has 13 species. ✅
Original model has 19 reactions.
Test model has 19 reactions. ✅

RMS_constantVIdealGasReactor_superminimal Passed Edge Comparison ✅

Original model has 13 species.
Test model has 13 species. ✅
Original model has 19 reactions.
Test model has 19 reactions. ✅

Observables Test Case: RMS_constantVIdealGasReactor_superminimal Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

RMS_constantVIdealGasReactor_superminimal Passed Observable Testing ✅

Regression test RMS_CSTR_liquid_oxidation:

Reference: Execution time (DD:HH:MM:SS): 00:00:12:55
Current: Execution time (DD:HH:MM:SS): 00:00:11:12
Reference: Memory used: 2688.05 MB
Current: Memory used: 2730.61 MB

RMS_CSTR_liquid_oxidation Passed Core Comparison ✅

Original model has 35 species.
Test model has 35 species. ✅
Original model has 149 reactions.
Test model has 149 reactions. ✅

RMS_CSTR_liquid_oxidation Passed Edge Comparison ✅

Original model has 99 species.
Test model has 99 species. ✅
Original model has 386 reactions.
Test model has 386 reactions. ✅

Observables Test Case: RMS_CSTR_liquid_oxidation Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

RMS_CSTR_liquid_oxidation Passed Observable Testing ✅

Regression test fragment:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:30
Current: Execution time (DD:HH:MM:SS): 00:00:00:29
Reference: Memory used: 699.31 MB
Current: Memory used: 699.33 MB

fragment Passed Core Comparison ✅

Original model has 10 species.
Test model has 10 species. ✅
Original model has 2 reactions.
Test model has 2 reactions. ✅

fragment Passed Edge Comparison ✅

Original model has 33 species.
Test model has 33 species. ✅
Original model has 47 reactions.
Test model has 47 reactions. ✅

Observables Test Case: fragment Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

fragment Passed Observable Testing ✅
Errors occurred during observable testing ⚠️ WARNING:root:Initial mole fractions do not sum to one; normalizing.

Regression test RMS_constantVIdealGasReactor_fragment:

Reference: Execution time (DD:HH:MM:SS): 00:00:03:22
Current: Execution time (DD:HH:MM:SS): 00:00:02:42
Reference: Memory used: 2473.78 MB
Current: Memory used: 2387.74 MB

RMS_constantVIdealGasReactor_fragment Passed Core Comparison ✅

Original model has 10 species.
Test model has 10 species. ✅
Original model has 2 reactions.
Test model has 2 reactions. ✅

RMS_constantVIdealGasReactor_fragment Passed Edge Comparison ✅

Original model has 27 species.
Test model has 27 species. ✅
Original model has 24 reactions.
Test model has 24 reactions. ✅

Observables Test Case: RMS_constantVIdealGasReactor_fragment Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

RMS_constantVIdealGasReactor_fragment Passed Observable Testing ✅
Errors occurred during observable testing ⚠️ WARNING:root:Initial mole fractions do not sum to one; normalizing.

Regression test minimal_surface:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:31
Current: Execution time (DD:HH:MM:SS): 00:00:00:30
Reference: Memory used: 844.21 MB
Current: Memory used: 849.92 MB

minimal_surface Passed Core Comparison ✅

Original model has 11 species.
Test model has 11 species. ✅
Original model has 3 reactions.
Test model has 3 reactions. ✅

minimal_surface Passed Edge Comparison ✅

Original model has 38 species.
Test model has 38 species. ✅
Original model has 38 reactions.
Test model has 38 reactions. ✅

Observables Test Case: minimal_surface Comparison

✅ All Observables varied by less than 0.500 on average between old model and new model in all conditions!

minimal_surface Passed Observable Testing ✅

beep boop this comment was written by a bot 🤖

rwest added 2 commits October 22, 2025 11:53
Probably won't speed it up much, but we might as well.
…t are complete.

Sometimes you have a pressure-dependent network that has been studied 
in great detail and put in a seed mechanism or reaction library,
(such as CH2O2) and you don't want RMG to add reactions to the network
and your model, because doing so will make it worse.
Any reactions net reactions that are in your seed mechanism won't be changed,
but currently if there's a new reaction RMG would add it.

This option lets you specify in the input file that you don't want
RMG to expand certain networks further. You specify them with a line
in your pressureDependence block of your input file like

   completedNetworks = ['CH2O2', 'C2H6'],
@rwest rwest force-pushed the feat/complete_network branch from 39d6510 to 242798e Compare October 22, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant