ReactionMechanismGenerator / RMG-Py

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

What elements are supported in CanTherm (Arkane)? #1494

Closed cjmcgill closed 5 years ago

cjmcgill commented 5 years ago

Topic

General area which your question is related to.

Context

I would like to use CanTherm to calculate thermo for some organometallics.

Question

What elements are currently supported in CanTherm? Is it limited to the elements in RMG? Could the load geometry from QC files implementation be more limited than CanTherm generally?

alongd commented 5 years ago

The elements supported by CanTherm depend on the model chemistry (see the documentation: http://reactionmechanismgenerator.github.io/RMG-Py/users/cantherm/input.html#model-chemistry). However, one can specify a dictionary of Atomic Energy Corrections, see an example on the same page I referred above. I hope that helps, let us know if you have other questions or encounter any issues.

(I did not understand the final question "Could the load geometry from QC files implementation be more limited than CanTherm generally?")

cjmcgill commented 5 years ago

In my attempt, I specified the dictionary of Atomic Energy Corrections for the atoms in my molecule (C,H,O,Sn). I got back this error.

File "C:\Anaconda\envs\rmg_env\lib\site-packages\rmgpy\cantherm\gaussian.py", line 160, in loadGeometry raise NotImplementedError('Atomic number {0:d} not yet supported in loadGeometry().'.format(number[i])) NotImplementedError: Atomic number 50 not yet supported in loadGeometry().

alongd commented 5 years ago

I see. We could fix it (for Sn and perhaps other elements). From the error message I think you're using the binary installation, so a fix would probably only be included in the next version. You could also install the developer version and update it once we merge a fix.

cjmcgill commented 5 years ago

That would definitely be worth me changing from binaries to a different install. If you do make that change, please comment on it in this thread so I know to switch over.

alongd commented 5 years ago

@cjmcgill, this should be addressed via #1473.

cjmcgill commented 5 years ago

I tried this with a new install from source where this fix should be merged in. I get what seems to be a similar message. Looking at the git log, this version does include "Merge pull request #1473", where the fix should be located.

  File "/home/cjmcgill/RMG/RMG-Py/rmgpy/cantherm/statmech.py", line 378, in load
    'Element {} is not yet supported.'.format(_rdkit_periodic_table.GetElementSymbol(atom_num))
Exception: Element Sn is not yet supported.

Anaconda environment from source in linux RMG-Py version: 2.1.0-1509-g359c69e

alongd commented 5 years ago

@cjmcgill, you're right, the fix we added allows Cantherm to read all elements (and ascribe correct masses) from the electronic structure software. To calculate thermo, we would also need the atom's heat of formation (in addition to atomic energy corrections that you already have). We recently added Iodine, perhaps you could come up with values for Tin, we'll happily review them and add them to Cantherm.

Here's some additional information from the code's comments:

# Step 2: Atom energy corrections to reach gas-phase reference state
        # Experimental enthalpy of formation at 0 K
        # See Gaussian thermo whitepaper at http://www.gaussian.com/g_whitepap/thermo.htm)
        # Note: these values are relatively old and some improvement may be possible by using newer values, particularly for carbon
        # However, care should be taken to ensure that they are compatible with the BAC values (if BACs are used)
        # The enthalpies listed here should correspond to the allowed elements in atom_num_dict
        # Iodine value is from Cox, J. D., Wagman, D. D., and Medvedev, V. A., CODATA Key Values for Thermodynamics, Hemisphere Publishing Corp., New York, 1989.
        atomHf = {'H': 51.63,
                  'Li': 37.69, 'Be': 76.48, 'B': 136.2, 'C': 169.98, 'N': 112.53, 'O': 58.99, 'F': 18.47,
                  'Na': 25.69, 'Mg': 34.87, 'Al': 78.23, 'Si': 106.6, 'P': 75.42, 'S': 65.66, 'Cl': 28.59, 'I':24.04}
        # Thermal contribution to enthalpy Hss(298 K) - Hss(0 K) reported by Gaussian thermo whitepaper
        # This will be subtracted from the corresponding value in atomHf to produce an enthalpy used in calculating the enthalpy of formation at 298 K
        atomThermal = {'H': 1.01,
                       'Li': 1.1, 'Be': 0.46, 'B': 0.29, 'C': 0.25, 'N': 1.04, 'O': 1.04, 'F': 1.05,
                       'Na': 1.54, 'Mg': 1.19, 'Al': 1.08, 'Si': 0.76, 'P': 1.28, 'S': 1.05, 'Cl': 1.1, 'I':1.48}
        # Total energy correction used to reach gas-phase reference state
        # Note: Spin orbit coupling no longer included in these energies, since some model chemistries include it automatically
cjmcgill commented 5 years ago

As a regular user of the atomization method used in Thermochemistry in Gaussian, I'm glad to see that you need experimental atomic heats of formation as well. I had been curious how you were getting by without them.

Those arrays that you show in the code excerpt, is that in an editable text file being referenced or is it something that has to be in the source when installed?

The sourcing for the original elements in the Gaussian paper are from the CODATA review/reference book. The relevant table can be seen at the below site. As noted in the code comments, the data is somewhat dated but many of them don't have more recent updates. The relevant values from that table for tin would be (601.2-6.215) kJ/mol and 6.215 kJ/mol, with unit conversions for consistency.

http://www.science.uwaterloo.ca/~cchieh/cact/tools/thermodata.html

alongd commented 5 years ago

Thanks for referencing the codata source. The data in the code could principally also be changed by users (it's right here) if RMG was installed by source. I'd also happily add relevant entries from the codata table for everyone's' benefit (and will update here once done) (If you upgrade our code or wait for the next release, please note that Cantherm was recently renamed as Arkane).

alongd commented 5 years ago

@cjmcgill, let us know whether this issue is now fixed on the current master branch

cjmcgill commented 5 years ago
File "/home/cjmcgill/RMG/RMG-Py/arkane/main.py", line 267, in execute
    job.execute(outputFile=outputFile, plot=self.plot)
  File "/home/cjmcgill/RMG/RMG-Py/arkane/statmech.py", line 192, in execute
    self.load()
  File "/home/cjmcgill/RMG/RMG-Py/arkane/statmech.py", line 379, in load
    'Element {} is not yet supported.'.format(_rdkit_periodic_table.GetElementSymbol(atom_num))
Exception: Element Sn is not yet supported.

I seem to be getting the same message still

Linux source install with anaconda RMG-Py 2.1.0-1517-gd2c282a

alongd commented 5 years ago

OK. Please upload an input file(s) to reproduce this error

cjmcgill commented 5 years ago

Yes of course. I'm attaching the relevant input files, including the Gaussian log file.

Inputs.zip

mliu49 commented 5 years ago

There is a hard-coded dictionary of supported elements here which might need to be updated. I haven't confirmed that this is the cause though.

alongd commented 5 years ago

Thanks @mliu49, I believe you're right

alongd commented 5 years ago

@cjmcgill, let us know if now Arkane works for Sn as expected

cjmcgill commented 5 years ago

Updated and it worked. I got reasonable looking results and no errors, so things are looking good. Thanks!

This was just an input for thermo. I will try it again a little later on with a canonical transition state using tin and verify if it works there too.

alongd commented 5 years ago

Glad to hear! Please do let us know :)

cjmcgill commented 5 years ago

The thermo calculations and transition state theory calculations seem to work for tin atoms.

cjmcgill commented 5 years ago

It appears that the site I referenced earlier for the thermo data is no longer available. Here is a new website reference that has the same information. There's a formal book reference for the data at that site as well.

http://www.codata.info/resources/databases/key1.html