Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatabaseError with Thermo Parameters for F #2713

Open
studies9 opened this issue Sep 11, 2024 · 9 comments
Open

DatabaseError with Thermo Parameters for F #2713

studies9 opened this issue Sep 11, 2024 · 9 comments

Comments

@studies9
Copy link

DatabaseError related to thermo parameter estimation for fluorine-containing molecules in RMG-Py. Specifically, the error message is:
DatabaseError: Unable to determine thermo parameters for atom {'*': <Atom 'F'>} in molecule <Molecule "OOC(F)F">: no data for node R or any of its ancestors in database group.

I encounter this issue both with and without a seed mechanism. For instance, when using a seed mechanism, I receive the following error:
DatabaseError: Unable to determine thermo parameters for atom {'*': <Atom 'F'>} in molecule <Molecule "OCF">: no data for node R or any of its ancestors in database group.

@JacksonBurns
Copy link
Contributor

Searching this molecule on rmg.mit.edu yields results - do you have the Fluorine library included in your thermoLibraries?

@studies9
Copy link
Author

Data sources

database(
thermoLibraries = ['primaryThermoLibrary', 'Fluorine'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = 'default',
kineticsEstimator = 'rate rules',
)

List of species

species(
label='CH2F2',
reactive=True,
structure=SMILES("FCF"),
)
species(
label='O2',
reactive=True,
structure=SMILES("[O][O]"),
)

species(
label='Ar',
reactive=True,
structure=SMILES("[Ar]"),
)

Reaction systems

simpleReactor(
temperature=(600,'K'),
pressure=(1.0,'bar'),
initialMoleFractions={
"CH2F2": 0.025, "Ar": 0.95, "O2": 0.025,
},
terminationConversion={
'O2': 0.9999,
},
terminationTime=(1e12,'s'),
)

simulator(
atol=1e-16,
rtol=1e-8,
)

model(
toleranceKeepInEdge=1e-5,
toleranceMoveToCore=0.01,
toleranceInterruptSimulation=0.1,
maximumEdgeSpecies=100000
)

options(
units='si',
generateOutputHTML=False,
generatePlots=False,
saveEdgeSpecies=True,
saveSimulationProfiles=True,
)

@JacksonBurns
Copy link
Contributor

Try adding the CHOF_G4 thermo library as well

@studies9
Copy link
Author

The CHOF_G4 library is not available in our current RMG version. How can I obtain it?

@JacksonBurns
Copy link
Contributor

You need to upgrade your version of RMG-database, see here if you installed form source: https://reactionmechanismgenerator.github.io/RMG-Py/users/rmg/installation/updatingSourceCode.html?highlight=update+database

@REACTION3
Copy link

Loading frequencies library from halogens_G4.py in /home/ubuntu/miniconda3/envs/rmg_env/share/rmgdatabase/statmech/libraries...
Error: Error while reading database '/home/ubuntu/miniconda3/envs/rmg_env/share/rmgdatabase/statmech/libraries/halogens_G4.py'.
Traceback (most recent call last):
File "/home/ubuntu/miniconda3/envs/rmg_env/bin/rmg.py", line 118, in
main()
File "/home/ubuntu/miniconda3/envs/rmg_env/bin/rmg.py", line 112, in main
rmg.execute(**kwargs)
File "/home/ubuntu/miniconda3/envs/rmg_env/lib/python3.7/site-packages/rmgpy/rmg/main.py", line 673, in execute
self.initialize(**kwargs)
File "/home/ubuntu/miniconda3/envs/rmg_env/lib/python3.7/site-packages/rmgpy/rmg/main.py", line 496, in initialize
self.load_database()
File "/home/ubuntu/miniconda3/envs/rmg_env/lib/python3.7/site-packages/rmgpy/rmg/main.py", line 374, in load_database
depository=False, # Don't bother loading the depository information, as we don't use it
File "/home/ubuntu/miniconda3/envs/rmg_env/lib/python3.7/site-packages/rmgpy/data/rmg.py", line 106, in load
self.load_statmech(os.path.join(path, 'statmech'), statmech_libraries, depository)
File "/home/ubuntu/miniconda3/envs/rmg_env/lib/python3.7/site-packages/rmgpy/data/rmg.py", line 197, in load_statmech
self.statmech.load(path, statmech_libraries, depository)
File "/home/ubuntu/miniconda3/envs/rmg_env/lib/python3.7/site-packages/rmgpy/data/statmech.py", line 517, in load
self.load_libraries(os.path.join(path, 'libraries'), libraries)
File "/home/ubuntu/miniconda3/envs/rmg_env/lib/python3.7/site-packages/rmgpy/data/statmech.py", line 541, in load_libraries
library.load(os.path.join(root, f), self.local_context, self.global_context)
File "/home/ubuntu/miniconda3/envs/rmg_env/lib/python3.7/site-packages/rmgpy/data/base.py", line 239, in load
exec(f.read(), global_context, local_context)
File "", line 18, in
TypeError: 'NoneType' object is not subscriptable

@rwest
Copy link
Member

rwest commented Sep 13, 2024

You probably need to update RMG-Py also, in order to read the new database.
The stack trace you post says the error is in File "/home/ubuntu/miniconda3/envs/rmg_env/lib/python3.7/site-packages/rmgpy/data/base.py", line 239, in load exec(f.read(), global_context, local_context)
But I think line 239 of the file rmgpy/data/base.py hasn't contained the code exec(f.read(), global_context, local_context) since May 2021.

In my experience, easiest to install an entire new version, in a brand new environment (give it a new name, not rmg_env). This greatly increases the chance of it working, and also decreases the chance of you messing up your old version.

@studies9
Copy link
Author

Traceback (most recent call last):
File "/home/ubuntu/Downloads/RMG-Py/rmg.py", line 118, in
main()
File "/home/ubuntu/Downloads/RMG-Py/rmg.py", line 112, in main
rmg.execute(**kwargs)
File "/home/ubuntu/Downloads/RMG-Py/rmgpy/rmg/main.py", line 752, in execute
self.initialize(**kwargs)
File "/home/ubuntu/Downloads/RMG-Py/rmgpy/rmg/main.py", line 553, in initialize
self.reaction_model.add_species_to_edge(spec)
File "/home/ubuntu/Downloads/RMG-Py/rmgpy/rmg/model.py", line 1178, in add_species_to_edge
self.edge.phase_system.phases["Default"].add_species(spec)
File "/home/ubuntu/Downloads/RMG-Py/rmgpy/rmg/reactors.py", line 294, in add_species
spec = to_rms(spc)
File "/home/ubuntu/Downloads/RMG-Py/rmgpy/rmg/reactors.py", line 699, in to_rms
rad = rms.getspeciesradius(atomnums, bondnum)
NameError: name 'rms' is not defined
i have installed an entire new version, but then too this error comes up

@JacksonBurns
Copy link
Contributor

It looks like you missed steps 11. and/or 12. in the installation instructions here: https://reactionmechanismgenerator.github.io/RMG-Py/users/rmg/installation/anacondaDeveloper.html
or you are not running RMG-Py from inside the correct conda environment.

An alternative is to install the Docker image, which avoids having to do this manual installation: https://reactionmechanismgenerator.github.io/RMG-Py/users/rmg/installation/index.html#recommended-install-docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants