Skip to content

Commit 363e2a6

Browse files
authored
Merge branch 'main' into fix/avoid_unnecessary_julia
2 parents d8607f9 + 36bceb3 commit 363e2a6

6 files changed

Lines changed: 37 additions & 10 deletions

File tree

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#
55
################################################################################
66

7+
CC=gcc
8+
CXX=g++
9+
710
.PHONY : all minimal main solver check pycheck arkane clean install decython documentation test q2dtor
811

912
all: pycheck main solver check

documentation/source/users/rmg/input.rst

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ by Benson's method.
4949

5050
For example, if you wish to use the GRI-Mech 3.0 mechanism [GRIMech3.0]_ as a ThermoLibrary in your model, the syntax will be::
5151

52-
thermoLibraries = ['primaryThermoLibrary','GRI-Mech3.0']
52+
thermoLibraries = ['primaryThermoLibrary', 'GRI-Mech3.0']
5353

5454
.. [GRIMech3.0] Gregory P. Smith, David M. Golden, Michael Frenklach, Nigel W. Moriarty, Boris Eiteneer, Mikhail Goldenberg, C. Thomas Bowman, Ronald K. Hanson, Soonho Song, William C. Gardiner, Jr., Vitali V. Lissianski, and Zhiwei Qin http://combustion.berkeley.edu/gri-mech/
5555
@@ -78,7 +78,7 @@ In the following example, the user has created
7878
a reaction library with a few additional reactions specific to n-butane, and these reactions
7979
are to be used in addition to the Glarborg C3 library::
8080

81-
reactionLibraries = [('Glarborg/C3',False)],
81+
reactionLibraries = [('Glarborg/C3', False)],
8282

8383
The keyword False/True permits user to append all unused reactions (= kept in the edge) from this library to the chemkin file.
8484
True means those reactions will be appended. Using just the string inputs would lead to
@@ -104,6 +104,23 @@ given in each mechanism, the different mechanisms can have different units.
104104
Library.
105105

106106

107+
.. _externallib:
108+
109+
External Libraries
110+
------------------
111+
Users may direct RMG to use thermo and/or kinetic libraries which are not included in the RMG database,
112+
e.g., a library a user created that was intentionally saved to a path different than the conventional
113+
RMG-database location. In such cases, the user can specify the full path to the library in the input file::
114+
115+
thermoLibraries = ['path/to/your/thermo/library/file.py']
116+
117+
or::
118+
119+
reactionLibraries = [(path/to/your/kinetic/library/folder/']
120+
121+
Combinations in any order of RMG's legacy libraries and users' external libraries are allowed,
122+
and the order in which the libraries are specified is the order in which they are loaded and given priority.
123+
107124
.. _seedmechanism:
108125

109126
Seed Mechanisms

environment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ dependencies:
7878
- conda-forge::gprof2dot
7979
- conda-forge::numdifftools
8080
- conda-forge::quantities
81+
- conda-forge::muq
82+
- conda-forge::lpsolve55
83+
- conda-forge::ringdecomposerlib-python
8184

8285
# packages we maintain
83-
- rmg::lpsolve55
84-
- rmg::muq2
8586
- rmg::pydas >=1.0.3
8687
- rmg::pydqed >=1.0.3
87-
- rmg::pyrdl
8888
- rmg::symmetry
8989

9090
# conda mutex metapackage

rmgpy/data/kinetics/database.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def __init__(self):
6262
self.recommended_families = {}
6363
self.families = {}
6464
self.libraries = {}
65+
self.external_library_labels = {}
6566
self.library_order = [] # a list of tuples in the format ('library_label', LibraryType),
6667
# where LibraryType is set to either 'Reaction Library' or 'Seed'.
6768
self.local_context = {
@@ -227,17 +228,18 @@ def load_libraries(self, path, libraries=None):
227228
The `path` points to the folder of kinetics libraries in the database,
228229
and the libraries should be in files like :file:`<path>/<library>.py`.
229230
"""
230-
231+
self.external_library_labels = dict()
231232
if libraries is not None:
232233
for library_name in libraries:
233234
library_file = os.path.join(path, library_name, 'reactions.py')
234235
if os.path.exists(library_name):
235236
library_file = os.path.join(library_name, 'reactions.py')
236-
short_library_name = os.path.split(library_name)[-1]
237+
short_library_name = os.path.basename(library_name.rstrip(os.path.sep))
237238
logging.info(f'Loading kinetics library {short_library_name} from {library_name}...')
238239
library = KineticsLibrary(label=short_library_name)
239240
library.load(library_file, self.local_context, self.global_context)
240241
self.libraries[library.label] = library
242+
self.external_library_labels[library_name] = library.label
241243
elif os.path.exists(library_file):
242244
logging.info(f'Loading kinetics library {library_name} from {library_file}...')
243245
library = KineticsLibrary(label=library_name)

rmgpy/rmg/model.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,12 @@ def add_reaction_library_to_edge(self, reaction_library, requires_rms=False):
17201720
num_old_edge_reactions = len(self.edge.reactions)
17211721

17221722
logging.info("Adding reaction library {0} to model edge...".format(reaction_library))
1723-
reaction_library = database.kinetics.libraries[reaction_library]
1723+
if reaction_library in database.kinetics.libraries:
1724+
reaction_library = database.kinetics.libraries[reaction_library]
1725+
elif reaction_library in database.kinetics.external_library_labels:
1726+
reaction_library = database.kinetics.libraries[database.kinetics.external_library_labels[reaction_library]]
1727+
else:
1728+
raise ValueError(f'Library {reaction_library} not found.')
17241729

17251730
rxns = reaction_library.get_library_reactions()
17261731
for rxn in rxns:

test/rmgpy/data/transportTest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ def test_joback(self):
151151
[
152152
"acetone",
153153
"CC(=O)C",
154-
Length(5.36421, "angstroms"),
154+
Length(5.32979, "angstroms"),
155155
Energy(3.20446, "kJ/mol"),
156-
"Epsilon & sigma estimated with Tc=500.53 K, Pc=47.11 bar (from Joback method)",
156+
"Epsilon & sigma estimated with Tc=500.53 K, Pc=48.02 bar (from Joback method)",
157157
],
158158
[
159159
"cyclopenta-1,2-diene",

0 commit comments

Comments
 (0)