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

Liquid phase reaction: solvent representation #671

Closed yunsiechung closed 8 years ago

yunsiechung commented 8 years ago

In liquidReactor, RMG can recognize any existing species or newly generating species as a solvent as long as the solvent is named the same thing in the solvent block of the input file and in the species block. For example, if octane is used as a solvent, the user has to input it in both species and solvation block in the input file by the same name:

# List of species
species(
    label='octane',
    reactive=True,
    structure=SMILES("C(CCCCC)CC"),
)

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

# Reaction systems
liquidReactor(
    temperature=(500,'K'),
    initialConcentrations={
        "octane": (6.154e-3,'mol/cm^3'),
        "oxygen": (4.953e-6,'mol/cm^3')
    },
    terminationTime=(5,'s'),
)

solvation(
    solvent='octane'
)

However, this causes a problem if the solvent is called "octane" in the solvation block and called "n-octane" in the species block although they represent the same molecule. Some possible ways to avoid this problem are:

  1. In the solvent database, we will add SMILES or adjacency list for each solvent. Then when solvent name is input, RMG will first check whether any of the species has the same molecular structure or resonance structure and recognize that specie as a solvent. If solvent molecule is not on the species list, it should output an error.
  2. In the species block of the input file, we could add another attribute called "isSolvent" that is True if the species is a solvent and False if not, and remove solvation Block.

Which way would be better / cause less problems? Are there any other suggestions? Regardless of which method to use, I will still add SMILES representation for every solvent in solvent database.

Thank you!

bslakman commented 8 years ago

My first reaction to option 2 is that we do lots of initializing stuff etc. based on the solvent block in the input file (check in rmgpy/rmg: input.py, main.py, model.py, probably others), so removing the solvent block would break things currently.

yunsiechung commented 8 years ago

I see. I can try option 1 !