@@ -1798,7 +1798,7 @@ \subsubsection{Preparing the water reservoir}
17981798\end {lstlisting }
17991799When LAMMPS fails to create the desired number of molecules, a WARNING appears.
18001800The molecule template called \href {\filepath tutorial3/water.mol}{\dwlcmd {water.mol}}
1801- must be downloaded and saved next to \lmpcmd {water.lmp}. This template contains
1801+ must be downloaded and saved next to \flecmd {water.lmp}. This template contains
18021802the necessary structural information of a water molecule, such as the number of
18031803atoms, or the IDs of the atoms that are connected by bonds and angles.
18041804
@@ -1880,8 +1880,10 @@ \subsubsection{Preparing the water reservoir}
18801880
18811881\begin {note }
18821882The binary file created by the \lmpcmdnote {write\_ restart} command contains the
1883- complete state of the simulation, including atomic positions, velocities, and box dimensions (similar to \lmpcmdnote {write\_ data}), but also the groups,
1884- the compute, or the \lmpcmdnote {atom\_ style}. Use the \guicmd {Inspect Restart} option of the LAMMPS-GUI to vizualize the content saved in \flecmd {water.restart}.
1883+ complete state of the simulation, including atomic positions, velocities, and
1884+ box dimensions (similar to \lmpcmdnote {write\_ data}), but also the groups,
1885+ the compute, or the \lmpcmdnote {atom\_ style}. Use the \guicmd {Inspect Restart}
1886+ option of the LAMMPS-GUI to vizualize the content saved in \flecmd {water.restart}.
18851887\end {note }
18861888
18871889\begin {figure }
@@ -1910,14 +1912,14 @@ \subsubsection{Solvating the PEG in water}
19101912\end {figure }
19111913
19121914Open the file named \flecmd {merge.lmp} that was downloaded
1913- alongside \lmpcmd {water.lmp} during the tutorial setup. It only contain one line:
1915+ alongside \flecmd {water.lmp} during the tutorial setup. It only contain one line:
19141916\ begin{lstlisting}
19151917read_restart water.restart
19161918\end {lstlisting }
1917- Most of the commands that were initially present in \lmpcmd {water.lmp}, such as
1919+ Most of the commands that were initially present in \flecmd {water.lmp}, such as
19181920the \lmpcmd {units} of the \lmpcmd {atom\_ style} commands do not need to be repeated,
19191921as they were saved within the \flecmd {.restart} file. There is also no need to
1920- re-include the parameters from the \lmpcmd {.inc} file. The \lmpcmd {kspace\_ style}
1922+ re-include the parameters from the \flecmd {.inc} file. The \lmpcmd {kspace\_ style}
19211923command, however, is not saved by the \lmpcmd {write\_ restart} command and must be
19221924repeated. Since Ewald summation is not the most efficient choice for such dense
19231925system, let us use PPPM (for particle-particle particle-mesh) for the rest
@@ -2123,152 +2125,151 @@ \subsection{Tutorial 4: Nanosheared electrolyte}
21232125\centering
21242126\includegraphics [width=0.55\linewidth ]{NANOSHEAR}
21252127\caption {The electrolyte confined in a nanometer slit pore as simulated during
2126- \hyperref [sheared-confined-label]{Tutorial 4}. $ \text {Na}^+$ ions are represented
2128+ \hyperref [sheared-confined-label]{Tutorial 4}. $ \text {Na}^+$ ions are represented
21272129as purple spheres, $ \text {Cl}^-$ ions as cyan spheres, water molecules are colored
2128- in red and white, and the walls are colored in gray. The arrows indicate the
2130+ in red and white, and the walls are colored in gray. The arrows indicate the
21292131imposed lateral motion of the walls.}
21302132\label {fig:NANOSHEAR }
21312133\end {figure }
21322134
21332135\noindent The objective of this tutorial is to simulate an electrolyte
2134- nanoconfined and sheared by two walls (Fig.\, \ref {fig:NANOSHEAR }). The density
2136+ nanoconfined and sheared between two walls (Fig.\, \ref {fig:NANOSHEAR }). The density
21352137and velocity profiles of the fluid in the direction normal to the walls are
21362138extracted to highlight the effect of confining a fluid on its local properties.
2137- This tutorial illustrates some key aspects of combining a fluid and a solid in
2138- the same simulation. A major difference from the previous tutorial,
2139+ This tutorial demonstrates key concepts of combining a fluid and a solid in
2140+ the same simulation. A major difference from the previous tutorial,
21392141\hyperref [all-atoms-label]{Polymer in water}, is that here a rigid four-point
2140- water model named TIP4P is used \cite {abascal2005general }. TIP4P is one of
2141- the most common water models due to its high accuracy.
2142+ water model named TIP4P/2005 is used \cite {abascal2005general }.
2143+
2144+ \begin {note }
2145+ Four-point water models such as TIP4P/2005 are widely used as they offer a
2146+ good compromise between accuracy and computational cost \cite {kadaoluwa2021systematic }.
2147+ \end {note }
21422148
21432149\subsubsection {System preparation }
2144- The fluid and walls must first be generated and then equilibrated at a reasonable
2145- temperature and pressure.
2150+
2151+ The fluid and walls must first be generated, followed by equilibration at the
2152+ desired temperature and pressure.
21462153
21472154\paragraph {System generation }
2148- Create a new folder called \flrcmd {systemcreation/}. Within
2149- \flrcmd {systemcreation/}, open a blank file called \flecmd {input.lmp}, and
2150- copy the following lines into it:
2155+
2156+ To set up this tutorial, select \guicmd {Start Tutorial 4} from the
2157+ \guicmd {Tutorials} menu of LAMMPS--GUI and follow the instructions.
2158+ The editor should display the following content corresponding to \flecmd {create.lmp}:
21512159\ begin{lstlisting}
21522160boundary p p f
21532161units real
21542162atom_style full
21552163bond_style harmonic
21562164angle_style harmonic
2157- pair_style lj/cut/tip4p/long O H O-H H-O-H &
2158- 0.1546 12.0
2159- kspace_style pppm/tip4p 1.0e-4
2165+ pair_style lj/cut/tip4p/long O H O-H H-O-H 0.1546 12.0
2166+ kspace_style pppm/tip4p 1.0e-5
21602167kspace_modify slab 3.0
21612168\end {lstlisting }
2162-
21632169These lines are used to define the most basic parameters, including the
2164- \textit {atom }, \textit {bond }, and \textit {angle } styles, as well as interaction
2165- potential. Here, \textit {lj/cut/tip4p/long } imposes a Lennard-Jones potential with
2170+ \lmpcmd {atom}, \lmpcmd {bond}, and \lmpcmd {angle} styles, as well as interaction
2171+ potential. Here, \lmpcmd {lj/cut/tip4p/long} imposes a Lennard-Jones potential with
21662172a cut-off at $ 12 \, \text {$ \text {\AA {}}$ }$ and a long-range Coulomb potential.
21672173
2168- % S.G. To fix, this was removed from tutorial 3 : The \textit{pppm} style refers to particle-particle particle-mesh . \cite{luty1996calculating}
21692174So far, the commands are relatively similar to those in the previous tutorial,
21702175\hyperref [all-atoms-label]{Polymer in water}, with two major differences: the use
2171- of \textit {lj/cut/tip4p/long } instead of \textit {lj/cut/coul/long }, and \textit {pppm/tip4p }
2172- instead of \textit {pppm }. When using \textit {lj/cut/tip4p/long } and \textit {pppm/tip4p },
2176+ of \lmpcmd {lj/cut/tip4p/long} instead of \lmpcmd {lj/cut/coul/long}, and \lmpcmd {pppm/tip4p}
2177+ instead of \lmpcmd {pppm}. When using \lmpcmd {lj/cut/tip4p/long} and \lmpcmd {pppm/tip4p},
21732178the interactions resemble the conventional Lennard-Jones and Coulomb interactions,
2174- except that they are specifically designed for the four-point water model. Therefore ,
2175- LAMMPS automatically creates a four-point water molecule using atoms of type O as
2176- oxygen and atoms of type H as hydrogen. The fourth massless atom (\textit { M } ) of the
2179+ except that they are specifically designed for the four-point water model. As a result ,
2180+ LAMMPS automatically creates a four-point water molecule, assigning type O
2181+ atoms as oxygen and type H atoms as hydrogen. The fourth massless atom (M ) of the
21772182TIP4P water molecule does not have to be defined explicitly, and the value of
2178- $ 0.1546 \, \text {$ \text {\AA {}}$ }$ corresponds to the \textit { O-M } distance of the
2179- TIP4P-2005 water model \cite {abascal2005general }. All the other atoms in the simulation
2180- are treated normally with long-range Coulomb interactions. Another novelty, here, is
2181- the use of \textit {kspace\_ modify slab 3.0 } that is combined with the non-periodic
2182- boundaries along the $ z$ coordinate: \textit {boundary p p f }. With the \textit {slab }
2183+ $ 0.1546 \, \text {$ \text {\AA {}}$ }$ corresponds to the O-M distance of the
2184+ TIP4P-2005 water model \cite {abascal2005general }. All other atoms in the simulation
2185+ are treated as usual, with long-range Coulomb interactions. Another novelty, here, is
2186+ the use of \lmpcmd {kspace\_ modify slab 3.0} that is combined with the non-periodic
2187+ boundaries along the $ z$ coordinate: \lmpcmd {boundary p p f}. With the \lmpcmd {slab}
21832188option, the system is treated as periodical along $ z$ , but with an empty volume inserted
21842189between the periodic images of the slab, and the interactions along $ z$ effectively turned off.
21852190
2186- Let us create the box by adding the following lines to \flecmd {input.lmp}:
2187-
2191+ Let us create the box and the label maps by adding the following lines to \flecmd {create.lmp}:
21882192\ begin{lstlisting}
21892193lattice fcc 4.04
21902194region box block -3 3 -3 3 -5 5
2191- create_box 5 box &
2192- bond/types 1 &
2193- angle/types 1 &
2194- extra/bond/per/atom 2 &
2195- extra/angle/per/atom 1 &
2196- extra/special/per/atom 2
2195+ create_box 5 box bond/types 1 angle/types 1 &
2196+ extra/bond/per/atom 2 extra/angle/per/atom 1 &
2197+ extra/special/per/atom 2
21972198labelmap atom 1 O 2 H 3 Na+ 4 Cl- 5 WALL
21982199labelmap bond 1 O-H
21992200labelmap angle 1 H-O-H
22002201\end {lstlisting }
2201- The \textit {lattice } command defines the unit cell. Here, the face-centered cubic (fcc) lattice
2202+ The \lmpcmd {lattice} command defines the unit cell. Here, the face-centered cubic (fcc) lattice
22022203with a scale factor of 4.04 has been chosen for the future positioning of the atoms
2203- of the walls. The \textit {region } command defines a geometric region of space. By choosing
2204- \textit {xlo=-3 } and \textit { xhi=3 } , and because we have previously chosen a lattice with a scale
2204+ of the walls. The \lmpcmd {region} command defines a geometric region of space. By choosing
2205+ $ \text {xlo} =-3 $ and $ \text {xlo}= 3 $ , and because we have previously chosen a lattice with a scale
22052206factor of 4.04, the region box extends from $ -12.12 ~\text {\AA {}}$ to $ 12.12 ~\text {\AA {}}$
2206- along the $ x$ direction. The \textit {create\_ box } command creates a simulation box with
2207+ along the $ x$ direction. The \lmpcmd {create\_ box} command creates a simulation box with
220722085 types of atoms: the oxygen and hydrogen of the water molecules, the two ions ($ \text {Na}^+$ ,
2208- $ \text {Cl}^-$ ), and the atom of the walls. The \textit {create\_ box } command extends over 6
2209- lines thanks to the $ \& $ character. The second and third lines are used to indicate that the
2209+ $ \text {Cl}^-$ ), and the atom of the walls. The \lmpcmd {create\_ box} command extends over 6
2210+ lines thanks to the $ \& $ character. The second and third lines are used to indicate that the
22102211simulation contains 1 type of bond and 1 type of angle (both required by the water molecule).
2211- The parameters for these bond and angle constraints will be given later. The three last
2212- lines are for memory allocation. The \textit {labelmap } command assigns alphanumeric type labels
2212+ The parameters for these bond and angle constraints will be given later. The three last
2213+ lines are for memory allocation. The \lmpcmd {labelmap} command assigns alphanumeric type labels
22132214to each numeric atom type, bond type, and angle type.
22142215
2215- Now, we can add atoms to the system. First, let us create two sub-regions corresponding
2216+ Now, we can add atoms to the system. First, let us create two sub-regions corresponding
22162217respectively to the two solid walls, and create a larger region from the union of the
2217- two regions. Then, let us create atoms of type WALL within the two regions. Add the
2218- following lines to \flecmd {input .lmp}:
2218+ two regions. Then, let us create atoms of type WALL within the two regions. Add the
2219+ following lines to \flecmd {create .lmp}:
22192220\ begin{lstlisting}
22202221region rbotwall block -3 3 -3 3 -4 -3
22212222region rtopwall block -3 3 -3 3 3 4
22222223region rwall union 2 rbotwall rtopwall
22232224create_atoms WALL region rwall
22242225\end {lstlisting }
22252226Atoms will be placed in the positions of the previously defined lattice, thus
2226- forming fcc solids. To add the water molecules, first download the molecule
2227- template called \href {\filepath tutorial4/RigidH2O.txt}{\dwlcmd {RigidH2O.txt}}
2228- and place it within \flrcmd {systemcreation/}. The template contains all the
2227+ forming fcc solids.
2228+
2229+ To add the water molecules, the molecule
2230+ template called \href {\filepath water.mol}{\dwlcmd {water.mol}}
2231+ must be located next to \flecmd {}. The template contains all the
22292232necessary information concerning the water molecule, such as atom positions,
2230- bonds, and angles. Add the following lines to \flecmd {input .lmp}:
2233+ bonds, and angles. Add the following lines to \flecmd {create .lmp}:
22312234\ begin{lstlisting}
22322235region rliquid block INF INF INF INF -2 2
2233- molecule h2omol RigidH2O.txt
2236+ molecule h2omol water.mol
22342237create_atoms 0 region rliquid mol h2omol 482793
22352238\end {lstlisting }
2236- Within the last three lines, a \textit {region } named \textit {rliquid } is
2237- created based on the last defined lattice, \textit {fcc 4.04 }. \textit {rliquid }
2238- will be used for depositing the water molecules. The \textit {molecule } command
2239- opens up the molecule template called \flecmd {RigidH2O.txt }, and names the
2240- associated molecule \textit {h2omol }. The new molecules are placed on the
2241- \textit {fcc 4.04 } lattice by the \textit {create\_ atoms } command. The first
2242- parameter is 0, meaning that the atom IDs from the \flecmd {RigidH2O.txt } file
2243- will be used. The number \textit {482793 } is a seed that is required by LAMMPS,
2239+ Within the last three lines, a \lmpcmd {region} named \lmpcmd {rliquid} is
2240+ created based on the last defined lattice, \lmpcmd {fcc 4.04}. \lmpcmd {rliquid}
2241+ will be used for depositing the water molecules. The \lmpcmd {molecule} command
2242+ opens up the molecule template called \flecmd {water.mol }, and names the
2243+ associated molecule \lmpcmd {h2omol}. The new molecules are placed on the
2244+ \lmpcmd {fcc 4.04} lattice by the \lmpcmd {create\_ atoms} command. The first
2245+ parameter is 0, meaning that the atom IDs from the \flecmd {water.mol } file
2246+ will be used. The number \lmpcmd {482793} is a seed that is required by LAMMPS,
22442247it can be any positive integer.
22452248
22462249Finally, let us create 30 ions (15 $ \text {Na}^+$ and 15 $ \text {Cl}^-$ ) in between
2247- the water molecules, by adding the following commands to \flecmd {input .lmp}:
2250+ the water molecules, by adding the following commands to \flecmd {create .lmp}:
22482251\ begin{lstlisting}
2249- create_atoms Na+ random 15 52802 rliquid &
2250- overlap 0.3 maxtry 500
2251- create_atoms Cl- random 15 90182 rliquid &
2252- overlap 0.3 maxtry 500
2252+ create_atoms Na+ random 15 5802 rliquid overlap 0.3 maxtry 500
2253+ create_atoms Cl- random 15 9012 rliquid overlap 0.3 maxtry 500
22532254set type Na+ charge 1
22542255set type Cl- charge -1
22552256\end {lstlisting }
2256- Each \textit {create\_ atoms } command will add 15 ions at random positions
2257- within the \textit {rliquid } region, ensuring that there is no \textit {overlap }
2257+ Each \lmpcmd {create\_ atoms} command will add 15 ions at random positions
2258+ within the \lmpcmd {rliquid} region, ensuring that there is no \lmpcmd {overlap}
22582259with existing molecules. Feel free to increase or decrease the salt concentration
22592260by changing the number of desired ions. To keep the system charge neutral,
22602261always insert the same number of $ \text {Na}^+$ and $ \text {Cl}^-$ , unless there
22612262are other charges in the system. The charges of the newly added ions are specified
2262- by the two \textit {set } commands.
2263+ by the two \lmpcmd {set} commands.
22632264
22642265Before starting the simulation, we still need to define the parameters of the
22652266simulation: the mass of the 5 atom types (O, H, $ \text {Na}^+$ , $ \text {Cl}^-$ ,
22662267and wall), the pairwise interaction parameters (here, the parameters for the
22672268Lennard-Jones potential), and the bond and angle parameters. Copy the following
2268- lines into \flecmd {input .lmp}:
2269+ lines into \flecmd {create .lmp}:
22692270\ begin{lstlisting}
2270- include ../PARM.lmp
2271- include ../GROUP.lmp
2271+ include parameters.inc
2272+ include groups.inc
22722273\end {lstlisting }
22732274Create a new text file called \flecmd {PARM.lmp} next to the \flrcmd {systemcreation/}
22742275folder. Copy the following lines into \flecmd {PARM.lmp}:
@@ -2285,6 +2286,9 @@ \subsubsection{System preparation}
22852286pair_coeff Cl- Cl- 0.1500 4.04470
22862287pair_coeff WALL WALL 11.697 2.574
22872288pair_coeff O WALL 0.4 2.86645
2289+
2290+ bond_coeff O-H 0 0.9572
2291+ angle_coeff H-O-H 0 104.52
22882292\end {lstlisting }
22892293Each \textit {mass } command assigns a mass in grams/mole to an atom type.
22902294Each \textit {pair\_ coeff } assigns respectively the depth of the LJ potential
@@ -2384,7 +2388,7 @@ \subsubsection{System preparation}
23842388angle_style harmonic
23852389pair_style lj/cut/tip4p/long O H O-H H-O-H &
23862390 0.1546 12.0
2387- kspace_style pppm/tip4p 1.0e-4
2391+ kspace_style pppm/tip4p 1.0e-5
23882392kspace_modify slab 3.0
23892393
23902394read_data ../systemcreation/system.data
@@ -2402,7 +2406,7 @@ \subsubsection{System preparation}
24022406\ begin{lstlisting}
24032407fix mynve fluid nve/limit 0.1
24042408fix myber fluid temp/berendsen 1 1 100
2405- fix myshk H2O shake 1.0e-4 200 0 b O-H a H-O-H
2409+ fix myshk H2O shake 1.0e-5 200 0 b O-H a H-O-H
24062410timestep 0.5
24072411\end {lstlisting }
24082412Just like \textit {fix nve }, the \textit {fix nve/limit } command performs constant
@@ -2483,7 +2487,7 @@ \subsubsection{System preparation}
24832487angle_style harmonic
24842488pair_style lj/cut/tip4p/long O H O-H H-O-H &
24852489 0.1546 12.0
2486- kspace_style pppm/tip4p 1.0e-4
2490+ kspace_style pppm/tip4p 1.0e-5
24872491kspace_modify slab 3.0
24882492
24892493read_data ../minimization/system.data
@@ -2493,7 +2497,7 @@ \subsubsection{System preparation}
24932497
24942498fix mynve all nve
24952499fix myber all temp/berendsen 300 300 100
2496- fix myshk H2O shake 1.0e-4 200 0 b O-H a H-O-H
2500+ fix myshk H2O shake 1.0e-5 200 0 b O-H a H-O-H
24972501fix myrct all recenter NULL NULL 0
24982502timestep 1.0
24992503\end {lstlisting }
@@ -2555,9 +2559,8 @@ \subsubsection{Imposed shearing}
25552559atom_style full
25562560bond_style harmonic
25572561angle_style harmonic
2558- pair_style lj/cut/tip4p/long O H O-H H-O-H &
2559- 0.1546 12.0
2560- kspace_style pppm/tip4p 1.0e-4
2562+ pair_style lj/cut/tip4p/long O H O-H H-O-H 0.1546 12.0
2563+ kspace_style pppm/tip4p 1.0e-5
25612564kspace_modify slab 3.0
25622565\end {lstlisting }
25632566Let us import the previously equilibrated data, include the parameter and group
@@ -2575,7 +2578,7 @@ \subsubsection{Imposed shearing}
25752578compute Twall wall temp/partial 0 1 1
25762579fix myber2 wall temp/berendsen 300 300 100
25772580fix_modify myber2 temp Twall
2578- fix myshk H2O shake 1.0e-4 200 0 b O-H a H-O-H
2581+ fix myshk H2O shake 1.0e-5 200 0 b O-H a H-O-H
25792582fix myrct all recenter NULL NULL 0
25802583\end {lstlisting }
25812584One difference with the previous input is that, here, two thermostats are used,
0 commit comments