RMG-Py icon indicating copy to clipboard operation
RMG-Py copied to clipboard

Creating a new RMG kinetics library

Open NUSCondy opened this issue 4 years ago • 15 comments

Question

The reaction library of RMG is limited when some new mechanisms are needed for the study. How to generate a new reaction library according to the existed mechanism like chem.cti or chem.inp?

Installation Information

Describe your installation method and system information if applicable.

  • OS (include version if known): (e.g. Windows 10, Ubuntu 18, macOS 10.13, etc.)
  • Installation method: (e.g. installation from binary or source, with or without anaconda)
  • RMG version information:
    • RMG-Py: 3.0
    • RMG-database: 3.0

NUSCondy avatar Jan 13 '21 09:01 NUSCondy

Hi @NUSCondy, to generate a new RMG library you'll need your Chemkin file and a species dictionary text file (see example for the dictionary file here). Then you can run the import Chemkin library script.

alongd avatar Jan 13 '21 09:01 alongd

Hi @alongd as you guided, I used the import chemkin script. But the problem occurs as below: NotImplementedError: Can't check isomorphism of lists with 4 species/molecules Moreover, it's quite time-consuming to create dictionary.txt manually and I know that some script was used to write dictionary.txt in RMG-Java, is there something similar in RMG-Py?

NUSCondy avatar Jan 15 '21 02:01 NUSCondy

Hi, you could use the importer tool written by @rwest, see here.

