ReactionMechanismGenerator / RMG-Py

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

S6ddd-XdXdXd node non-existing #2152

Closed Jakubanoo closed 1 year ago

Jakubanoo commented 3 years ago

Context

Im getting an error while trying to simulate pyrolysis of diethyl sulfide:

For reaction generation 1 process is used.
Generating thermo for new species...
Traceback (most recent call last):
  File "rmg.py", line 118, in <module>
    main()
  File "rmg.py", line 112, in main
    rmg.execute(**kwargs)
  File "/home/jakub/RMG/RMG-Py/rmgpy/rmg/main.py", line 923, in execute
    trimolecular_react=self.trimolecular_react)
  File "/home/jakub/RMG/RMG-Py/rmgpy/rmg/model.py", line 614, in enlarge
    self.apply_thermo_to_species(procnum)
  File "/home/jakub/RMG/RMG-Py/rmgpy/rmg/model.py", line 824, in apply_thermo_to_species
    self.generate_thermo(spc, rename=True)
  File "/home/jakub/RMG/RMG-Py/rmgpy/rmg/model.py", line 831, in generate_thermo
    submit(spc, self.solvent_name)
  File "/home/jakub/RMG/RMG-Py/rmgpy/thermo/thermoengine.py", line 175, in submit
    spc.thermo = evaluator(spc, solvent_name=solvent_name)
  File "/home/jakub/RMG/RMG-Py/rmgpy/thermo/thermoengine.py", line 160, in evaluator
    thermo = generate_thermo_data(spc, solvent_name=solvent_name)
  File "/home/jakub/RMG/RMG-Py/rmgpy/thermo/thermoengine.py", line 125, in generate_thermo_data
    thermo0 = thermodb.get_thermo_data(spc)
  File "/home/jakub/RMG/RMG-Py/rmgpy/data/thermo.py", line 1406, in get_thermo_data
    thermo0 = self.get_thermo_data_from_groups(species)
  File "/home/jakub/RMG/RMG-Py/rmgpy/data/thermo.py", line 1876, in get_thermo_data_from_groups
    tdata = self.estimate_thermo_via_group_additivity(molecule)
  File "/home/jakub/RMG/RMG-Py/rmgpy/data/thermo.py", line 2112, in estimate_thermo_via_group_additivity
    thermo_data = self.estimate_radical_thermo_via_hbi(molecule, self.compute_group_additivity_thermo)
  File "/home/jakub/RMG/RMG-Py/rmgpy/data/thermo.py", line 2023, in estimate_radical_thermo_via_hbi
    thermo_data_sat = stable_thermo_estimator(saturated_struct)
  File "/home/jakub/RMG/RMG-Py/rmgpy/data/thermo.py", line 2150, in compute_group_additivity_thermo
    data_added = self._add_group_thermo_data(thermo_data, self.groups['group'], molecule, {'*': atom})[1]
  File "/home/jakub/RMG/RMG-Py/rmgpy/data/thermo.py", line 2543, in _add_group_thermo_data
    raise DatabaseError(f"Node {node.label} points to a non-existing group called {data} "
rmgpy.exceptions.DatabaseError: Node S6ddd points to a non-existing group called S6ddd-XdXdXd in database group

Initial input.py:

# Data sources
database(
    thermoLibraries = ['primaryThermoLibrary','SulfurLibrary','GRI-Mech3.0'],
    reactionLibraries = [("primarySulfurLibrary",False),("GRI-Mech3.0",False),("Sulfur/DMS",False),("Sulfur/DMDS",False),("Sulfur/TP_Song",False)],
    seedMechanisms = [],
    kineticsDepositories = ['training'], 
    kineticsFamilies = 'default',
    kineticsEstimator = 'rate rules',
)

generatedSpeciesConstraints(
    allowed=['input species','seed mechanisms','reaction libraries'],
    maximumRadicalElectrons=1,
    maximumCarbonAtoms=8,
    maximumSulfurAtoms=2,
)
# List of species
species(
    label='DES',
    reactive=True,
    structure=SMILES("S(CC)CC"),
)

# Reaction systems
simpleReactor(
    temperature=(1000,'K'),
    pressure=(1.0,'bar'),
    initialMoleFractions={
        "DES": 1,
    },
    terminationConversion={
        'DES': 0.9,
    },
    terminationTime=(1e-1,'s'),
)

simulator(
    atol=1e-16,
    rtol=1e-8,
)

model(
    filterReactions=True,
    toleranceKeepInEdge=0.01,
    toleranceMoveToCore=0.1,
    toleranceInterruptSimulation=1,
    maximumEdgeSpecies=100000
)

options(
    units='si',
    generateOutputHTML=False,
    generatePlots=False,
    saveEdgeSpecies= False,
    saveSimulationProfiles=True,
)

I did some digging, and I know that node S6ddd-XdXdXd exists in group.py, but does not exist in radical.py RMG.txt

Thermo and reaction librares have no influence on the error outcome.

Question

Any ideas on how to deal with this, besides forbiding radical electrons?

Installation Information

OS: Ubuntu 18 Installation method: installation from source, RMG version information: RMG-Py: 3.1.0-59-g74b176a77 RMG-database: 3.0.0-206-g833577ec

rwest commented 3 years ago

Looks like https://github.com/ReactionMechanismGenerator/RMG-database/commit/91f6793bb2eba72ba9804e2ef90d14f9b2cde056 added

entry(
    index = 2030,
    label = "S6ddd",
    group =
"""
1 * S6ddd  u0
""",
    thermo = u'S6ddd-XdXdXd',
    shortDesc = u"""Sulfur/Oxygen Extension, Ryan Gillis""",
    longDesc =
u""""
""",
)

which became

entry(
    index = 2506,
    label = "S6ddd",
    group = 
"""
1 * S6ddd u0
""",
    thermo = 'S6ddd-XdXdXd',
    shortDesc = """Sulfur/Oxygen Extension, Ryan Gillis""",
    longDesc = 
"""
"
""",
)

through some re-writing of the database.

It does indeed refer to a group that doesn't seem to exist.

I don't seem to have the git commit of your RMG-database though (g833577ec) so yours may be different.

Not sure who's best to take a look now that @rgillis8 has graduated.

Jakubanoo commented 3 years ago

Okay, so for now i replaced

entry(
    index = 2506,
    label = "S6ddd",
    group = 
"""
1 * S6ddd u0
""",
    thermo = 'S6ddd-XdXdXd',
    shortDesc = """Sulfur/Oxygen Extension, Ryan Gillis""",
    longDesc = 
"""
"
""",
)

with

entry(
    index = 2506,
    label = "S6ddd",
    group = 
"""
1 * S6ddd u0
""",
    thermo = 'S6ddd-OdXdXd',
    shortDesc = """Sulfur/Oxygen Extension, Ryan Gillis""",
    longDesc = 
"""
"
""",
)

S6ddd-OdXdXd has thermo data assigned (opposed to S6ddd-XdXdXd), so the simulation keeps going. Now my question is: obviously S6ddd-XdXdXd thermo differs from S6ddd-OdXdXd thermo, but what is the fix for this? Do i search for thermo data for S6ddd (Sulfur-No lone pairs, up to three double bonds) and then assign it?

Thank you in advance.

yunfeigaosh commented 2 years ago

@Jakubanoo Jakubanoo Did you figure this issue out? I ran into the same error. Thanks in advance!

mjohnson541 commented 2 years ago

I took a look and I think the proposed fix referencing to S6ddd-OdXdXd instead is the right call. It looks like the most reasonable node to use here.

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.