How Does LAMMPS Enable Efficient Molecular Dynamics Simulations? 🚀

 


Hello and welcome to the fourth article in Eng's Notebook! In this article, let's explore the MD (Molecular Dynamics) simulation, focusing on how LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator) can be a powerful tool for enhancing your simulations. As an extra point, let's discuss how we can use Linux-based HPC (high-performance computing) for running simulations efficiently, according to my personal experience. 💡

So, what is molecular dynamics? Molecular dynamics (MD) is a computational simulation technique used to study the behavior of atoms and molecules. It allows for the observation of their interactions and movements over a specified period, providing insights into the dynamic evolution of a system. 
In most of the industries, the trial-and-error method is used to solve the problem. It can be an extremely time and resource consuming method. When we use a trial and error method, we can't understand what is happening inside the materials and can't get an idea about the mechanism of the process at the atomic level. 
By using MD simulation as an industrial professional or as a researcher, we can gain some of advantages like,
  • Reduced Time and Cost
  • Atomic-Level Insight
  • Exploration of Extreme Conditions
  • Optimization of Material Properties
  • Virtual Prototyping
LAMMPS is a widely used tool for molecular dynamic simulations due to its flexibility and versatility, scalability and performance, open source, and community support. In this article, we discuss the basic things about LAMMPS scripting and other necessary tools according to my knowledge and experience. 


Figure 01: Logo of the LAMMPS tool

If you are thinking of doing a molecular dynamic simulation using LAMMPS, there are a few basic steps to complete. Let's discuss these basic steps using an example: heavy metal removal from the water using graphene oxide membrane. These steps can be slightly changed according to your project requirements and your objectives. 

Step 01: Molecular design
First of all, all the necessary molecules and ions should be created using suitable software. In the research project, I used Avogadro software to create the necessary molecules and ions, such as graphene oxide nanosheets, graphene sheets as the two walls, heavy metal ions, cloride ions, and water molecules. After drawing your molecule structure without considering the bond length and other parameters, you can simply minimize the energy of the molecule using the software, and then it becomes it most stable state by minimizing the energy.


Figure 02: Interface of the Avegadro software

Step 02: System Preparation
After creating the necessary molecules, they should be arranged in a simulation box using the Packmol package. In this process, we need to write an input script to generate the required system, including the details of the number of molecules and ions and their location. As an example, when we consider the GO nanosheet, we can give the exact location in the simulation box using the script. But when we think about the situation, like if you want to add 2000 water molecules to the system, we can't give the exact location for each of the molecules. At that moment, we can simply give a volume and the amount of water molecules that you want to add to the system using the script. To run this package, I used Juilia as the platform. By using these two tools, we can create the data file of the initial configuration of the system. 

Step 03: Visualization
At that stage, you have completely created your system. But all the data of the initial configuration is saved as a text file. So, to identify whether the system is correctly created or not, we should have the ability to visualize it. To do this, we can use OVITO (Open Visualization Tool) or VMD (Visual Molecular Dynamics) software. For this step, I prefer to use the OVITO software. But VMD is very important. 


Figure 03: Interface of OVITO software

Step 04: Simulation Execution
After creating the initial configuration, we should need to get the data file using the VMD software, especially including the atom types, bond types, angle types, and dihedrals. After getting the data file of the system, we can start to write the LAMMPS script, including all the required commands like force fields, thermodynamic conditions, unit system, boundary conditions, execution commands, and the simulation settings. This is not just a simple process to combine all these necessary parts. But if you have the overall idea of your project and the molecular dynamic simulations, it is easy to work with these softwares. LAMMPS generates output through various commands. 
  • Thermodynamic data (thermodynamic results like temperature, pressure, volume, and energy)
  • Trajectory data as dump file (atomic motions)
  • specific properties using Compute and Fix commands (mean square displacement, radial distribution function)
Refer to the LAMMPS documentation for command details.

Step 05: High-Performance Computing
If your system has a much larger number of atoms, you cannot run the system easily on your personal computers or laptops. It takes several hours to several days, according to the size of the system. That is why we need to use additional computing power to do this work. LAMMPS is designed for efficient molecular dynamics (MD) simulations and can run on both single and multiple processors, leveraging high-performance computing (HPC) resources.
  • For the single processor execution, the command is
    lmp -in input_script.in (one CPU core)
  • For multi processor execution (Parallel Computing in LAMMPS), the command is,
    mpirun -np x lmp -in input_script.in (Here x is the number of the CPU cores. x can be 2, 4, 8...)
So, these are the basic steps in molecular dynamic simulation using LAMMPS software. 

Molecular dynamics (MD) simulations using LAMMPS provide a powerful way to analyze material behavior at the atomic level, offering insights that are difficult to obtain through experimental methods alone. By following the key steps—molecular design, system preparation, visualization, simulation execution, and high-performance computing—researchers and industry professionals can efficiently simulate complex systems such as heavy metal removal using graphene oxide membranes.
The flexibility of LAMMPS, combined with tools like Avogadro, Packmol, OVITO, and VMD, allows for precise control over system configurations and analysis. Moreover, leveraging high-performance computing (HPC) significantly enhances simulation efficiency, making it possible to study large-scale atomic interactions within a reasonable timeframe.
With the right approach and computational resources, MD simulations can bridge the gap between theoretical research and real-world applications, driving innovation in materials science and engineering. 🔥

So, in the future, we will discuss more about MD simulations, like force fields and the theories behind them, how to write a LAMMPS script, how to use the HPC facilities, and much more related things. 
Thank you for reading, and see you in the next article. Have a nice day. 🍃

Comments

Popular posts from this blog

Comprehensive Guide to LAMMPS Scripting for Molecular Dynamics

What is Eng's Notebook? Our Journey into Materials Science 🍃