Skip to content

Commit a40c565

Browse files
committed
futher homogenization of tutorial 8
1 parent 54fce36 commit a40c565

2 files changed

Lines changed: 46 additions & 62 deletions

File tree

lammps-tutorials.tex

Lines changed: 46 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -3977,68 +3977,57 @@ \subsubsection{Creating the system}
39773977
of the cross coefficients:
39783978
\begin{eqnarray}
39793979
\nonumber
3980-
\sigma_{ij} & = & \left( \frac{1}{2} (\sigma^6_i+\sigma_j^6) \right)^{1/6}, ~ \text{and} \\
3980+
\sigma_{ij} & = & 2^{-1/6} (\sigma^6_i+\sigma_j^6)^{1/6}, ~ \text{and} \\
39813981
\nonumber
39823982
\epsilon_{ij} & = & \dfrac{2 \sqrt{\epsilon_i \epsilon_j} \sigma^3_i \sigma^3_j}{\sigma^6_i+\sigma_j^6}.
39833983
\end{eqnarray}
39843984

3985-
Let us read a data file named \href{\filepath tutorial8/CNT.data}{\textit{CNT.data}}
3986-
containing a periodic single-walled CNT. Add the following lines to \textit{mixing.lmp}:
3987-
{\normalsize
3988-
\begin{verbatim}
3989-
read_data CNT.data &
3990-
extra/special/per/atom 20
3991-
\end{verbatim}
3992-
}
3993-
The CNT is about 1.1 nm in diameter and 1.6 nm long.
3994-
The box is 5.2 nm in the other dimensions, so filling the box with
3995-
styrene monomers will be easy.
3996-
% S.G.: @jrgissing, here we could describe the content of nylon.data.
3997-
% How was it created, what is the specifity of the molecules involved, etc...
3998-
3999-
To add 200 styrene molecules to the simulation box, add the following commands
4000-
to \textit{mixing.lmp}:
4001-
{\normalsize
4002-
\begin{verbatim}
3985+
Let us read the \href{\filepath tutorial8/CNT.data}{\dwlcmd{CNT.data}} file, which
3986+
contains a periodic single-walled CNT. Add the following line to \flecmd{mixing.lmp}:
3987+
\begin{lstlisting}
3988+
read_data CNT.data extra/special/per/atom 20
3989+
\end{lstlisting}
3990+
The CNT is approximately $1.1~\text{nm}$ in diameter and $1.6\,\text{nm}$ in length, oriented
3991+
along the $x$-axis. The simulation box is as large as 5.2~nm in the two other dimensions,
3992+
making it straightforward to fill the box with styrene.
3993+
To add 200 styrene molecules to the simulation box, include the following commands
3994+
to \flecmd{mixing.lmp}:
3995+
\begin{lstlisting}
40033996
molecule styrene styrene.lmpmol
4004-
create_atoms 0 random 200 8305 NULL &
4005-
overlap 2.75 maxtry 500 mol styrene 7687
4006-
\end{verbatim}
4007-
}
4008-
Let us use the \textit{minimize} command to reduce the energy of the system:
4009-
{\normalsize
4010-
\begin{verbatim}
3997+
create_atoms 0 random 200 8305 NULL overlap 2.75 &
3998+
maxtry 500 mol styrene 7687
3999+
\end{lstlisting}
4000+
Finally, let us use the \lmpcmd{minimize} command to reduce the potential energy of the system:
4001+
\begin{lstlisting}
40114002
minimize 1.0e-4 1.0e-6 100 1000
40124003
reset_timestep 0
4013-
\end{verbatim}
4014-
}
4015-
Then, let us densify the system to a target value of 0.9 g/cm$^3$
4004+
\end{lstlisting}
4005+
4006+
Then, let us densify the system to a target value of $0.9~\text{g/cm}^3$
40164007
by manually shrinking the simulation box at a constant rate. The dimension parallel
4017-
to the CNT axis will remain fixed, since the CNT is periodic in that direction.
4018-
The \textit{fix halt} feature is used to stop the box shrinkage once the target density is
4019-
reached.
4020-
{\normalsize
4021-
\begin{verbatim}
4022-
velocity all create 300.0 9845 dist gaussian &
4023-
rot yes loop local
4024-
fix 1 all nvt temp 300 300 100
4008+
to the CNT axis is maintained fixed because the CNT is periodic in that direction.
4009+
Add the following commands to \flecmd{mixing.lmp}:
4010+
% SG: I remove the loop local, unless its important? But if it is, we have to
4011+
% explain what it does and why it was chosen here.
4012+
\begin{lstlisting}
4013+
velocity all create 300.0 9845 dist gaussian rot yes
4014+
fix mynvt all nvt temp 300 300 100
40254015

4026-
fix 2 all deform 1 y erate -0.0001 &
4027-
z erate -0.0001
4016+
fix mydef all deform 1 y erate -0.0001 z erate -0.0001
40284017
variable rho equal density
4029-
fix 3 all halt 10 v_rho > 0.9 error continue
4018+
fix myhal all halt 10 v_rho > 0.9 error continue
40304019

40314020
thermo 500
4032-
thermo_style custom step temp pe etotal press &
4033-
density
4021+
thermo_style custom step temp pe etotal press density
40344022

40354023
run 9000
4036-
\end{verbatim}
4037-
}
4038-
For the next stage of the simulation, we will use \textit{dump image} to
4024+
\end{lstlisting}
4025+
The \lmpcmd{fix halt} command is used to stop the box shrinkage once the
4026+
target density is reached.
4027+
4028+
For the next stage of the simulation, we will use \lmpcmd{dump image} to
40394029
output images every 1000 steps:
4040-
{\normalsize
4041-
\begin{verbatim}
4030+
\begin{lstlisting}
40424031
dump mydmp all image 1000 dump.mix.*.ppm &
40434032
type type shiny 0.1 box no 0.01 &
40444033
view 90 0 zoom 3 fsaa yes bond atom 0.5
@@ -4050,30 +4039,25 @@ \subsubsection{Creating the system}
40504039
adiam c= 0.3 adiam c1 0.3 &
40514040
adiam c2 0.3 adiam c3 0.3 &
40524041
acolor hc white adiam hc 0.15
4053-
\end{verbatim}
4054-
}
4055-
For the following 10\,ps, let us equilibrate the densified system
4042+
\end{lstlisting}
4043+
For the following $10~\text{ps}$, let us equilibrate the densified system
40564044
in the constant-volume ensemble, and write the final state of the
4057-
system in a file named \textit{CNT-PS-mix.data}:
4058-
{\normalsize
4059-
\begin{verbatim}
4045+
system in a file named \flecmd{CNT-PS-mix.data}:
4046+
\begin{lstlisting}
40604047
unfix 2
40614048
unfix 3
40624049
reset_timestep 0
40634050

40644051
run 9999
4065-
\end{verbatim}
4066-
}
4067-
For visualization purposes, let us move the CNT to the center of the simulation box.
4068-
{\normalsize
4069-
\begin{verbatim}
4070-
fix centralize CNT recenter 0 0 0 units box &
4071-
shift all
4052+
\end{lstlisting}
4053+
For visualization purposes, let us move the CNT to the center of the box
4054+
for the last step of the simulation using \lmpcmd{fix centralize}:
4055+
\begin{lstlisting}
4056+
fix centralize CNT recenter 0 0 0 units box shift all
40724057
run 1
40734058

40744059
write_data CNT-PS-mix.data
4075-
\end{verbatim}
4076-
}
4060+
\end{lstlisting}
40774061
As the time progresses, [maybe plot total energy instead of density
40784062
to demonstrate equilbrated box]
40794063
%the density $\rho$ of the system progressively

0 commit comments

Comments
 (0)