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

RMG-Py - Solvation returns error? #325

Closed DetlevCM closed 1 year ago

DetlevCM commented 9 years ago

With lots of faffing about, I got RMG-Py to compile on Suse - this one seems to be bug free, BUT solvation does not appear to work... (Looking to compared RMG-Py to RMG-Java output)

Is it me having built something badly or is this a bug? This is from my own input file, bu the example file for liquid phase reactions also returns the same error.

Global RMG Settings:
   database.directory   = /home/detlevcm/RMG-database/input (Default, relative to RMG-Py source code)
RMG execution initiated at Thu Jan  8 14:43:41 2015

   ###################################################
  # RMG-Py - Reaction Mechanism Generator in Python #
  # Version: Early 2013                             #
  # Authors: RMG Developers (rmg_dev@mit.edu)       #
  # P.I.s:   William H. Green (whgreen@mit.edu)     #
  #          Richard H. West (r.west@neu.edu)       #
  # Website: http://greengroup.github.com/RMG-Py/   #
  ###################################################

The current git HEAD is:
        3f636ab8cc95d8cb0d63e306460cde79dd803499
        Mon Jan 5 17:10:49 2015 -0500

Reading input file "/home/detlevcm/RMG-Py/runs-rmg-py/Dodecane/input.py"...

Loading thermodynamics library from primaryThermoLibrary.py in /home/detlevcm/RMG-database/input/thermo/libraries...
Loading thermodynamics group database from /home/detlevcm/RMG-database/input/thermo/groups...
Loading transport library from GRI-Mech.py in /home/detlevcm/RMG-database/input/transport/libraries...
Consistency checking of multiplicity of molecules with more than 2 unpaired electrons is not implemented yet!
Loading transport library from PrimaryTransportLibrary.py in /home/detlevcm/RMG-database/input/transport/libraries...
Loading transport group database from /home/detlevcm/RMG-database/input/transport/groups...
Loading default kinetics families from /home/detlevcm/RMG-database/input/kinetics/families
Loading frequencies group database from /home/detlevcm/RMG-database/input/statmech/groups...
Loading Platts additivity group database from /home/detlevcm/RMG-database/input/solvation/groups...
Adding rate rules from training set in kinetics families...
Filling in rate rules in kinetics families by averaging...
Enabling diffusion-limited kinetics...
Setting solvent data for octane
NOT generating reactions for unreactive species Ar
NOT generating reactions for unreactive species He
NOT generating reactions for unreactive species Ne
NOT generating reactions for unreactive species N2
Generating thermodynamics for new species...
Generating kinetics for new reactions...

Summary of Model Enlargement
----------------------------
Added 4 new core species
    Ar
    He
    Ne
    N2
Created 0 new edge species
Added 0 new core reactions
Created 0 new edge reactions

After model enlargement:
    The model core has 4 species and 0 reactions
    The model edge has 0 species and 0 reactions

Found thermo for O2 in thermo library "corrected": primarythermolibrary
Found thermo for Ar in thermo library "corrected": primarythermolibrary
Found thermo for He in thermo library "corrected": primarythermolibrary
Found thermo for Ne in thermo library "corrected": primarythermolibrary
Found thermo for N2 in thermo library "corrected": primarythermolibrary
Adding species C12H26(1) to model core
Adding species O2(2) to model core
Generating thermodynamics for new species...
Found thermo for [H] in thermo library "corrected": primarythermolibrary
Found thermo for C in thermo library "corrected": primarythermolibrary
Error: Couldn't find in main abraham database:
Error: <Molecule "C">
Error: 1 C u0 p1 c0 {2,S} {3,S}
2 H u0 p0 c0 {1,S}
3 H u0 p0 c0 {1,S}

Traceback (most recent call last):
  File "rmg.py", line 147, in <module>
    rmg.execute(args)
  File "/home/detlevcm/RMG-Py/rmgpy/rmg/main.py", line 438, in execute
    self.initialize(args)
  File "/home/detlevcm/RMG-Py/rmgpy/rmg/main.py", line 426, in initialize
    self.reactionModel.enlarge([spec for spec in self.initialSpecies if spec.reactive])
  File "/home/detlevcm/RMG-Py/rmgpy/rmg/model.py", line 739, in enlarge
    spec.generateThermoData(database, quantumMechanics=self.quantumMechanics)
  File "/home/detlevcm/RMG-Py/rmgpy/rmg/model.py", line 165, in generateThermoData
    return self.processThermoData(database, thermo0, thermoClass)
  File "/home/detlevcm/RMG-Py/rmgpy/rmg/model.py", line 194, in processThermoData
    soluteData = database.solvation.getSoluteData(self)
  File "/home/detlevcm/RMG-Py/rmgpy/data/solvation.py", line 602, in getSoluteData
    soluteData = self.getSoluteDataFromGroups(species)
  File "/home/detlevcm/RMG-Py/rmgpy/data/solvation.py", line 662, in getSoluteDataFromGroups
    sdata = self.estimateSoluteViaGroupAdditivity(molecule)
  File "/home/detlevcm/RMG-Py/rmgpy/data/solvation.py", line 757, in estimateSoluteViaGroupAdditivity
    self.__addGroupSoluteData(soluteData, self.groups['abraham'], molecule, {'*':atom})
  File "/home/detlevcm/RMG-Py/rmgpy/data/solvation.py", line 791, in __addGroupSoluteData
    raise KeyError('Node has no parent with data in database.')
