-
Notifications
You must be signed in to change notification settings - Fork 14
Adding a RMG Py simulation test case to RMG tests
This manual explains what steps to undertake to add your RMG simulation to the RMG-tests integrated testing framework.
Create an RMG-Py simulation input file, and name it input.py. An example is shown below in Appendix A. Ensure that the option saveEdgeSpecies
flag in the options section is set to True
so that the edge model will also be saved to a file.
What is even more important: We appreciate if you would create a simulation case with several features of RMG-Py, e.g. pressure-dependence, QMTP, operating conditions, initial mixtures, pruning, seed mechanisms, reaction libraries, thermo libraries, species constraints, liquid phase cases, output options, etc… The more diverse our global test set of simulations becomes, the more ground we will cover of RMG-Py’s code.
With the created RMG-Py simulation input file, generate the reaction mechanism that corresponds to the created input file.
Ensure that the simulation does not take more than 15 minutes maximum. You can reduce simulation times in multiple ways, e.g. by increasing the toleranceMoveToCore
flag.
Ensure that you are using the correct versions of RMG-Py (v 1.0.3) and RMG-database (v 1.0.2) to generate the reaction mechanism. Appendix B explains how you can check this.
Once the RMG-Py simulation is finished, you need to keep a number of files. Retain the RMG.log file in the current working directory, and search for the core and edge reaction mechanism and their respective species dictionaries in the chemkin subfolder. Look for the following filenames:
chem_annotated.inp
species_dictionary.txt
chem_edge_annotated.inp
-
species_edge_dictionary.txt
Save the five files for later use.
Fork the ReactionMechanismGenerator/RMG-tests repository to your own user account by pushing the “fork” button on the https://github.com/ReactionMechanismGenerator/RMG-tests page.
Clone your newly forked version of RMG-tests to your local computer:
git clone https://github.com/<your user name>/RMG-tests.git
Enter the newly created RMG-tests folder, and create a new branch and give it an appropriate branch name (in this example: “octane
”):
cd RMG-tests/
git checkout –b octane
In the RMG-tests/examples/rmg
folder, create a new folder, give it the same name as the chosen branch name (in this example: “octane”), and copy the RMG-Py simulation input file in this folder.
In the RMG-tests/testing/check/
folder, create a new folder, give it the same name as the chosen branch name (in this example: “octane
”), and copy the four reaction mechanism files (two chemkin files, two species dictionaries) and the RMG.log in this folder.
Modify the .travis.yml
file:
Open the .travis.yml
file located in the RMG-tests/ directory and add the following line in the script section (replacing the “octane” by the branch name you originally created):
- make ARGS="octane" run
Stage and commit the added/updated files through git. Provide a short summary message when committing:
git add .
git commit
A text editor will pop up. Provide a summary message that explains what type of simulation is added in the commit. Save and exit the text editor. git push origin octane
Now your changes in the newly created branch will be available on your own forked version of RMG-tests.
Create a pull request that proposes to merge your additions into the main version and push the “Create Pull Request” button.
# Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = 'default',
kineticsEstimator = 'rate rules',
)
# Constraints on generated species
generatedSpeciesConstraints(
maximumCarbonAtoms = 8,
)
# List of species
species(
label='n-octane',
reactive=True,
structure=SMILES("CCCCCCCC"),
)
species(
label='Ar',
reactive=False,
structure=SMILES("[Ar]"),
)
simpleReactor(
temperature=(1500,'K'),
pressure=(400,'Pa'),
initialMoleFractions={
"n-octane": 0.02,
"Ar": 0.98,
},
terminationConversion={
'n-octane': 0.5,
},
terminationTime=(1e0,'s'),
)
simulator(
atol=1e-16,
rtol=1e-8,
)
model(
toleranceKeepInEdge=0.0,
toleranceMoveToCore=0.5,
maximumEdgeSpecies=100000
)
pressureDependence(
method='modified strong collision',
maximumGrainSize=(0.5,'kcal/mol'),
minimumNumberOfGrains=250,
temperatures=(300,3000,'K',8),
pressures=(0.001,100,'bar',5),
interpolation=('Chebyshev', 6, 4),
)
options(
units='si',
generateOutputHTML=False,
generatePlots=False,
saveEdgeSpecies=True,
)
Go to the source code directory of your RMG-Py project
Checkout the 1.0.3 tag:
git fetch origin
git checkout tags/1.0.3
Recompile everything:
make clean;make
Windows users may need to run the following line:
mingw32-make clean; mingw32-make
Go to the source code directory of your RMG-database project
Checkout the 1.0.2 tag:
git fetch origin
git checkout tags/1.0.2