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

Merge Models: list out of range

Open NUSCondy opened this issue 3 years ago • 2 comments

Hi,

I am trying to merge two models with the scripts in RMG-Py. However, it seems that I always encountered the problem: list out of range. First I tried with the mechanism downloaded, which is AramcoMech2.0 with the dictionary.txt. The results is followed: **Loading model #1... Loading model #2... Traceback (most recent call last): File "rmgpy/chemkin.pyx", line 597, in rmgpy.chemkin._read_kinetics_line IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "//home/zhuqiren/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 308, in main python(**vars(ns)) File "//home/zhuqiren/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 59, in python scope = runpy.run_path(script, run_name="main") File "//home/zhuqiren/anaconda3/envs/rmg_env/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "//home/zhuqiren/anaconda3/envs/rmg_env/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "//home/zhuqiren/anaconda3/envs/rmg_env/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/zhuqiren/RMG-Py/scripts/mergeModels.py", line 52, in main() File "/home/zhuqiren/RMG-Py/scripts/mergeModels.py", line 48, in main merge_models.main() File "/home/zhuqiren/RMG-Py/rmgpy/tools/mergemodels.py", line 94, in main execute(input_model_files, kwargs) File "/home/zhuqiren/RMG-Py/rmgpy/tools/mergemodels.py", line 109, in execute models = get_models_to_merge(input_model_files) File "/home/zhuqiren/RMG-Py/rmgpy/tools/mergemodels.py", line 133, in get_models_to_merge model.species, model.reactions = load_chemkin_file(chemkin, species_path, transport_path=transport_path) File "rmgpy/chemkin.pyx", line 943, in rmgpy.chemkin.load_chemkin_file File "rmgpy/chemkin.pyx", line 970, in rmgpy.chemkin.load_chemkin_file File "rmgpy/chemkin.pyx", line 1436, in rmgpy.chemkin.read_reactions_block File "rmgpy/chemkin.pyx", line 1429, in rmgpy.chemkin.read_reactions_block File "rmgpy/chemkin.pyx", line 214, in rmgpy.chemkin.read_kinetics_entry File "rmgpy/chemkin.pyx", line 602, in rmgpy.chemkin._read_kinetics_line rmgpy.exceptions.ChemkinError: Could not read collider efficiencies for reaction: H2 <=> H + H. The following line was parsed incorrectly: CH4/2.00/ C2H6/3.00/ H2O/12.00/ CO2/3.80/ CO/1.90/ H2/2.50/ HE/0.83/ (Case-preserved tokens: ['CH4', '2.00', ' C2H6', '3.00', ' H2O', '12.00', ' CO2', '3.80', ' CO', '1.90', ' H2', '2.50', ' He', '0.83', ''] )

I thought it could be the problem with the models so I then use the models built by RMG, again, it also has some problems. The error info is: Loading model #1... Loading model #2... Ignoring common species and reactions from model #1... Added 74 out of 74 (100.0%) unique species from model #1. Added 183 out of 183 (100.0%) unique reactions from model #1. Ignoring common species and reactions from model #2... Species H2O2 thermo from model 1 did not match that of model 2. Species OCHO thermo from model 1 did not match that of model 2. Species CH3 thermo from model 1 did not match that of model 2. Species CH3O2H thermo from model 1 did not match that of model 2. Species CH2OH thermo from model 1 did not match that of model 2. Species CH2O2H thermo from model 1 did not match that of model 2. Species HOCHO thermo from model 1 did not match that of model 2. Species C2H5 thermo from model 1 did not match that of model 2. Added 448 out of 485 (92.4%) unique species from model #2. Added 2556 out of 2556 (100.0%) unique reactions from model #2. The merged model has 522 species and 2739 reactions WARNING:root:Marked reaction C2H3(28) + CH3(12) <=> C3H6(124) as duplicate of C3H6(124) <=> C2H3(28) + CH3(12) for saving to Chemkin file. **Traceback (most recent call last): File "//home/zhuqiren/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 308, in main python(**vars(ns)) File "//home/zhuqiren/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 59, in python scope = runpy.run_path(script, run_name="main") File "//home/zhuqiren/anaconda3/envs/rmg_env/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "//home/zhuqiren/anaconda3/envs/rmg_env/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "//home/zhuqiren/anaconda3/envs/rmg_env/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/zhuqiren/RMG-Py/scripts/mergeModels.py", line 52, in main() File "/home/zhuqiren/RMG-Py/scripts/mergeModels.py", line 48, in main merge_models.main() File "/home/zhuqiren/RMG-Py/rmgpy/tools/mergemodels.py", line 94, in main execute(input_model_files, kwargs) File "/home/zhuqiren/RMG-Py/rmgpy/tools/mergemodels.py", line 114, in execute save_chemkin_file(output_chemkin_file, final_model.species, final_model.reactions) File "rmgpy/chemkin.pyx", line 2136, in rmgpy.chemkin.save_chemkin_file File "rmgpy/chemkin.pyx", line 1549, in rmgpy.chemkin.write_thermo_entry File "rmgpy/species.py", line 740, in rmgpy.species.Species.get_thermo_data File "/home/zhuqiren/RMG-Py/rmgpy/thermo/thermoengine.py", line 175, in submit spc.thermo = evaluator(spc, solvent_name=solvent_name) File "/home/zhuqiren/RMG-Py/rmgpy/thermo/thermoengine.py", line 159, in evaluator spc.generate_resonance_structures() File "rmgpy/species.py", line 266, in rmgpy.species.Species.generate_resonance_structures File "rmgpy/species.py", line 274, in rmgpy.species.Species.generate_resonance_structures IndexError: list index out of range

NUSCondy avatar Dec 08 '21 12:12 NUSCondy

I'm not very familiar with these errors, but it looks like you might be missing collider species (for the first error) and possibly inerts? (in the second error) in your species dictionary. For the first case, I would look at all your colliders in your chemkin file (CH4, C2H6, H2O, CO2 , CO, H2, HE) and make sure there is a matching species with that same label in you species dictionary. My guess is that HE may be missing. For the second case, if you used the rmg generated species dictionary, inert species (HE for example) should be in there, but you might want to double check.

davidfarinajr avatar Dec 08 '21 19:12 davidfarinajr

Thank you for your explaining. You are right and it is the problem with the species list. Though it is not about HE. It is because when exporting the models there are some errors in the chem.inp. The label of N2 is N2 in the species list but is N#N in the other parts, thermo, and dictionary, causing the error. The exporting problem doesn't always happen but reconfirmation is needed.

NUSCondy avatar Dec 09 '21 13:12 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]