LAMMPS-Molecular-Dynamics-Simulator/C2/Simulation-of-Lennard-Jones-Bulk-Liquid/English
Title of script: Simulation of Lennard-Jones Bulk Liquid
Author: Dr.Snehalatha Kaliappan, Prasad Baddi
Keywords: LAMMPS, Simulation, Lennard-Jones bulk liquid, input file, video tutorial
| Visual Cue | Narration |
| Slide Number 1
Title Slide |
Welcome to this tutorial on Simulation of Lennard-Jones Bulk Liquid. |
| Slide Number 2
Learning Objectives |
In this tutorial, we will learn to,
|
| Slide Number 3
Learning Objectives |
In this tutorial, we will learn to,
|
| Slide Number 4
System Requirement |
To record this tutorial, I am using,
Ubuntu Linux OS version 22.04 Latest stable version of LAMMPS (LAMMPS Stable Release 29 Aug 2024) |
| Slide Number 5
Prerequisite |
To follow this tutorial learner must be familiar with,
basic computer operations on Linux OS.
|
| Slide number 6
Code file |
The following input file is required to practice this tutorial:
|
| Slide Number 7
|
Here are some specific reasons for choosing the Lennard-jones simulations.
Simplicity and Computational Efficiency Benchmarking and Model Testing Risk-Free Exploration of Scenarios Compatibility with Broader Systems
|
| Open the input file LJBulk.txt in gedit texttext editor. | Running simulations in LAMMPS require an input file.
Download the input file provided along with this tutorial and save it on your system. Here I have opened the input file in a text editor. |
| Cursor on each section and highlight. | The input script is divided into four sections:
|
| Cursor on the input file. | Now let us look at what needs to be defined in each section: |
| Cursor on Initialization section.
Line 3: units lj
|
Initialization
The units command sets the style of the units for the quantities specified in the input script, data file, and output. Here we have specified as lj. |
| Line 4: dimension 3 | The dimension command sets the dimension of the simulation.
Here we have 3, since we require the simulation in 3D. You can set it as 2, if you require a 2D simulation. |
| Line 5: boundary p p p | The boundary command sets the boundary conditions of the simulation box.
here, p refers periodic |
| Line 6: atom_style atomic | The atom_style command defines necessary per-atom attributes for simulation models and data handling. |
| Cursor on System definition section.
region liquid block 1 19 1 19 1 10 create_atoms1 random 1754 12345 liquid
|
System definition:
|
| Line 13: It is on line 14create_box 1 box | Defining simulation box
Here 1 indicates the number of atom types present in the system.
|
| Line 16: region liquid block 1 19 1 19 1 10 | Defining a geometric region to place the liquid atoms.
|
| Line 17: create_atoms1 random 1926 12345 liquid | Creation of liquid atoms in the defined region “liquid”.
Example: create_atoms 1 random 1926 12345 liquid
|
| Line 18:It is on line 19 mass 1 1.0 | Defining the mass of the particle.
Here, 1 and 1.0 represents type “1” particle and mass of the particle respectively |
| Line 24: pair_style lj/cut 2.5 | Next in Simulation Settings:
cutoff calculates the pairwise distances within the mentioned cutoff.
|
| Line 30: group liq type 1 | Here we enter the numbers that describe how atom pairs interact.
Here, all type 1 particles are grouped with a group ID liq. |
| Line 34: minimize 1e-6 1e-6 10000 10000 | Running a simulation:
Minimization of the system to remove the overlap between the particles. These numbers indicate tolerance, force tolerance, max iteration, max evaluations. |
| Line 38: neighbor 0.3 bin
Line 39: neigh_modify every 1 delay 0 check yes page 100000 one 5000 |
Building of pairwise neighbor lists.
This command sets parameters that affect the building of pairwise neighbor lists. |
| Line 44: dump 1 liq atom 5 output.atom | Storing the position of all the coordinates to the file.
Here 5 is the frequency of printing the output file and in the end gives the name for the output file.
|
| Line 46: thermo_style custom step etotal | Logging the desired data during the simulation.
Here, other parameters can also be printed, and will be discussed in the upcoming tutorials.
|
| Line 48: timestep 0.005
Line 49: thermo 5 |
The timestep command sets the timestep size for the simulation.
The thermo command computes and prints the desired thermodynamic information like: temperature, energy, pressure at the mentioned interval of time. Number 5 here indicates the frequency of printing output. |
| Line 53: fix 1 liq npt temp 0.8 0.8 100 iso 1 1 100 | In LAMMPS, a fix is any operation that is applied to the system during timestepping or minimization
The npt command performs the time integration using equations of motion to generate positions and velocities for atoms. In an npt ensemble:
|
| Line 55: run 10 | Here 10 indicates timesteps_number.
The large number will make the simulation more clear to visualize . The time taken to complete the simulation will also increase.
|
| Cursor on the input file.
Close the text editor. |
Now let me demonstrate how to run this input file.
Close the text editor. |
| Go to the folder where input file is located.
Open the folder and show the input file. |
I have saved the input file in a folder in my home directory.
Navigate to the input file location. |
| Right click on the folder containing the input file.
From the context menu choose Open in Terminal option. |
As LAMMPS is already installed in your computer.
Right click on the folder containing the input file. From the context menu choose Open in Terminal option. |
| Cursor on the terminal. | Alternatively you can open the terminal and navigate to the path leading to the input file. |
| At the prompt type “ lmp_serial -in Ljbulk.txt”
|
Type the following command at the prompt to run the input file.
Windows users can open the command prompt, type the command and proceed as shown. Press enter |
| Cursor on the terminal.
|
The output is seen on the terminal.
Two output files are generated, log.lammps and output.atom. These files will be saved in the same folder where your input file is located.
|
| Cursor on the folder. | The analysis and visualization of the output file will be covered in the upcoming tutorial. |
| This brings us to the end of this tutorial. | |
| Slide Number 8
|
Let's summarize.
|
| Slide Number 9
Assignment Edit the line in the System Definition section as follows region liquid block 1 25 1 25 1 15
|
As an assignment,
|
| Slide Number 10
Thank you |
Thank you |