Skip to content

Invalid k(E) values computed for path reaction. #77

Closed

Description

@rwest

Not sure what's going on here, but the methylformate example job dies with this:

Merging PDepNetwork #41809 and PDepNetwork #41810
Updating 2 modified unimolecular reaction networks...

========================================================================
Network Information (Network #41809)
-------------------
Isomers:
    H2CCCH(68)                                            347.693 kJ/mol
    CC#[C](459)                                           509.242 kJ/mol
    C1C=[C]1(4491)                                        513.113 kJ/mol
Reactant channels:
    H(17) + C3H2(69)                                      703.529 kJ/mol
    H(17) + [CH2]C#[C](2238)                              756.717 kJ/mol
    CH3(10) + C2(40)                                      968.493 kJ/mol
Product channels:
    H(17) + C1=C=C1(14986)                                706.706 kJ/mol
    H(17) + C1=[C][CH]1(14987)                            826.518 kJ/mol
    H(17) + C1[C]=[C]1(14988)                             988.462 kJ/mol
    [CH]1C=C1(14989)                                      377.133 kJ/mol
Path reactions:
    H2CCCH(68) <=> H(17) + C3H2(69)                       675.915 kJ/mol
    H(17) + [CH2]C#[C](2238) <=> H2CCCH(68)               756.717 kJ/mol
    H2CCCH(68) <=> C1C=[C]1(4491)                         573.629 kJ/mol
    CC#[C](459) <=> H2CCCH(68)                            654.052 kJ/mol
    CH3(10) + C2(40) <=> CC#[C](459)                      968.493 kJ/mol
    H(17) + [CH2]C#[C](2238) <=> CC#[C](459)              756.717 kJ/mol
    H(17) + C1=C=C1(14986) <=> C1C=[C]1(4491)             718.839 kJ/mol
    H(17) + C1=[C][CH]1(14987) <=> C1C=[C]1(4491)         826.518 kJ/mol
    H(17) + C1[C]=[C]1(14988) <=> C1C=[C]1(4491)          988.462 kJ/mol
    C1C=[C]1(4491) <=> [CH]1C=C1(14989)                   657.923 kJ/mol
========================================================================

Calculating densities of states for Network #41809...
Using 458 grains from 347.69 to 2042.67 kJ/mol in steps of 3.71 kJ/mol to compute densities of states
Calculating phenomenological rate coefficients for Network #41809...
Using 200 grains from 347.69 to 1085.77 kJ/mol in steps of 3.71 kJ/mol to compute the k(T,P) values at 292.578 K
Error: For path reaction H2CCCH(68) <=> H(17) + C3H2(69):
Error:     Expected kf(292.578 K) = 1.31499e-46
Error:       Actual kf(292.578 K) = 5.23653e-49
Error:     Expected Keq(292.578 K) = 2.85228e-57
Error:       Actual Keq(292.578 K) = 2.85228e-57
Traceback (most recent call last):
  File "rmg.py", line 134, in <module>
    cProfile.runctx(command, global_vars, local_vars, stats_file)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cProfile.py", line 49, in runctx
    prof = prof.runctx(statement, globals, locals)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cProfile.py", line 140, in runctx
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "/Users/rwest/Code/rmgpy/RMG-Py/rmgpy/rmg/main.py", line 388, in execute
    self.reactionModel.enlarge(objectsToEnlarge)
  File "/Users/rwest/Code/rmgpy/RMG-Py/rmgpy/rmg/model.py", line 636, in enlarge
    self.updateUnimolecularReactionNetworks(database)
  File "/Users/rwest/Code/rmgpy/RMG-Py/rmgpy/rmg/model.py", line 1290, in updateUnimolecularReactionNetworks
    network.update(self, database, self.pressureDependence)
  File "/Users/rwest/Code/rmgpy/RMG-Py/rmgpy/rmg/pdep.py", line 443, in update
    K = self.calculateRateCoefficients(Tlist, Plist, method, grainSize=grainSize, grainCount=grainCount)
  File "/Users/rwest/Code/rmgpy/RMG-Py/rmgpy/measure/network.py", line 852, in calculateRateCoefficients
    self.setConditions(T, P)
  File "/Users/rwest/Code/rmgpy/RMG-Py/rmgpy/measure/network.py", line 761, in setConditions
    self.calculateMicrocanonicalRates()
  File "/Users/rwest/Code/rmgpy/RMG-Py/rmgpy/measure/network.py", line 613, in calculateMicrocanonicalRates
    raise NetworkError('Invalid k(E) values computed for path reaction "{0}" do not satisfy'.format(rxn))
rmgpy.measure.network.NetworkError: Invalid k(E) values computed for path reaction "H2CCCH(68) <=> H(17) + C3H2(69)" do not satisfy

Measure input file for network 41809 is at https://gist.github.com/2910382

Activity

  1. jwallen commented on Feb 27, 2013

    @jwallen
    Contributor

    At the meeting Bill suggested that we go ahead and raise the barrier height to match the enthalpy of reaction for kinetics from reaction libraries, just like we currently do for rate rules. This would at least allow things to continue. Otherwise you would just have to remove/comment out the offending reaction from the library.

    Even though the plot above is shifted due to the systematic error, the rate of convergence looks rather typical of what I've seen. Clearly adding additional grains is having an effect, even if the convergence is to the wrong value in this instance. On the flip side, there is clearly convergence, so we can probably stop trying smaller discretizations before 10^6 grains.

    Incidentally, when you get a network that doesn't work you should be able to run CanTherm on it and reproduce the same error, but also get a drawing of the PES to study. This would perhaps more readily help identify issues such as this reaction. That way you might not have to wait for me to get around to it.

  2. faribas commented on Apr 11, 2013

    @faribas
    Contributor

    We just ran into this again (exactly the same reaction)

  3. faribas commented on Apr 11, 2013

    @faribas
    Contributor

    Do we want to raise the barrier just for the sake of PDep, or raise it for all reactions always (eg. as soon as we look it up)?
    And do we alter A in any way, or just slow down the overall rate?

  4. faribas commented on Apr 11, 2013

    @faribas
    Contributor

    Barrier height problem hopefully addressed in f477d79

  5. rwest commented on Apr 21, 2013

    @rwest
    MemberAuthor

    Looks like f477d79 didn't solve it.

    I've pared down an input file that hangs on its first network, to help debugging:

    # Data sources
    database(
        thermoLibraries = ['primaryThermoLibrary','DFT_QCI_thermo','GRI-Mech3.0'],
        reactionLibraries = [('Methylformate',False),('Glarborg/highP',False)],
        seedMechanisms = [],
        kineticsDepositories = ['training'],
        kineticsFamilies = ['!Intra_Disproportionation'],
        kineticsEstimator = 'rate rules',
    )
    
    # List of species
    species(
        label='H2CCCH',
        reactive=True,
        structure=SMILES("C#C[CH2]"),
    )
    species(
        label='[CH]=C=[CH]',
        reactive=True,
        structure=SMILES("[CH]=C=[CH]"),
    )
    species(
        label='[H]',
        reactive=True,
        structure=SMILES("[H]"),
    )
    
    # Bath gas
    species(
        label='Ar',
        reactive=False,
        structure=InChI("InChI=1S/Ar"),
    )
    
    # Reaction systems
    simpleReactor(
        temperature=(650,'K'),
        pressure=(1.0,'bar'),
        initialMoleFractions={
            "H2CCCH": 0.01,
            "Ar": 0.08,
        },
        terminationTime=(0.5,'s'),
    )
    simpleReactor(
        temperature=(1350,'K'),
        pressure=(3.0,'bar'),
        initialMoleFractions={
            "H2CCCH": 0.01,
            "Ar": 0.97,
        },
        terminationTime=(0.5,'s'),
    )
    simpleReactor(
        temperature=(1950,'K'),
        pressure=(10.0,'bar'),
        initialMoleFractions={
            "H2CCCH": 0.01,
            "Ar": 0.97,
        },
        terminationTime=(0.5,'s'),
    )
    
    simulator(
        atol=1e-22,
        rtol=1e-8,
    )
    
    model(
        toleranceKeepInEdge=0.0,
        toleranceMoveToCore=0.0005,
        toleranceInterruptSimulation=1.0,
        maximumEdgeSpecies=100000
    )
    
    pressureDependence(
        method='modified strong collision', # 'reservoir state'
        maximumGrainSize=(1.0,'kcal/mol'),
        minimumNumberOfGrains=200,
        temperatures=(290,3500,'K',8),
        pressures=(0.02,100,'bar',5),
        interpolation=('Chebyshev', 6, 4),
    )
    
    options(
        units='si',
        saveRestartPeriod=None,
        drawMolecules=True,
        generatePlots=False,
        saveConcentrationProfiles=False,
    )

    Gives this network:
    network

  6. jwallen commented on Apr 21, 2013

    @jwallen
    Contributor

    In this case it looks like the reaction at issue is given in the Glarborg/highP reaction library in the beta-scission direction. However, f477d79 only checks for Ea >= 0, and not also Ea >= dHrxn, when forcePositive=True.

  7. rwest commented on Apr 21, 2013

    @rwest
    MemberAuthor

    I thought the Ea >= dHrxn was always checked for endothermic Arrhenius reactions.
    I think the problem is that Library and Seed mechanisms were added to the edge/core without using the enlarge code, where we added the call to fixBarrierHeight. I am testing a fix now.

  8. rwest commented on Apr 21, 2013

    @rwest
    MemberAuthor

    What should we do with rmgpy.kinetics.arrhenius.MultiArrhenius kinetics in a highP library?
    Ensure each indidividual Arrhenius has Ea sufficiently high? (What do we do with them when we're about to run them through PDep?)

  9. jwallen commented on Apr 21, 2013

    @jwallen
    Contributor

    If that reaction is not going to be treated as pressure-dependent, then we can leave it as-is. For pressure dependence I think we'll have to fit a single Arrhenius so that we can have a single barrier height. So I guess do that and then adjust the resulting Ea if necessary?

  10. rwest commented on Apr 21, 2013

    @rwest
    MemberAuthor

    If it's in a Reaction Library, it'll be forced through PDep. Do we turn everything into Arrhenius at that point? (I guess we could pre-emptively do it when loading the reaction library).

    I see around line 473 of rmgpy/rmg/pdep.py

                elif isinstance(rxn.kinetics, KineticsData):
                    ...
                elif not isinstance(rxn.kinetics, Arrhenius):
                    raise Exception('Path reaction "{0}" in PDepNetwork #{1:d} has invalid kinetics type "{2!s}".'.format(rxn, self.index, rxn.kinetics.__class__))

    So it looks like everything is expected to be KineticsData or Arrhenius by that point, but I'm not sure where it'd be converted if it started as MultiArrhenius.

    Do seed mechanisms avoid the PDep code entirely? (i.e. should this checking not be done for them?)

  11. rwest commented on Apr 21, 2013

    @rwest
    MemberAuthor

    Commit 8aa385d checks for convergence inside the "add more grains" loop.
    This should avoid the endless loop in the case of a systematic error. It now just aborts the RMG Job.
    (Perhaps there is a more graceful way to recover, but for now we want to reveal the bugs and fix them)

  12. rwest commented on Apr 23, 2013

    @rwest
    MemberAuthor

    I've found what happens to MultiArrhenius reactions in a reaction library... They die:

      File "/nics/d/home/rwest/Code/RMG-Py/rmgpy/rmg/main.py", line 428, in execute
        self.reactionModel.enlarge(objectsToEnlarge)
      File "/nics/d/home/rwest/Code/RMG-Py/rmgpy/rmg/model.py", line 655, in enlarge
        self.updateUnimolecularReactionNetworks(database)
      File "/nics/d/home/rwest/Code/RMG-Py/rmgpy/rmg/model.py", line 1389, in updateUnimolecularReactionNetworks
        network.update(self, database, self.pressureDependence)
      File "/nics/d/home/rwest/Code/RMG-Py/rmgpy/rmg/pdep.py", line 490, in update
        raise Exception('Path reaction "{0}" in PDepNetwork #{1:d} has invalid kinetics type "{2!s}".'.format(rxn, self.index, rxn.kinetics.__class__))
    Exception: Path reaction "OH(11) + C2H2(41) <=> CHCHOH(43)" in PDepNetwork #384 has invalid kinetics type "<type 'rmgpy.kinetics.arrhenius.MultiArrhenius'>".
  13. rwest commented on Apr 30, 2013

    @rwest
    MemberAuthor

    I've made a .toArrhenius() method for MultiArrhenius kinetics. When do you think this should be called, @jwallen ? The place I had put the call to fixBarrierHeight() when adding reaction libraries to the edge does not seem to catch any MultiArrhenius kinetics.

  14. rwest commented on May 1, 2013

    @rwest
    MemberAuthor

    Think I have fixed this. Decided to implement it within the PDepNetwork code.
    Hopefully that's this issue closed!! (for now)

  15. added
    Status: Stale
    on Aug 28, 2015
  16. github-actions commented on Jun 22, 2023

    @github-actions

    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.

  17. added
    stale
    on Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ArkaneStatus: Stalestale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions