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

to_rms issue

Open NUSCondy opened this issue 4 years ago • 9 comments

Hi @alongd ,

This issue seems to be related with RMS module. I have tried two different tests, one use AramcoMech_2.0 and the other is an example case. Both encountered bugs, shown below:

**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/rmg.py", line 118, in main() File "/home/zhuqiren/RMG-Py/rmg.py", line 112, in main rmg.execute(kwargs) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/main.py", line 755, in execute trimolecular_react=self.trimolecular_react) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/model.py", line 679, in enlarge self.update_unimolecular_reaction_networks() File "/home/zhuqiren/RMG-Py/rmgpy/rmg/model.py", line 1872, in update_unimolecular_reaction_networks network.update(self, self.pressure_dependence) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/pdep.py", line 893, in update reaction_model.add_reaction_to_edge(net_reaction) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/model.py", line 1478, in add_reaction_to_edge self.edge.phase_system.phases["Default"].add_reaction(rxn) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/reactors.py", line 217, in add_reaction self.reactions.append(to_rms(rxn, species_names=self.names, rms_species_list=self.species)) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/reactors.py", line 467, in to_rms kinetics = to_rms(obj.kinetics) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/reactors.py", line 483, in to_rms raise ValueError(f"Couldn't convert object of type {errortype} to an RMS object") ValueError: Couldn't convert object of type <class 'NoneType'> to an RMS object

****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/rmg.py", line 118, in main() File "/home/zhuqiren/RMG-Py/rmg.py", line 112, in main rmg.execute(kwargs) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/main.py", line 695, in execute self.initialize(kwargs) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/main.py", line 577, in initialize self.reaction_model.add_reaction_library_to_edge(library) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/model.py", line 1725, in add_reaction_library_to_edge self.add_reaction_to_edge(rxn) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/model.py", line 1478, in add_reaction_to_edge self.edge.phase_system.phases["Default"].add_reaction(rxn) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/reactors.py", line 217, in add_reaction self.reactions.append(to_rms(rxn, species_names=self.names, rms_species_list=self.species)) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/reactors.py", line 467, in to_rms kinetics = to_rms(obj.kinetics) File "/home/zhuqiren/RMG-Py/rmgpy/rmg/reactors.py", line 416, in to_rms efficiencies = {spc.label: float(val) for spc, val in obj.efficiencies.items() if val != 1} File "/home/zhuqiren/RMG-Py/rmgpy/rmg/reactors.py", line 416, in efficiencies = {spc.label: float(val) for spc, val in obj.efficiencies.items() if val != 1} AttributeError: 'rmgpy.molecule.molecule.Molecule' object has no attribute 'label'

The input files are attached input1.txt inputAramco.txt :

NUSCondy avatar Oct 15 '21 04:10 NUSCondy

@mjohnson541, would you know?

alongd avatar Oct 15 '21 06:10 alongd

Hi, FYI, for the ethane example case, if I comment the pressure dependence options, it becomes good again. For the one using AramcoMech_2.0, such a change doesn't work.

NUSCondy avatar Oct 15 '21 08:10 NUSCondy

We're working on these in https://github.com/ReactionMechanismGenerator/RMG-Py/pull/2208. I think the second one is at least fixed on that branch.

mjohnson541 avatar Oct 15 '21 12:10 mjohnson541

Hi,

FYI, I have tried to build an ethane oxidation mechanism using Aramcomech_2.0 thermo and kinetics library with RMG I installed in Sept 2020. It seems that it is okay with that old version.

NUSCondy avatar Oct 16 '21 04:10 NUSCondy

Hi @mjohnson541, Is this issue fixed on the latest version or on other branch?

NUSCondy avatar Oct 17 '21 08:10 NUSCondy

Sorry, I must've missed this, I think this is fixed on the other branch, which hopefully will be on main soon.

mjohnson541 avatar Oct 27 '21 22:10 mjohnson541

Hi @mjohnson541 , It is good to hear that. I also have a question about to_rms option. Since sensitivity analysis or simulation on model is optional, is it necessary to construct rms object when using RMG with these options not chosen?

NUSCondy avatar Oct 28 '21 02:10 NUSCondy

So RMG has to simulate the model as a part of mechanism generation. Before adding RMS, RMG relied on its own internal simulation codes that weren't particularly well optimized and were difficult to extend. Using RMS allows us to write new reactors easily and include simulations where the rate constants aren't constant efficiently. The long term plan is to switch over all the reactors over to RMS.

mjohnson541 avatar Oct 28 '21 13:10 mjohnson541

Got it! Thank you for the explanation!

NUSCondy avatar Oct 28 '21 13: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]