KeyError: 'Node has no parent with data in database.'
detlevcm@linux-nucv:~/RMG-Py> 
rwest commented 9 years ago

Problem looks like it's with

Error: <Molecule "C">
Error: 1 C u0 p1 c0 {2,S} {3,S}
2 H u0 p0 c0 {1,S}
3 H u0 p0 c0 {1,S}

First, if that is CH2 with a lone pair (as the adj list suggests) then why is it called <Molecule "C">?

Second, @bslakman, could you check if this CH2 can be found in the Abraham groups in the latest RMG-Py and Database?

P.s Detlev if there are improvements to be made to the installation instructions for Suse please share them!

chatelak commented 9 years ago

Dear @DetlevCM,

It looks like I already documented this issue #311 . Just put the primary thermo library to see if it helps.

best

DetlevCM commented 9 years ago

@rwest A few packages must be renamed for Suse - so python-dev becomes python-devel. There are some weird things too... install numpy with YaST, it fails, install it with python pip it work... I was thinking of creating a shell script - I think this will have to move up on my priorities list. (Creating installation instructions for SuSE)

@chatelak Thanks, but I believe it is added? Or do you mean the library is empty in the RMG-Py Directory? Thisis the input file. (I checked on the markup ;))

# Data sources
database(
    thermoLibraries = ['primaryThermoLibrary'],
    reactionLibraries = [],
    seedMechanisms = [],
    kineticsDepositories = ['training'],
    kineticsFamilies = 'default',
    kineticsEstimator = 'rate rules',
)

# List of species
species(
    label='C12H26',
    reactive=True,
    structure=SMILES("CCCCCCCCCCCC"),
)

species(
    label='O2',
    reactive=True,
    structure=SMILES("[O][O]"),
)

# Reaction systems
liquidReactor(
    temperature=(500,'K'),
    initialConcentrations={
        "C12H26": (4.7e-3,'mol/cm^3'),
        "O2": (0.002e-3,'mol/cm^3')
    },
    terminationTime=(7200,'s'),
)

solvation(
    solvent='octane'
)

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

model(
    toleranceKeepInEdge=0.0,
    toleranceMoveToCore=0.1,
    toleranceInterruptSimulation=0.1,
    maximumEdgeSpecies=100000
)

options(
    units='si',
    saveRestartPeriod=None,
    drawMolecules=True,
    generatePlots=True,
    saveEdgeSpecies=True,
    saveConcentrationProfiles=True,
)
bslakman commented 9 years ago

I am not sure why the CH2(S) is coming about, but the Platts groups are too specific to account for having a lone pair. For example here are the entries for -CH3 and >CH2 (both sp3)...

entry(
    index = 1,
    label = "CssH3",
    group =
"""
1 * Cs u0 {2,S} {3,S} {4,S} {5,S}
2   H  u0 {1,S}
3   H  u0 {1,S}
4   H  u0 {1,S}
5   R  u0 {1,S}
""",
    solute = SoluteData(
        S = -0.075,
        B = 0.007,
        E = -0.104,
        L = 0.321,
        A = 0,
    ),
    shortDesc = u"""Platts fragment 1 sp3 CH3""",
    longDesc =
u"""

""",
)

entry(
    index = 2,
    label = "CssH2",
    group =
"""
1 * Cs  u0 {2,S} {3,S} {4,S} {5,S}
2   H   u0 {1,S}
3   H   u0 {1,S}
4   R!H u0 {1,S}
5   R!H u0 {1,S}
""",
    solute = SoluteData(
        S = 0,
        B = 0,
        E = 0,
        L = 0.499,
        A = 0,
    ),
    shortDesc = u"""Platts fragment 2 sp3 >CH2""",
    longDesc =
u"""
""",
)

As you can see these groups are specified (both by me in the database entries and in Platts paper) that the C should be bonded to 4 atoms. (=CH2 is similar where it should be single bonded to two atoms and double bonded to another). This is fine for radicals because we do the same method for saturating with hydrogens as we do in thermo, but it will not work for molecules with lone pair.

I can try to make the groups more general and restructure the tree such that CH2(S) would be covered, but I'm not sure this is correct as Platts intended. I can also try to find solvation thermo for CH2(S) and put it in the solute library (or alternatively, @chatelak do you know if there is a 'corrected' thermo library that would include it?)

nickvandewiele commented 9 years ago

Dear @DetlevCM

Regarding RMG-Py dependencies for Suse OS's: have a look at #272 where I tabulated the equivalent package names for red hat systems.

Additionally, don't hesitate to report your findings on specific packages over there as well.

DetlevCM commented 9 years ago

@nickvandewiele Oh they are easy enough to pick out - it is more a matter of gathering all and making sure they work. (I got it to work, then had it fail, tried again and it worked - a clean VM each time.)

I'm trying to build a fairly rigorous shell script that covers all packages and zypper pulls any dependencies. One quirck that I have found: zypper install numpy works - but missed a head... but using pip directly is not advised, so upgrade numpy with pip afterwards... daft, well, I'm working on the shell as I "speak".

DetlevCM commented 9 years ago

@rwest @nickvandewiele With regards to the OpenSuSE install: For RMG minimal this is a complete list from my test, I may double check tomorrow just to make sure: https://github.com/GreenGroup/RMG-Py/issues/326

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.