Skip to content

Commit 6482909

Browse files
committed
cleaned tutorial 6
1 parent a2e5891 commit 6482909

3 files changed

Lines changed: 74 additions & 74 deletions

File tree

files/tutorial6/generate.lmp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
units metal
3+
boundary p p p
4+
atom_style full
5+
pair_style vashishta
6+
neighbor 1.0 bin
7+
neigh_modify delay 1

files/tutorial6/solution/generate.lmp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dump_modify mydmp backcolor white &
1717
acolor Si yellow adiam Si 2.5 &
1818
acolor O red adiam O 2
1919

20-
thermo 1000
20+
thermo 500
2121
thermo_style custom step temp etotal vol lx ly lz
2222

2323
velocity all create 6000 4928459 rot yes dist gaussian

lammps-tutorials.tex

Lines changed: 66 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -2745,7 +2745,7 @@ \subsubsection{Prepare and relax}
27452745

27462746
The first action we need to perform here is to relax the structure with ReaxFF,
27472747
which we are gonna do using molecular dynamics. As always, to make sure that the system
2748-
equilibrates nicely, we will us track certain parameters over time. To set up this
2748+
equilibrates nicely, we will us track certain parameters over time. To set up this
27492749
tutorial, select \guicmd{Start Tutorial 5} from the
27502750
\guicmd{Tutorials} menu of LAMMPS--GUI and follow the instructions.
27512751
The editor should display the following content corresponding to \flecmd{relax.lmp}:
@@ -3100,32 +3100,24 @@ \subsection{Tutorial 6: Water adsorption in silica}
31003100
\centering
31013101
\includegraphics[width=0.55\linewidth]{GCMC}
31023102
\caption{Water molecules adsorbed in cracked silica (SiO$_2$) material as simulated
3103-
during \hyperref[gcmc-silica-label]{Tutorial 6}. Water molecules are colored in
3103+
during \hyperref[gcmc-silica-label]{Tutorial 6}. Water molecules are colored in
31043104
cyan and white, oxygen (O) atoms from SiO$_2$ in red, and silicon (Si) atoms in yellow.}
31053105
\label{fig:GCMC}
31063106
\end{figure}
31073107

31083108
\noindent The objective of this tutorial is to combine molecular dynamics and
31093109
grand canonical Monte Carlo simulations to compute the adsorption of water
3110-
molecules in cracked silica material (Fig.\,\ref{fig:GCMC}). This tutorial
3110+
molecules in cracked silica material (Fig.\,\ref{fig:GCMC}). This tutorial
31113111
illustrates the use of the grand canonical ensemble in molecular simulation, an
3112-
open ensemble in which the number of atoms or molecules within the simulation
3113-
box is not constant. When using the grand canonical ensemble, it is possible to
3114-
impose the chemical potential (or pressure) of a given fluid in a nanoporous structure.
3112+
open ensemble where the number of atoms or molecules in the simulation box can vary.
3113+
By employing the grand canonical ensemble, we will set the chemical
3114+
potential of water within a nanoporous SiO$_2$ structure.
31153115

31163116
\subsubsection{Generation of the silica block}
3117-
\noindent Let us first generate a block of amorphous silica ($\text{SiO}_2$).
3118-
To do so, we are going to replicate a building block containing 3 Si and 6 O atoms.
3119-
Create two folders side by side, and name them respectively \flrcmd{Potential/}
3120-
and \flrcmd{SilicaBlock/}. The initial data file for the SiO atoms called
3121-
\href{\filepath tutorial6/SiO.data}{\dwlcmd{SiO.data}}
3122-
must be downloaded and saved in \flrcmd{SilicaBlock/}. This data file contains
3123-
the coordinates of the 9 atoms, their masses, and their charges.
31243117

3125-
Let us replicate these atoms using LAMMPS, and apply an annealing procedure to
3126-
obtain a block of amorphous silica. Create a new input file called \flecmd{input.lmp}
3127-
in the \flrcmd{SilicaBlock/} folder, and copy
3128-
the following lines into it:
3118+
\noindent To begin this tutorial, select \guicmd{Start Tutorial 6} from the
3119+
\guicmd{Tutorials} menu of LAMMPS--GUI and follow the instructions.
3120+
The editor should display the following content corresponding to \flecmd{generate.lmp}:
31293121
\begin{lstlisting}
31303122
units metal
31313123
boundary p p p
@@ -3134,85 +3126,86 @@ \subsubsection{Generation of the silica block}
31343126
neighbor 1.0 bin
31353127
neigh_modify delay 1
31363128
\end{lstlisting}
3137-
The main difference from some of the previous tutorials is the use of the \textit{Vashishta}
3138-
pair style. The Vashishta potential is a bond-angle energy-based potential, it deduces
3139-
the bonds between atoms from their relative positions \cite{vashishta1990interaction}.
3129+
The main difference from some of the previous tutorials is the use of the \lmpcmd{Vashishta}
3130+
pair style. The Vashishta potential is a bond-angle energy-based potential, which
3131+
determines the bonds between atoms from their relative positions \cite{vashishta1990interaction}.
31403132

