How to setup a molecular modelling simulation?

We saw in the first blog post how a tool like molecular dynamics (MD) can help support materials discovery. This time, I'm going to dive into world of software that can help you model materials, and the different stages that make up the pre-processing of an MD simulation. This is part of our series on using MD for materials development, subscribe to the newsletter to never miss a post!

Choosing Software

The physics for an MD simulation is complex and time consuming to implement, so using existing software is the fastest way to get started. There is is huge list of potential MD solvers you can use, but for most people the first decision is whether to use open-source or commercial software. Commercial software is typically more polished, has professional support and training available, and often a nice UI to improve user friendliness. However, the cost of this software can be high, which can be off-putting for users who don't know whether there's value in the tools. Open-source tools solve the issue of cost, but can be more challenging to setup and use. Their "openness" means you can manually inspect the code and see how it works, meaning you can trust and debug your simulations easier, as well as adapt it to your own uses. Personally, I use LAMMPS, which has a large community of materials science users, a long development history, and good performance on parallel core supercomputers. Some other open-source and commercial choices can be seen below.

Setting up a Simulation

An MD simulation has many different parts which can be daunting to both beginner and experienced users alike. These next few sections will give a very brief overview of how to set up a simulation, and signpost key parts that MD users will need to consider.

Periodic Boundary Conditions & Unit Cells

The first thing to consider when setting up a simulation is just how small atoms really are. It's not possible to simulate the 6×10²³ atoms required to model a mole of a polymer, and thankfully we don't need anywhere near this number to predict material properties. One of the reasons for this is the use of periodic boundary conditions (PBCs). By modelling a polymer as a representative unit cell, the boundaries of these cells can set as periodic and therefore repeat infinitely in all directions. Practically this means atoms at one boundary interact with the atoms at the opposite boundary, and can pass through the boundaries to appear on the other side (think Pac-Man!). For a more in-depth explanation of PBCs, see this link.

Initial Packing

With an understanding of PBCs we can now talk about setting up our atoms and their initial starting positions. Before doing any dynamics on molecules, they need to be sensibly arranged in space: too far apart and the system will be take too long to equilibrate, too close together and the simulation will immediately fail as atoms crash into one another with unphysical interactions. The packing process typically takes the form of an initial best fit, followed by geometry optimisation to satisfy that all atoms are a minimum distance away from one another. Open-source tools like Packmol can help with this process to create an initial coordinate file, but can struggle with packing larger molecules into tight spaces.

Forcefields

Whilst sounding quite sci-fi, forcefields are used to define the physical interactions between atoms packed in a unit cell. You don't want to calculate interactions on-the-fly - that's for quantum mechanics simulations - so use pre-calculated coefficients for equations that define how one atom affects its neighbours. This makes the computation relatively simple and lets you run thousands of atoms on a desktop computer without waiting all day. There are many different choices to Google (all with esoteric names like AMBER, DREIDING, PCFF, COMPASS...) but best practice is to test a few on your system and see how they perform on the molecules you are simulating. For instance, if your equilibrated unit cell density matches the experimental liquid density, your forcefield is governing the interactions of the atoms well. A good tool for doing this when using LAMMPS is Moltemplate, which can remove a lot of the effort of assigning a forcefield and help the user set up their simulation.

Hopefully you have now got an idea what's required to start a chemical simulation with MD. These steps can be very daunting, as it takes a lot of work before even beginning to start running a simulation, but support is out there and it's worth the effort for the potential of digital materials discovery. Thank you for reading this blog post, sign up to our newsletter so you don’t miss the next one in July covering the steps to designing a simulation. Happy modelling!

Previous
Previous

How to design a molecular modelling simulation?

Next
Next

How can molecular modelling help drive materials discovery?