Skip to content

Commit 93b1ece

Browse files
committed
fixed tutorial 4
1 parent dd0bd86 commit 93b1ece

File tree

4 files changed

+75
-38
lines changed

4 files changed

+75
-38
lines changed

docs/sphinx/source/journal-article.bib

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,17 @@ @article{liese2017hydration
567567
publisher={ACS Publications}
568568
}
569569

570+
@article{kadaoluwa2021systematic,
571+
title={Systematic comparison of the structural and dynamic properties of commonly used water models for molecular dynamics simulations},
572+
author={Kadaoluwa Pathirannahalage, Sachini P and Meftahi, Nastaran and Elbourne, Aaron and Weiss, Alessia CG and McConville, Chris F and Padua, Agilio and Winkler, David A and Costa Gomes, Margarida and Greaves, Tamar L and Le, Tu C and others},
573+
journal={Journal of Chemical Information and Modeling},
574+
volume={61},
575+
number={9},
576+
pages={4521--4536},
577+
year={2021},
578+
publisher={ACS Publications}
579+
}
580+
570581
@article{abascal2005general,
571582
title={A general purpose model for the condensed phases of water: {{TIP4P/2005}}},
572583
author={Abascal, Jose LF and Vega, Carlos},

docs/sphinx/source/tutorial4/introduction.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ water model named TIP4P/2005 is used :cite:`abascal2005general`.
2424

2525
Four-point water models such as TIP4P/2005 are widely used as they offer a
2626
good compromise between accuracy and computational cost :cite:`kadaoluwa2021systematic`.
27-

docs/sphinx/source/tutorial4/tutorial.rst

Lines changed: 49 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ desired temperature and pressure.
88
System 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+
2634
These lines are used to define the most basic parameters, including the
2735
atom, bond, and angle styles, as well as interaction
2836
potential. Here, ``lj/cut/tip4p/long`` imposes a Lennard-Jones potential with
2937
a cut-off at :math:`12\,\text{Å}` and a long-range Coulomb potential.
3038

3139
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
3341
of ``lj/cut/tip4p/long`` instead of ``lj/cut/coul/long``, and ``pppm/tip4p``
3442
instead of ``pppm``. When using ``lj/cut/tip4p/long`` and ``pppm/tip4p``,
3543
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 ``
7078
keywords are for memory allocation. Finally, the ``labelmap`` commands assign
7179
alphanumeric type labels to each numeric atom type, bond type, and angle type.
7280

73-
7481
Now, we can add atoms to the system. First, let us create two sub-regions corresponding
7582
respectively to the two solid walls, and create a larger region from the union of the
7683
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:
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.~\ref{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-
\paragraph{Energy minimization}
286+
Energy minimization
287+
-------------------
280288

281289
Let us move the atoms and place them in more energetically favorable positions
282290
before 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
390402
variables ``walltopz`` and ``wallbotz``, i.e.~the distance between the
391403
two 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
394406
to **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
403415
between the two walls show oscillations at the start of the simulation
404416
but eventually stabilize at their equilibrium values toward
405-
the end of the simulation (Fig.~\ref{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}).
434446
Imposed shearing
435447
----------------
436448

437-
438449
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:
441458

442459
.. code-block:: lammps
443460
@@ -496,18 +513,6 @@ experience any forces from the rest of the system. Consequently, in the absence
496513
external forces, these atoms will conserve the initial velocities imposed by the
497514
two ``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-
511516
Finally, let us generate images of the systems and print the values of the
512517
forces exerted by the fluid on the walls, as given by ``f_mysf1[1]``
513518
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
551556
once at the 200,000 th step.
552557

553558
Run the simulation using LAMMPS. The averaged velocity
554-
profile for the fluid is plotted in Fig.~\ref{fig:NANOSHEAR-profiles}.
559+
profile for the fluid is plotted below.
555560
As expected for such Couette flow geometry, the fluid velocity increases
556561
linearly along :math:`z`, and is equal to the walls velocities at the fluid-solid
557562
interfaces (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+
559576
From the force applied by the fluid on the solid, one can extract the stress
560577
within the fluid, which enables the measurement of its viscosity :math:`\eta`
561578
according 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
568586
the 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.~\ref{fig:NANOSHEAR-profiles}),
588+
approximately :math:`\dot{\gamma} = 20 \cdot 10^9\,\text{s}^{-1}`,
571589
the average force on each wall is given by ``f_mysf1[1]`` and ``f_mysf2[1]``
572590
and is approximately :math:`2.7\,\mathrm{kcal/mol/Å}` in magnitude. Using a surface area
573591
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.~\eqref{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

docs/sphinx/source/tutorial5/tutorial.rst

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,6 @@ your case, depending on the location of the crack. A difference with the previo
353353
input is that three atom types are specified in the ``pair_coeff`` command, i.e.
354354
``Si O H``.
355355

356-
ADD FIGURE SIO-decorated Cracked silicon oxide after the addition of hydrogen atoms.
357-
The atoms are colored by their charges, with the newly added hydrogen atoms appearing as small
358-
greenish spheres.
359-
360356
Then, let us adapt some familiar commands to measure the charges of all three
361357
types of atoms, and output the charge values into log files:
362358

@@ -409,5 +405,18 @@ form surface groups (such as hydroxyl (-OH) groups).
409405
# Timestep No_Moles No_Specs H20O384Si192
410406
20000 1 1 1
411407
412-
At the end of the simulation, hydroxyl (-OH) groups can be seen at the interfaces
413-
(Fig.~\ref{fig:SIO-decorated}).
408+
At the end of the simulation, hydroxyl (-OH) groups can be seen at the interfaces.
409+
410+
.. figure:: figures/decorated-dark.png
411+
:class: only-dark
412+
:alt: Cracked silicon oxide after the addition of hydrogen atoms simulated using LAMMPS molecular dynamics
413+
414+
.. figure:: figures/decorated-light.png
415+
:class: only-light
416+
:alt: Cracked silicon oxide after the addition of hydrogen atoms simulated using LAMMPS molecular dynamics
417+
418+
.. container:: figurelegend
419+
420+
Cracked silicon oxide after the addition of hydrogen atoms.
421+
The atoms are colored by their charges, with the newly added hydrogen atoms appearing as small
422+
greenish spheres.

0 commit comments

Comments
 (0)