(tagging this issue as related to https://github.com/ReactionMechanismGenerator/RMG-Py/issues/1029)

alongd avatar Jan 15 '21 06:01 alongd

@alongd Thanks for your reply! When I run importChemkinLibrary.py again, following new problems happened: importChemkinLibrary.py:35: DeprecationWarning: RMG-Java loading is no longer supported and may be removed in version 2.3. species_list, reaction_list = load_chemkin_file(chemkin_path, dictionary_path) Traceback (most recent call last): File "importChemkinLibrary.py", line 43, in molecule = species.molecule[0].to_adjacency_list(), IndexError: list index out of range About the Chemkin Mechanism Importer, is that another kind of importer? or it's about how to use the importer?

NUSCondy avatar Jan 15 '21 09:01 NUSCondy

Was the Chemkin file indeed generated by RMG-Java, or is this a false identification by RMG?

The importer tool assists in semi-automatically deducing the molecular structure for each species in the Chemkin file (i.e., assigning adjacency lists / SMILES to species) It then also writes the corresponding kinetics and thermo RMG libraries.

alongd avatar Jan 15 '21 16:01 alongd

Hi @alongd Actually, it's the report by PMG-Py so I am confused with the RMG-Java warning. And the tool you mentioned written by @rwest is importChemkinLibrary.py? or some other script?

NUSCondy avatar Jan 16 '21 01:01 NUSCondy

Interesting. If you can, upload the Chemkin file for future debug. The tool is not the import script, follow the above link to explore it, its execution isn't as straight forward as the script, though.

alongd avatar Jan 16 '21 14:01 alongd

Sure @alongd The mechanism is AramcoMech2.0 and the link is as below: https://www.nuigalway.ie/media/researchcentres/combustionchemistrycentre/files/mechanismdownloads/aramcomech2/AramcoMech2.0.mech

NUSCondy avatar Jan 18 '21 04:01 NUSCondy

I think we've imported that one. https://figshare.com/articles/dataset/Combustion_Mechanism_Importer_and_Kinetic_Models/4787893?file=24801779

Check the RMG-models/AramcoMech_2.0/RMG-Py-kinetics-library and RMG-Py-thermo-library folders.

West, Richard (2017): Combustion Mechanism Importer and Kinetic Models. figshare. Dataset. https://doi.org/10.6084/m9.figshare.4787893.v2

rwest avatar Jan 18 '21 04:01 rwest

@rwest Thanks! I have tried your script. That's exactly I need now but some problem related to cherrypy happened: http://127.0.0.1:8080 Reading species list... [19/Jan/2021:13:48:40] ENGINE Bus STARTING Reading thermo file... [19/Jan/2021:13:48:40] ENGINE Bus STOPPING [19/Jan/2021:13:48:40] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) already shut down [19/Jan/2021:13:48:40] ENGINE Bus STOPPED [19/Jan/2021:13:48:40] ENGINE Bus EXITING [19/Jan/2021:13:48:40] ENGINE Bus EXITED And the process just stopped without any outputs.

NUSCondy avatar Jan 19 '21 05:01 NUSCondy

There's not enough of an error message there for me to debug. Not sure where the rest of it might be hiding itself. Anyway, here's the AramcoMech 2 model in the form of RMG thermo and kinetics libraries. AramcoMech_2.0.zip

rwest avatar Jan 20 '21 18:01 rwest

@alongd That's all the error report in the log file. I copy the importChemkin.py to the original RMG-Py directory and run it. I don't know if there are any other dependencies in the new RMG-Py written by you. And thanks for sharing the input libraries!

NUSCondy avatar Jan 21 '21 05:01 NUSCondy

@alongd @rwest When I try to use the new imported thermo libraries, it's show that:

rmgpy.exceptions.DatabaseError: Adjacency list and multiplicity of OHV matches that of existing molecule OH in thermo 
library . Please correct your library.

And I check the therm library py file and find:

    entry(
        index = 8,
        label = "OH",
        molecule = 
    """
    multiplicity 2
    1 O u1 p2 c0 {2,S}
    2 H u0 p0 c0 {1,S}
    """,
        thermo = NASA(
            polynomials = [
                NASAPolynomial(coeffs=[3.99198,-0.00240107,4.61664e-06,-3.87916e-09,1.3632e-12,3368.9,-0.103998], Tmin=(200,'K'), Tmax=(1000,'K')),
                NASAPolynomial(coeffs=[2.83853,0.00110741,-2.94e-07,4.20699e-11,-2.4229e-15,3697.81,5.84495], Tmin=(1000,'K'), Tmax=(6000,'K')),
            ],
            Tmin = (200,'K'),
            Tmax = (6000,'K'),
            E0 = (28.5525,'kJ/mol'),
            Cp0 = (29.1007,'J/mol/K'),
            CpInf = (37.4151,'J/mol/K'),
        ),
        shortDesc = """IU3/03""",
        longDesc = 
    """
    IU3/03.
    [OH]
    _imported from AramcoMech_2.0/Aramco2.0.dat.
    """,
    )
    
    entry(
        index = 9,
        label = "OHV",
        molecule = 
    """
    multiplicity 2
    1 O u1 p2 c0 {2,S}
    2 H u0 p0 c0 {1,S}
    """,
        thermo = NASA(
            polynomials = [
                NASAPolynomial(coeffs=[3.63727,0.000185091,-1.67616e-06,2.3872e-09,-8.43144e-13,50021.3,1.35886], Tmin=(298,'K'), Tmax=(1000,'K')),
                NASAPolynomial(coeffs=[2.88273,0.00101397,-2.27688e-07,2.17468e-11,-5.12631e-16,50265,5.59571], Tmin=(1000,'K'), Tmax=(5000,'K')),
            ],
            Tmin = (298,'K'),
            Tmax = (5000,'K'),
            E0 = (416.033,'kJ/mol'),
            Cp0 = (29.1007,'J/mol/K'),
            CpInf = (37.4151,'J/mol/K'),
        ),
        shortDesc = """121286""",
        longDesc = 
    """
    121286
    _low T polynomial Tmin changed from 300.0 to 298.0 K when importing to RMG.
    Duplicate of species OH (i.e. same molecular structure according to RMG)
    [OH]
    _imported from AramcoMech_2.0/Aramco2.0.dat.
    """,
    )

These two species are indeed duplicate and there are still a lot of species like these in the thermo file. So how could us use the new library and allow the duplicate species to exist? or How to avoid this problem? Looking forward to your reply!

NUSCondy avatar Jan 25 '21 08:01 NUSCondy

Sorry - probably at least OHV and CHV are the problems. The current version of RMG can't distinguish between these excited state species (that have the same multiplicity). There's a patch in the importer to track the molecularTermSymbol but it's not in the main branch yet. For now all you can do is remove them, and the reactions they participate in, from the libraries.

rwest avatar Jan 25 '21 14:01 rwest

Hi @rwest , I try to use importChemkin.py to import a DMM mechanism. However, it failed because 'SMILES.txt' file could not be found. As stated in the scripts, I key in the following commands: python ~/RMG-Py/importChemkin.py --species DMM_mechc.inp --thermo therm.dat

where the smiles.txt is not included. So do I need to make a smiles lib for the species in the model?

Also, there are some other problems when running this scripts. I have attached the input files and log file below: RMG.log.txt DMM_mechc.inp.txt therm.dat.txt

NUSCondy avatar Oct 27 '21 07:10 NUSCondy

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.

github-actions[bot] avatar Jun 21 '23 22:06 github-actions[bot]