You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lammps-tutorials.tex
+52-52Lines changed: 52 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -1810,15 +1810,15 @@ \subsubsection{Preparing the water reservoir}
1810
1810
Create a folder called \textit{pureH2O/}. Inside this folder, create an empty text
1811
1811
file called \textit{input.lmp}. Copy the following lines into it:
1812
1812
{\normalsize\begin{verbatim}
1813
-
units real
1814
-
atom_style full
1815
-
bond_style harmonic
1816
-
angle_style harmonic
1817
-
dihedral_style harmonic
1818
-
pair_style lj/cut/coul/long 10
1819
-
kspace_style pppm 1e-5
1820
-
special_bonds lj 0.0 0.0 0.5 &
1821
-
coul 0.0 0.0 1.0 angle yes
1813
+
units real
1814
+
atom_style full
1815
+
bond_style harmonic
1816
+
angle_style harmonic
1817
+
dihedral_style harmonic
1818
+
pair_style lj/cut/coul/long 10
1819
+
kspace_style pppm 1e-5
1820
+
special_bonds lj 0.0 0.0 0.5 &
1821
+
coul 0.0 0.0 1.0 angle yes
1822
1822
\end{verbatim}}
1823
1823
With the unit style \textit{real}, masses are in grams per mole, distances in
1824
1824
Ångstroms, time in femtoseconds, and energies in kcal/mole. With the \textit{atom\_style full}, each atom is a dot with a mass and a charge that can be linked by bonds, angles, dihedrals, and/or impropers. The \textit{bond\_style},
@@ -1837,22 +1837,22 @@ \subsubsection{Preparing the water reservoir}
1837
1837
(1 for the water, 6 for the polymer), 8 angle types (1 for the water, 7 for the polymer),
1838
1838
and 4 dihedral types (only for the polymer). Copy the following lines into \textit{input.lmp}:
1839
1839
{\normalsize\begin{verbatim}
1840
-
region box block -45 45 -15 15 -15 15
1841
-
create_box 8 box &
1842
-
bond/types 7 &
1843
-
angle/types 8 &
1844
-
dihedral/types 4 &
1845
-
extra/bond/per/atom 3 &
1846
-
extra/angle/per/atom 6 &
1847
-
extra/dihedral/per/atom 10 &
1848
-
extra/special/per/atom 14
1840
+
region box block -45 45 -15 15 -15 15
1841
+
create_box 8 box &
1842
+
bond/types 7 &
1843
+
angle/types 8 &
1844
+
dihedral/types 4 &
1845
+
extra/bond/per/atom 3 &
1846
+
extra/angle/per/atom 6 &
1847
+
extra/dihedral/per/atom 10 &
1848
+
extra/special/per/atom 14
1849
1849
\end{verbatim}}
1850
1850
The \textit{extra/x/per/atom} commands are here for
1851
1851
memory allocation. We will use a file named \textit{PARM.lmp} that contains
1852
1852
all the parameters (masses, interaction energies, bond equilibrium
1853
1853
distances, etc). In \textit{input.lmp}, add the following line:
1854
1854
{\normalsize\begin{verbatim}
1855
-
include ../PARM.lmp
1855
+
include ../PARM.lmp
1856
1856
\end{verbatim}}
1857
1857
1858
1858
Download and save the
@@ -1871,9 +1871,9 @@ \subsubsection{Preparing the water reservoir}
1871
1871
\textit{H2O-SPCFw.mol} and then randomly create 1050 molecules. Add the following
1872
1872
lines into \textit{input.lmp}:
1873
1873
{\normalsize\begin{verbatim}
1874
-
molecule h2omol H2O-SPCFw.mol
1875
-
create_atoms 0 random 1050 87910 NULL mol &
1876
-
h2omol 454756 overlap 1.0 maxtry 50
1874
+
molecule h2omol H2O-SPCFw.mol
1875
+
create_atoms 0 random 1050 87910 NULL mol &
1876
+
h2omol 454756 overlap 1.0 maxtry 50
1877
1877
\end{verbatim}}
1878
1878
The \textit{overlap 1} option of the \textit{create\_atoms} command ensures
1879
1879
that no atoms are placed exactly in the same position, as this would cause the
@@ -1884,7 +1884,7 @@ \subsubsection{Preparing the water reservoir}
1884
1884
of molecules. Always check the number of created atoms in the \textit{log} file
1885
1885
after starting the simulation:
1886
1886
{\normalsize\begin{verbatim}
1887
-
Created 3150 atoms
1887
+
Created 3150 atoms
1888
1888
\end{verbatim}}
1889
1889
When LAMMPS fails to create the desired number of molecules, a WARNING appears
1890
1890
in the \textit{log} file. The molecule template called
@@ -1898,9 +1898,9 @@ \subsubsection{Preparing the water reservoir}
1898
1898
minimization is mandatory here given the small \textit{overlap} value of 1 Ångstrom
1899
1899
chosen in the \textit{create\_atoms} command. Add the following lines into \textit{input.lmp}:
1900
1900
{\normalsize\begin{verbatim}
1901
-
group H2O type OW HW
1902
-
minimize 1.0e-4 1.0e-6 100 1000
1903
-
reset_timestep 0
1901
+
group H2O type OW HW
1902
+
minimize 1.0e-4 1.0e-6 100 1000
1903
+
reset_timestep 0
1904
1904
\end{verbatim}}
1905
1905
In general, resetting the step of the simulation to 0 using the
1906
1906
\textit{reset\_timestep} command is optional.
@@ -1911,47 +1911,47 @@ \subsubsection{Preparing the water reservoir}
1911
1911
a Nosé-Hoover barostat \cite{nose1984unified, hoover1985canonical, martyna1994constant},
1912
1912
by adding the following line into \textit{input.lmp}:
1913
1913
{\normalsize\begin{verbatim}
1914
-
fix mynpt all npt temp 300 300 100 &
1915
-
iso 1 1 1000
1914
+
fix mynpt all npt temp 300 300 100 &
1915
+
iso 1 1 1000
1916
1916
\end{verbatim}}
1917
1917
The \textit{fix npt} allows us to impose both a temperature of $300\,\text{K}$
1918
1918
(with a damping constant of $100\,\text{fs}$), and a pressure of 1 atmosphere
1919
1919
(with a damping constant of $1000\,\text{fs}$). With the \textit{iso} keyword,
1920
1920
the three dimensions of the box will be re-scaled simultaneously.
1921
1921
1922
-
Let us print the atom positions in a \textit{.lammpstrj} file every 1000 steps
1923
-
(i.e. 1 ps), print the temperature volume, and density every 100 steps in 3
1924
-
separate data files, and print the information in the terminal every 1000 steps:
1922
+
Let us output the system into images by adding the following commands to \textit{input.lmp}:
1925
1923
{\normalsize\begin{verbatim}
1926
-
dump mydmp all atom 1000 dump.lammpstrj
1927
-
variable mytemp equal temp
1928
-
variable myvol equal vol
1929
-
fix myat1 all ave/time 10 10 100 v_mytemp &
1930
-
file temperature.dat
1931
-
fix myat2 all ave/time 10 10 100 v_myvol &
1932
-
file volume.dat
1933
-
variable myoxy equal count(H2O)/3
1934
-
variable mydensity equal ${myoxy}/v_myvol
1935
-
fix myat3 all ave/time 10 10 100 v_mydensity &
1936
-
file density.dat
1937
-
thermo 1000
1924
+
dump mydmp all image 1000 dump.*.ppn type type &
1925
+
shiny 0.1 box no 0.01 view 0 90 zoom 1.8
1926
+
dump_modify mydmp backcolor white &
1927
+
acolor OW red acolor HW white &
1928
+
adiam OW 3 adiam HW 1.5
1929
+
\end{verbatim}}
1930
+
Let us also extract the volume and density in the terminal every 1000 steps:
0 commit comments