3141-
Let us then import the system consisting of 9 atoms, and replicate it four times
3142-
in all three directions of space, thus creating a system with 576 atoms. Add the
3143-
following lines into \flecmd{input.lmp}:
3133+
The initial data file for the SiO atoms called
3134+
\href{\filepath tutorial6/SiO.data}{\dwlcmd{SiO.data}}
3135+
must be downloaded next to \flecmd{generate.lmp}. This data file contains
3136+
the coordinates of 9 atoms, their masses, and their charges. Let us replicate
3137+
these 9 atoms using LAMMPS, and apply an annealing procedure to
3138+
obtain a block of amorphous silica.
3139+
3140+
Next, import \flecmd{SiO.data} and replicate it
3141+
in all three directions of space. Add the
3142+
following lines to \flecmd{generate.lmp}:
31443143
\begin{lstlisting}
31453144
read_data SiO.data
3146-
replicate 4 4 4
3145+
replicate 5 4 4
31473146
\end{lstlisting}
3148-
Then, let us specify the pair coefficients by indicating that the first atom type
3149-
is \textit{Si} and the second is \textit{O}. Let us also add a dump command to
3150-
print out the positions of the atoms every 5000 steps:
3147+
Now, specify the pair coefficients by indicating that the first atom type
3148+
is \lmpcmd{Si} and the second is \lmpcmd{O}:
31513149
\begin{lstlisting}
3152-
pair_coeff * * &
3153-
../Potential/SiO.1990.vashishta Si O
3150+
pair_coeff * * SiO.1990.vashishta Si O
31543151
\end{lstlisting}
3155-
Download the \href{\filepath tutorial6/SiO.1990.vashishta}{\dwlcmd{SiO.1990.vashishta}},
3156-
and copy it within the \flrcmd{Potential/} folder.
3152+
Ensure that the \href{\filepath tutorial6/SiO.1990.vashishta}{\dwlcmd{SiO.1990.vashishta}}
3153+
file is located in the same directory as \flecmd{generate.lmp}.
31573154

3158-
Let us add a \textit{dump image} command to \flecmd{input.lmp} to follow the
3155+
Next, add a \lmpcmd{dump image} command to \flecmd{generate.lmp} to follow the
31593156
evolution of the system with time:
31603157
\begin{lstlisting}
3161-
dump mydmp all image 200 dump.*.jpg type type &
3162-
shiny 0.1 box no 0.01 view 0 0 zoom 1.2
3163-
dump_modify mydmp backcolor white &
3164-
acolor Si yellow adiam Si 2.5 &
3165-
acolor O red adiam O 2
3166-
thermo 1000
3167-
thermo_style custom step temp etotal &
3168-
vol lx ly lz
3158+
dump mydmp all image 200 myimage-*.ppm type type &
3159+
shiny 0.1 box no 0.01 view 180 90 zoom 1.2 size 1000 650
3160+
dump_modify mydmp backcolor white acolor Si yellow &
3161+
adiam Si 2.5 acolor O red adiam O 2
3162+
\end{lstlisting}
3163+
Additionally, let us also print the box dimensions, \lmpcmd{lx}, \lmpcmd{ly}, and \lmpcmd{lz}:
3164+
\begin{lstlisting}
3165+
thermo 500
3166+
thermo_style custom step temp etotal vol lx ly lz
31693167
\end{lstlisting}
3170-
Thanks to the \textit{thermo\_style custom} command, the box size along each direction
3171-
will be printed in the log file.
31723168

