@@ -8,9 +8,9 @@ desired temperature and pressure.
88System generation
99-----------------
1010
11- To set up this tutorial, select `` Start Tutorial 4 `` from the
12- `` Tutorials `` menu of LAMMPS--GUI and follow the instructions.
13- The editor should display the following content corresponding to ** create.lmp ** :
11+ Create a folder if needed and
12+ place the initial input file, ** create.lmp **, into it. Then, open the
13+ file in a text editor of your choice, and copy the following into it :
1414
1515.. code-block :: lammps
1616
@@ -23,13 +23,21 @@ The editor should display the following content corresponding to **create.lmp**:
2323 kspace_style pppm/tip4p 1.0e-5
2424 kspace_modify slab 3.0
2525
26+
27+ .. admonition :: If you are using LAMMPS-GUI
28+ :class: gui
29+
30+ To begin this tutorial, select ``Start Tutorial 4 `` from the
31+ ``Tutorials `` menu of LAMMPS--GUI and follow the instructions.
32+ The editor should display the following content corresponding to **create.lmp **
33+
2634These lines are used to define the most basic parameters, including the
2735atom, bond, and angle styles, as well as interaction
2836potential. Here, ``lj/cut/tip4p/long `` imposes a Lennard-Jones potential with
2937a cut-off at :math: `12 \,\text {Å}` and a long-range Coulomb potential.
3038
3139So far, the commands are relatively similar to those in the previous tutorial,
32- :ref: `all-atom -label `, with two major differences: the use
40+ :ref: `all-atoms -label `, with two major differences: the use
3341of ``lj/cut/tip4p/long `` instead of ``lj/cut/coul/long ``, and ``pppm/tip4p ``
3442instead of ``pppm ``. When using ``lj/cut/tip4p/long `` and ``pppm/tip4p ``,
3543the interactions resemble the conventional Lennard-Jones and Coulomb interactions,
@@ -70,7 +78,6 @@ The parameters for these bond and angle constraints will be given later. The ``
7078keywords are for memory allocation. Finally, the ``labelmap `` commands assign
7179alphanumeric type labels to each numeric atom type, bond type, and angle type.
7280
73-
7481Now, we can add atoms to the system. First, let us create two sub-regions corresponding
7582respectively to the two solid walls, and create a larger region from the union of the
7683two regions. Then, let us create atoms of type WALL within the two regions. Add the
@@ -237,7 +244,7 @@ to delete about :math:`15~\%` of the water molecules:
237244 delete_atoms random fraction 0.15 yes H2O NULL 482793 mol yes
238245
239246 To create an image of the system, add the following ``dump `` image
240- into **create.lmp ** (see also Fig.~ \r ef{fig:NANOSHEAR-system}) :
247+ into **create.lmp **:
241248
242249.. code-block :: lammps
243250
@@ -272,18 +279,23 @@ and a file named **create.data** will be created alongside **create.lmp**.
272279.. container :: figurelegend
273280
274281 Figure: Side view of the system. Periodic images are represented in darker colors.
275- Water molecules are in red and white, :math: `\text {Na}^+` ions in purple , :math: `\text {Cl}^-`
282+ Water molecules are in red and white, :math: `\text {Na}^+` ions in pink , :math: `\text {Cl}^-`
276283 ions in lime, and wall atoms in gray. Note the absence of atomic defect at the
277284 cell boundaries.
278285
279- \p aragraph{Energy minimization}
286+ Energy minimization
287+ -------------------
280288
281289Let us move the atoms and place them in more energetically favorable positions
282290before starting the actual molecular dynamics simulation.
283291
292+ .. admonition :: If you are using LAMMPS-GUI
293+ :class: gui
294+
295+ Open the **equilibrate.lmp ** file that was downloaded alongside
296+ **create.lmp ** during the tutorial setup.
284297
285- Open the **equilibrate.lmp ** file that was downloaded alongside
286- **create.lmp ** during the tutorial setup. It contains the following lines:
298+ Create a new file, **equilibrate.lmp **, and copy the following into it:
287299
288300.. code-block :: lammps
289301
@@ -390,7 +402,7 @@ The first two variables extract the centers of mass of the two walls. The
390402variables ``walltopz `` and ``wallbotz ``, i.e.~the distance between the
391403two centers of mass of the walls.
392404
393- Finally, let us run the simulation for 30~ ps by adding a ``run `` command
405+ Finally, let us run the simulation for 30 ps by adding a ``run `` command
394406to **equilibrate.lmp **:
395407
396408.. code-block :: lammps
@@ -402,7 +414,7 @@ to **equilibrate.lmp**:
402414 Run the **equilibrate.lmp ** file using LAMMPS. Both the pressure and the distance
403415between the two walls show oscillations at the start of the simulation
404416but eventually stabilize at their equilibrium values toward
405- the end of the simulation (Fig.~ \r ef{fig:NANOSHEAR-equilibration}) .
417+ the end of the simulation.
406418
407419.. admonition :: Note
408420 :class: non-title-info
@@ -434,10 +446,15 @@ the end of the simulation (Fig.~\ref{fig:NANOSHEAR-equilibration}).
434446Imposed shearing
435447----------------
436448
437-
438449From the equilibrated configuration, let us impose a lateral motion on the two
439- walls and shear the electrolyte. Open the last input file named **shearing.lmp **.
440- It starts with the following lines:
450+ walls and shear the electrolyte.
451+
452+ .. admonition :: If you are using LAMMPS-GUI
453+ :class: gui
454+
455+ Open the last input file named **shearing.lmp **.
456+
457+ Create a new file, **shearing.lmp **, and copy the following into it:
441458
442459.. code-block :: lammps
443460
@@ -496,18 +513,6 @@ experience any forces from the rest of the system. Consequently, in the absence
496513external forces, these atoms will conserve the initial velocities imposed by the
497514two ``velocity `` commands.
498515
499- .. figure :: figures/NANOSHEAR-profiles-dm.png
500- :class: only-dark
501- :alt: Velocity profiles for the elecrolyte
502-
503- .. figure :: figures/NANOSHEAR-profiles.png
504- :class: only-light
505- :alt: Velocity profiles for the elecrolyte
506-
507- .. container :: figurelegend
508-
509- Figure: Velocity profiles for water (blue) and walls (orange) along the :math: `z`-axis.
510-
511516Finally, let us generate images of the systems and print the values of the
512517forces exerted by the fluid on the walls, as given by ``f_mysf1[1] ``
513518and ``f_mysf2[1] ``. Add these lines to **shearing.lmp **:
@@ -551,27 +556,40 @@ steps of the simulations. The result will be averaged and printed only
551556once at the 200,000 th step.
552557
553558Run the simulation using LAMMPS. The averaged velocity
554- profile for the fluid is plotted in Fig.~ \r ef{fig:NANOSHEAR-profiles} .
559+ profile for the fluid is plotted below .
555560As expected for such Couette flow geometry, the fluid velocity increases
556561linearly along :math: `z`, and is equal to the walls velocities at the fluid-solid
557562interfaces (no-slip boundary conditions).
558563
564+ .. figure :: figures/NANOSHEAR-profiles-dm.png
565+ :class: only-dark
566+ :alt: Velocity profiles for the elecrolyte
567+
568+ .. figure :: figures/NANOSHEAR-profiles.png
569+ :class: only-light
570+ :alt: Velocity profiles for the elecrolyte
571+
572+ .. container :: figurelegend
573+
574+ Figure: Velocity profiles for water (blue) and walls (orange) along the :math: `z`-axis.
575+
559576From the force applied by the fluid on the solid, one can extract the stress
560577within the fluid, which enables the measurement of its viscosity :math: `\eta `
561578according to
562579
563- TODO : PUT LABEL
564580.. math ::
581+ :label: eq_eta
582+
565583 \eta = \tau / \dot {\gamma }
566584
567585 where :math: `\tau ` is the stress applied by
568586the fluid on the shearing wall, and :math: `\dot {\gamma }` the shear rate
569587:cite: `gravelle2021violations `. Here, the shear rate is
570- approximately :math: `\dot {\gamma } = 20 \cdot 10 ^9 \,\text {s}^{-1 }` (Fig.~ \r ef{fig:NANOSHEAR-profiles}) ,
588+ approximately :math: `\dot {\gamma } = 20 \cdot 10 ^9 \,\text {s}^{-1 }`,
571589the average force on each wall is given by ``f_mysf1[1] `` and ``f_mysf2[1] ``
572590and is approximately :math: `2.7 \,\mathrm {kcal/mol/Å}` in magnitude. Using a surface area
573591for the walls of :math: `A = 6 \cdot 10 ^{-18 }\,\text {m}^2 `, one obtains an estimate for
574- the shear viscosity for the confined fluid of :math: `\eta = 3.1 \,\text {mPa.s}` using Eq.~ \e qref{ eq:eta} .
592+ the shear viscosity for the confined fluid of :math: `\eta = 3.1 \,\text {mPa.s}` using Eq. : eq:` eq_eta ` .
575593
576594.. admonition :: Note
577595 :class: non-title-info
0 commit comments