@@ -204,17 +204,92 @@ The last section is specifying that RMG is estimating kinetics of reactions from
204204 kineticsEstimator = 'rate rules'
205205
206206
207- The following is an example of a database block, based on above chosen libraries and options::
207+ .. _auto_library_selection :
208+
209+ Automatic Library and Family Selection
210+ --------------------------------------
211+ Instead of manually listing every library, you can let RMG choose the appropriate
212+ thermo libraries, kinetics libraries, transport libraries, seed mechanisms, and
213+ kinetics families automatically based on the species and reactor conditions in your
214+ input file. Use the ``'auto' `` keyword in any library field::
208215
209216 database(
210- thermoLibraries = ['primaryThermoLibrary', 'GRI-Mech3.0'],
211- reactionLibraries = [('Glarborg/C3',False)],
212- seedMechanisms = ['GRI-Mech3.0'],
217+ thermoLibraries = 'auto',
218+ reactionLibraries = 'auto',
219+ transportLibraries = 'auto',
220+ seedMechanisms = 'auto',
221+ kineticsFamilies = 'auto',
213222 kineticsDepositories = ['training'],
214- kineticsFamilies = 'defult',
215223 kineticsEstimator = 'rate rules',
216224 )
217225
226+ When ``'auto' `` is specified, RMG analyzes the initial species and reactor
227+ conditions to detect the chemistry present (e.g., nitrogen, sulfur, oxygen,
228+ halogens, surface, liquid phase) and selects the relevant library sets.
229+ The triggered sets and their corresponding libraries are logged at the start
230+ of the RMG run.
231+
232+ .. note ::
233+ Non-reactive species (those declared with ``reactive=False ``, such as bath
234+ gases) are skipped during chemistry detection and will not trigger any
235+ chemistry sets on their own. For example, using N\ :sub: `2` purely as a
236+ bath gas will not pull in the nitrogen library — the nitrogen set is
237+ triggered only when a reactive species containing nitrogen is present.
238+
239+ **Mixing manual and auto selection. ** You can combine user-specified libraries
240+ with ``'auto' `` in a list. The position of ``'auto' `` controls the priority:
241+ libraries before it have higher priority, libraries after it have lower::
242+
243+ thermoLibraries = ['myCustomLib', 'auto']
244+
245+ thermoLibraries = ['auto', 'myFallbackLib']
246+
247+ If a library you listed manually also appears in the auto-selected set, it will
248+ not be added twice. It keeps the position you gave it, and the auto-selected
249+ copy is skipped.
250+
251+ **PAH libraries and the ``<PAH_libs>`` keyword. **
252+ The auto-selection splits high-temperature C/H chemistry into two tiers:
253+
254+ * **CH_pyrolysis_core ** — fundamental high-T radical and small-molecule chemistry
255+ (e.g., acetylene initiation, alkane cracking). Always included when carbon is
256+ present and the maximum reactor temperature is at least 800 K.
257+ * **PAH_formation ** — aromatic ring formation, naphthalene pathways (CPD + HACA),
258+ and larger PAH growth. This is a large set (~70 kinetics libraries) that can
259+ significantly increase model size and generation time.
260+
261+ For **pure C/H pyrolysis ** (no oxygen in any input species), both tiers are
262+ included automatically — PAH formation is expected in such systems.
263+
264+ For **oxygenated systems ** (any species contains O, including oxygenated fuels
265+ like ethanol or DME), only CH_pyrolysis_core is included by default because
266+ PAH chemistry is typically a minor pathway. If you know your system forms
267+ significant amounts of aromatics (e.g., fuel-rich partial oxidation), you can
268+ explicitly request the PAH libraries by adding the ``'<PAH_libs>' `` keyword
269+ to any library field::
270+
271+ database(
272+ thermoLibraries = ['auto', '<PAH_libs>'],
273+ reactionLibraries = ['auto', '<PAH_libs>'],
274+ seedMechanisms = 'auto',
275+ transportLibraries = 'auto',
276+ kineticsFamilies = 'auto',
277+ )
278+
279+ The ``'<PAH_libs>' `` keyword is consumed during processing (it does not appear
280+ in the final library list) — it only serves as a signal to include the
281+ PAH_formation set. It can be placed anywhere in the list; its position does
282+ not affect library priority.
283+
284+ **Previewing the selection. ** A Jupyter notebook is provided at
285+ :file: `ipython/auto_library_selection.ipynb ` that lets you preview exactly which
286+ libraries and families RMG would choose for a given input file, without running
287+ the full job.
288+
289+ .. note ::
290+ The ``'auto' `` keyword is opt-in. If you do not use it you must list every library explicitly.
291+
292+
218293.. _species_list :
219294
220295List of species
0 commit comments