Combustion simulation (DFTB)¶
In this tutorial we will set up and run a simple molecular dynamics calculation in which we burn a single isooctane (2,2,4-Trimethylpentane) molecule.
Building the system¶
Before we can burn it, we first need to obtain an isooctane molecule. You could build the isooctane molecule it yourself in AMSinput, but it is easier to just import it from the database of molecules that comes with AMS.
Next we need to bring the isooctane molecule into a hot and oxygen rich environment. In the simulation we do this by putting it into an oxygen filled box with periodic boundary conditions. This is most easily done using the Builder tool in AMSinput.
O to search for oxygen.
30 oxygen molecules are more than enough for a complete combustion of the isooctane molecule. At the bottom of the Builder panel you can see a prediction of the density after adding the oxygen. The new density will be around 1 g/mL, which is obviously very high for this mixture. For this tutorial that is fine as it means things will happen faster.
Setting up the calculation¶
Now that we have our system geometry, we need to configure the details of the used engine. In this tutorial we will use the DFTB engine:
With the DFTB engine the calculation should take around two hours on a normal desktop computer. DFTB is a computationally efficient approximation to density functional theory (DFT), and generally quite accurate. If you want a faster calculation, you can alternatively run this tutorial with the ReaxFF engine. We suggest that you use the CHO.ff parameters in this case.
Finally we need to specify that we want to run a molecular dynamics calculation and configure its details. We are going to run this calculation at the unrealistically high temperature of 3500K. For the purpose of this tutorial this is fine, as it means we can see an almost complete combustion happening within a couple of picoseconds.
We have set an initial temperature of 3500K, but in order to maintain this temperature throughout the simulation we should also attach a thermostat to our system. We will be using the Nosé–Hoover thermostat which yields good overall sampling results in general. The Nosé–Hoover damping constant is dependent on the system size because ideally it should match the period of the internal oscillations of the system. In the present case we use a reasonable value of 100fs, but one might want to test different values in a realistic setup.
Viewing the results¶
This is all the setup we need. We are now ready to run the calculation. While it is running, we can already follow its progress in AMSmovie.
Depending on your initial conditions (and luck) it might take a while before the combustion starts and the isooctane disintegrates.
When we set up the geometry of our system in AMSinput, we already saw bonds displayed between the atoms where we would expect bonds. These bonds were guessed by the GUI, which generally works well for isolated molecules around their equilibrium structures. However, the bonds you see while following your calculation in AMSmovie are actually calculated by the engine: In case of the DFTB engine this means that a Mayer bond order analysis based on the obtained electron density is performed at every frame of your MD calculation. (If you chose earlier to use the ReaxFF engine instead, you will see the bond orders that are used in the force field.)
Based on the bond orders calculated by the engine, the AMS driver will perform a molecule analysis for every frame of the trajectory. This basically detects which molecules we have in our system. This information can be visualized from AMSmovie. We can for example use it to not show all the oxygen molecules, since they are not really interesting and just block our view onto the isooctane we want to see.
In the beginning we only have 30 O2 molecules and the single isooctane (C8H18). As the reaction starts you will see intermediates and ultimately water and carbon dioxide. The 5ps trajectory we ran is probably not long enough to see a complete combustion, but you should already see some H2O and CO2 towards the end of your simulation.
The list of detected molecules in the Molecules window does not update automatically while the calculation is still running. Close and reopen the window to see the latest molecules that have just formed.
For systems with periodic boundary conditions it can be a bit confusing to see atoms leave the box on one side and reappear on the other. For a better visualization we suggest that you make a few changes to the AMSmovie viewport on the left.
This should give you a much clearer visualization:
You can download the movie
here if it does not play in your browser.
The results of the bond order analysis are real numbers and the bonds are simply drawn based on intervals for these bond orders, e.g. a single bond is shown if the calculated bond order is between 0.6 and 1.2. As such the bond visualization and also the molecule detection should be taken with a grain of salt, especially as molecules get close and interact with each other. You might for example see that two oxygen molecules that randomly approach each other quickly might be shown to be bonded (probably with dashed half-bonds) and momentarily be detected as an O4 molecule.
You can also plot the number of molecules of a particular species by ticking the respective box in the Graph column of the Molecules window.
As expected we see the consumption of oxygen and production of water and carbon dioxide. Furthermore we see the system’s potential energy go down, as the combustion releases energy.
If you are interested in combustion, also check out the “Combustion simulation (ReaxFF)” tutorial.