3173-
Finally, let us create the last part of our script. The annealing procedure is
3174-
made of four consecutive runs. First, a $50\,\text{ps}$ phase at $T = 6000\,\text{K}$
3169+
Finally, let us implement the annealing procedure which is
3170+
made of four consecutive runs. First, a $25\,\text{ps}$ phase at $T = 6000\,\text{K}$
31753171
and isotropic pressure coupling with desired pressure $p = 100\,\text{atm}$:
31763172
\begin{lstlisting}
3177-
velocity all create 6000 4928459 &
3178-
rot yes dist gaussian
3179-
fix npt1 all npt temp 6000 6000 0.1 &
3180-
iso 100 100 1
3173+
velocity all create 6000 4928459 rot yes dist gaussian
3174+
fix npt1 all npt temp 6000 6000 0.1 iso 100 100 1
31813175
timestep 0.001
3182-
run 50000
3176+
run 25000
31833177
\end{lstlisting}
31843178
Then, a second phase during which the system is cooled down from $T = 6000\,\text{K}$
3185-
to $T = 4000\,\text{K}$. An anisotropic pressure coupling is used, allowing all
3179+
to $T = 4000\,\text{K}$. An anisotropic pressure coupling is used, allowing all
31863180
three dimensions of the box to evolve independently from one another:
31873181
\begin{lstlisting}
3188-
fix npt1 all npt temp 6000 4000 0.1 &
3189-
aniso 100 100 1
3190-
run 50000
3182+
fix npt1 all npt temp 6000 4000 0.1 aniso 100 100 1
3183+
run 25000
31913184
\end{lstlisting}
3192-
Then, let us cool down the system further while also reducing the pressure, and then
3193-
perform a small equilibration step at the final desired condition, $T = 300\,\text{K}$ and $p = 1\,\text{atm}$.
3185+
In the third step, the system is cooled further while also reducing the
3186+
pressure. The final step is a short equilibration at the final desired
3187+
condition, $T = 300\,\text{K}$ and $p = 1\,\text{atm}$:
31943188
\begin{lstlisting}
3195-
fix npt1 all npt temp 4000 300 0.1 &
3196-
aniso 100 1 1
3197-
run 200000
3198-
fix npt1 all npt temp 300 300 0.1 &
3199-
aniso 1 1 1
3189+
fix npt1 all npt temp 4000 300 0.1 aniso 100 1 1
32003190
run 50000
3201-
write_data amorphousSiO.data
3191+
fix npt1 all npt temp 300 300 0.1 aniso 1 1 1
3192+
run 25000
3193+
3194+
write_data generate.data
32023195
\end{lstlisting}
32033196
Here, an isotropic barostat is used for the melted phase at $T = 6000\,\text{K}$,
3204-
and an anisotropic barostat is used for all following phases. With the anisotropic
3205-
barostat, all three directions of space are adjusted independently from one another.
3206-
An anisotropic barostat is usually a better choice for a solid phase. For a liquid
3207-
or a gas, an isotropic barostat is usually the best choice.
3208-
3209-
Run the simulation using LAMMPS. From the \textit{Charts} window, the temperature
3210-
can be seen to follow well the desired annealing procedure (Fig.\,\ref{fig:GCMC-temperature}).
3211-
The evolution of the box dimensions over time confirms that the box was indeed
3212-
deformed isotropically during the first stage of the simulation, and then anisotropically
3213-
(Fig.\,\ref{fig:GCMC-dimension}). After running
3214-
the simulation, the final LAMMPS topology file called \flecmd{amorphousSiO.data}
3215-
will be located in \flrcmd{SilicaBlock/} (Fig.\,\ref{fig:GCMC-snapshot}).
3197+
and an anisotropic barostat is used for all following phases.
3198+
The anisotropic barostat adjusts the dimensions independently, which is more
3199+
suitable for a solid phase. For a liquid or a gas, an isotropic barostat is
3200+
usually the best choice.
3201+
3202+
Run the simulation using LAMMPS. From the \guicmd{Charts} window, the temperature
3203+
evolution can be observed, showing that it closely follows the desired annealing procedure (Fig.\,\ref{fig:GCMC-temperature}).
3204+
The evolution of the box dimensions over time confirms that the box
3205+
deformed isotropically during the first stage of the simulation, followed by anisotropic deformation
3206+
(Fig.\,\ref{fig:GCMC-dimension}). After the simulation completes, the final
3207+
LAMMPS topology file called \flecmd{generate.data}
3208+
will be located next to \flecmd{generate.lmp} (Fig.\,\ref{fig:GCMC-snapshot}).
32163209

32173210
\begin{figure}
32183211
\centering

0 commit comments

Comments
 (0)