@@ -8,9 +8,9 @@ desired temperature and pressure.
8
8
System generation
9
9
-----------------
10
10
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 :
14
14
15
15
.. code-block :: lammps
16
16
@@ -23,13 +23,21 @@ The editor should display the following content corresponding to **create.lmp**:
23
23
kspace_style pppm/tip4p 1.0e-5
24
24
kspace_modify slab 3.0
25
25
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
+
26
34
These lines are used to define the most basic parameters, including the
27
35
atom, bond, and angle styles, as well as interaction
28
36
potential. Here, ``lj/cut/tip4p/long `` imposes a Lennard-Jones potential with
29
37
a cut-off at :math: `12 \,\text {Å}` and a long-range Coulomb potential.
30
38
31
39
So 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
33
41
of ``lj/cut/tip4p/long `` instead of ``lj/cut/coul/long ``, and ``pppm/tip4p ``
34
42
instead of ``pppm ``. When using ``lj/cut/tip4p/long `` and ``pppm/tip4p ``,
35
43
the 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 ``
70
78
keywords are for memory allocation. Finally, the ``labelmap `` commands assign
71
79
alphanumeric type labels to each numeric atom type, bond type, and angle type.
72
80
73
-
74
81
Now, we can add atoms to the system. First, let us create two sub-regions corresponding
75
82
respectively to the two solid walls, and create a larger region from the union of the
76
83
two 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:
237
244
delete_atoms random fraction 0.15 yes H2O NULL 482793 mol yes
238
245
239
246
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 **:
241
248
242
249
.. code-block :: lammps
243
250
@@ -272,18 +279,23 @@ and a file named **create.data** will be created alongside **create.lmp**.
272
279
.. container :: figurelegend
273
280
274
281
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}^-`
276
283
ions in lime, and wall atoms in gray. Note the absence of atomic defect at the
277
284
cell boundaries.
278
285
279
- \p aragraph{Energy minimization}
286
+ Energy minimization
287
+ -------------------
280
288
281
289
Let us move the atoms and place them in more energetically favorable positions
282
290
before starting the actual molecular dynamics simulation.
283
291
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.
284
297
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:
287
299
288
300
.. code-block :: lammps
289
301
@@ -390,7 +402,7 @@ The first two variables extract the centers of mass of the two walls. The
390
402
variables ``walltopz `` and ``wallbotz ``, i.e.~the distance between the
391
403
two centers of mass of the walls.
392
404
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
394
406
to **equilibrate.lmp **:
395
407
396
408
.. code-block :: lammps
@@ -402,7 +414,7 @@ to **equilibrate.lmp**:
402
414
Run the **equilibrate.lmp ** file using LAMMPS. Both the pressure and the distance
403
415
between the two walls show oscillations at the start of the simulation
404
416
but 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.
406
418
407
419
.. admonition :: Note
408
420
:class: non-title-info
@@ -434,10 +446,15 @@ the end of the simulation (Fig.~\ref{fig:NANOSHEAR-equilibration}).
434
446
Imposed shearing
435
447
----------------
436
448
437
-
438
449
From 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:
441
458
442
459
.. code-block :: lammps
443
460
@@ -496,18 +513,6 @@ experience any forces from the rest of the system. Consequently, in the absence
496
513
external forces, these atoms will conserve the initial velocities imposed by the
497
514
two ``velocity `` commands.
498
515
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
-
511
516
Finally, let us generate images of the systems and print the values of the
512
517
forces exerted by the fluid on the walls, as given by ``f_mysf1[1] ``
513
518
and ``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
551
556
once at the 200,000 th step.
552
557
553
558
Run 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 .
555
560
As expected for such Couette flow geometry, the fluid velocity increases
556
561
linearly along :math: `z`, and is equal to the walls velocities at the fluid-solid
557
562
interfaces (no-slip boundary conditions).
558
563
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
+
559
576
From the force applied by the fluid on the solid, one can extract the stress
560
577
within the fluid, which enables the measurement of its viscosity :math: `\eta `
561
578
according to
562
579
563
- TODO : PUT LABEL
564
580
.. math ::
581
+ :label: eq_eta
582
+
565
583
\eta = \tau / \dot {\gamma }
566
584
567
585
where :math: `\tau ` is the stress applied by
568
586
the fluid on the shearing wall, and :math: `\dot {\gamma }` the shear rate
569
587
: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 }`,
571
589
the average force on each wall is given by ``f_mysf1[1] `` and ``f_mysf2[1] ``
572
590
and is approximately :math: `2.7 \,\mathrm {kcal/mol/Å}` in magnitude. Using a surface area
573
591
for 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 ` .
575
593
576
594
.. admonition :: Note
577
595
:class: non-title-info
0 commit comments