ReactionMechanismGenerator / RMG-Py

Python version of the amazing Reaction Mechanism Generator (RMG).
http://reactionmechanismgenerator.github.io/RMG-Py/
Other
394 stars 227 forks source link

Duplicate reactions are not marked correctly when one is PDepArrhenius #778

Closed alongd closed 1 year ago

alongd commented 8 years ago

The DUP markings work, for example, for the reaction O + H2 <=> H + OH when imported from the KlippensteinH2O2 library, where it is defined as MultiArrhenius, and duplicate = True:

entry(
    index = 2,
    label = "O + H2 <=> H + OH",
    degeneracy = 1,
    duplicate = True,
    kinetics = MultiArrhenius(
        arrhenius = [
            Arrhenius(A=(3.818e+12, 'cm^3/(mol*s)'), n=0, Ea=(7948, 'cal/mol'), T0=(1, 'K')),
            Arrhenius(
                A = (8.792e+14, 'cm^3/(mol*s)'),
                n = 0,
                Ea = (19170, 'cal/mol'),
                T0 = (1, 'K'),
            ),
        ],
    ),
)

However, in my case, I created a new library from an RMG run which had dups. In that library the reactions are defined seperately, yet the duplicate label is set to True:

entry(
    index = 26,
    label = "O2(2) + CH3(18) <=> CH3O(26) + O(5)",
    degeneracy = 1,
    duplicate = True,
    kinetics = Arrhenius(
        A = (8.104e+12, 'cm^3/(mol*s)'),
        n = 0,
        Ea = (28.297, 'kcal/mol'),
        T0 = (1, 'K'),
    ),
)

entry(
    index = 34,
    label = "O2(2) + CH3(18) <=> CH3O(26) + O(5)",
    degeneracy = 1,
    duplicate = True,
    kinetics = PDepArrhenius(
        pressures = ([0.493, 0.855, 1.48], 'atm'),
        arrhenius = [
            Arrhenius(
                A = (5.002e+07, 'cm^3/(mol*s)'),
                n = 1.541,
                Ea = (27.151, 'kcal/mol'),
                T0 = (1, 'K'),
            ),
            Arrhenius(
                A = (5.007e+07, 'cm^3/(mol*s)'),
                n = 1.541,
                Ea = (27.151, 'kcal/mol'),
                T0 = (1, 'K'),
            ),
            Arrhenius(
                A = (5.015e+07, 'cm^3/(mol*s)'),
                n = 1.541,
                Ea = (27.152, 'kcal/mol'),
                T0 = (1, 'K'),
            ),
        ],
    ),
)

Generating a mechanism using that library results in an error message from the Chemkin pre-processor of undeclared duplicates.

Is there a way to define PLOG and Arrhenius kinetics in the same library entry? Or should this be changed in the way RMG handles DUPs from libraries?

I attach the library (called xo1247R). reactions.txt dictionary.txt

rwest commented 8 years ago

Here is one possible confusion, speculated without testing: Normally a pressure dependent and a pressure independent reaction do NOT need to be marked as duplicates in the final chemkin file, because the pressure dependent reaction will be O2 + CH3 (+M) <=> CH3O + O (+M) in chemkin form, and the normal Arrhenius would be O2 + CH3 <=> CH3O + O. Although RMG thinks they're duplicates (and has them marked as such) it would output the chemkin file without DUPLICATE tags, as they look different to chemkin. RMG thinks that PDepArrhenius is a type of pressure dependence, and thus outputs your two chemkin reactions (one Arrhenius and one PDepArrhenius) without DUPLICATE tags. However, the chemkin syntax for PLOG reactions is to write it without the (+M), and thus it looks the same as the Arrhenius version, and would require DUPLICATE tags. If this turns out to be the problem, perhaps rename the issue something like "Duplicate reactions are not marked correctly when one is PDepArrhenius"

alongd commented 8 years ago

Right, PLOG syntax is without the (+M), I agree that this looks like the source of the problem.

github-actions[bot] commented 1 year ago

This issue is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant issue, otherwise it will automatically be closed in 30 days.