ReactionMechanismGenerator / ReactionMechanismGenerator/RMG-Py

Writing input files fails for liquid cat reactor

Open
#2,883 2 comments 0 reactions 1 assignee View on GitHub

@sevyharris is already working on this.

Since Feb 9, 2026.

  • #2886 by @sevyharris — closed without merging
stale
Dominant language
Python
Stars
530
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
8

Description

Bug Description

I tried to read in and then write the input file for the liquid cat reactor and got this error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 10
      7 print('read RMG input file')
      9 new_input_file = 'new_input.py'
---> 10 rmgpy.rmg.input.save_input_file(new_input_file, rmg0)
     11 print('wrote RMG input file')

File ~/rmg/RMG-Py/rmgpy/rmg/input.py:1758, in save_input_file(path, rmg)
   1756 f.write('    temperature = ' + format_temperature(system) + '\n')
   1757 f.write('    initialConcentrations={\n')
-> 1758 for spcs, conc in system.initial_concentrations.items():
   1759     # conc may have been converted to SI, so we need to convert back
   1760     if type(conc) == float:
   1761         conc = Quantity(conc, Concentration.units)

AttributeError: 'ConstantTLiquidSurfaceReactor' object has no attribute 'initial_concentrations'

Also, the internal code for reading liquid reactor input files should use Quantity to hold the concentration instead of .value_si
https://github.com/sevyharris/RMG-Py/blob/e848daa4bb915809e1c32781dcb4a4dd83f905a2/rmgpy/rmg/input.py#L662

How To Reproduce
import os
import rmgpy.rmg.input
import rmgpy.rmg.main


# reset with  cp ~/rmg/RMG-Py/examples/rmg/superminimal/input.py .
my_input_file = '/home/moon/rmg/RMG-Py/examples/rmg/liquid_cat/input.py'

rmg0 = rmgpy.rmg.main.RMG()
rmgpy.rmg.input.read_input_file(my_input_file, rmg0)

print('read RMG input file')

new_input_file = 'new_input.py'
rmgpy.rmg.input.save_input_file(new_input_file, rmg0)
print('wrote RMG input file')
Expected Behavior

RMG should be able to write input files.

Installation Information
  • RMG version information:
    • RMG-Py: 6b6f576d0e21c5b096b56e7038d8256ac4d2457e
    • RMG-database: c73ea80097ec9b13e6c47f2bbe2dcec88752927d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.