Skip to content

Commit f0195ce

Browse files
committed
cleaned tutorials 4
1 parent 519dee7 commit f0195ce

File tree

1 file changed

+45
-43
lines changed

1 file changed

+45
-43
lines changed

docs/sphinx/source/tutorials/level2/nanosheared-electrolyte.rst

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,10 @@ System generation
337337
338338
.. container:: justify
339339

340-
To avoid high density and pressure,
341-
let us add the following lines to *input.lammps*
342-
to delete a few of the water molecules:
340+
As it is now, the fluid density within the two walls is too high.
341+
To avoid high density and pressure, let us add the following lines
342+
to *input.lammps* to delete about :math:`15~\%`
343+
of the water molecules:
343344

344345
.. code-block:: lammps
345346
@@ -434,7 +435,9 @@ Energy minimization
434435
in more energetically favorable positions before starting the simulation.
435436
Let us call this step *energy minimization*, although it is not
436437
a conventional *minimization* as done for instance
437-
in tutorial :ref:`lennard-jones-label`.
438+
in tutorial :ref:`lennard-jones-label`. Instead, a molecular dynamics simulation
439+
will be performed here, with some techniques employed to prevent the system
440+
from exploding due to overlapping atoms.
438441

439442
.. container:: justify
440443

@@ -460,7 +463,7 @@ Energy minimization
460463
461464
.. container:: justify
462465

463-
The only difference with the previous input is that, instead
466+
The only difference from the previous input is that instead
464467
of creating a new box and new atoms, we open the
465468
previously created file *system.data* located in *systemcreation/*.
466469
The file *system.data* contains the definition of the simulation box
@@ -469,7 +472,7 @@ Energy minimization
469472
.. container:: justify
470473

471474
Now, let us create a first simulation step using a relatively small
472-
timestep (:math:`0.5\,\text{fs}`), as well as a low temperature
475+
timestep (:math:`0.5\,\text{fs}`) and a low temperature
473476
of :math:`T = 1\,\text{K}`:
474477

475478
.. code-block:: lammps
@@ -481,22 +484,25 @@ Energy minimization
481484
482485
.. container:: justify
483486

484-
Just like *fix nve*, the fix *nve/limit* performs constant NVE integration to
485-
update positions and velocities of the atoms at each
486-
timestep, but also limits the maximum distance atoms can travel at
487-
each timestep. Here, only the fluid molecules and ions will move.
487+
Just like *fix nve*, the *fix nve/limit* command performs constant NVE integration to
488+
update the positions and velocities of the atoms at each
489+
timestep. The difference is that *fix nve/limit* also limits the maximum
490+
distance atoms can travel at each timestep. The chosen maximum distance in
491+
:math:`0.1~\text{Å}`. Because the *fix nve/limit* is applied to the group *fluid*,
492+
only the water molecules and ions will move.
488493

489494
.. container:: justify
490495

491496
The *fix temp/berendsen* rescales the
492497
velocities of the atoms to force the temperature of the system
493-
to reach the desired value of 1 K, and the SHAKE algorithm
498+
to reach the desired value of :math:`1~\text{K}`, and the SHAKE algorithm
494499
is used in order to maintain the shape of the water molecules.
495500

496501
.. container:: justify
497502

498-
Let us also print the atom positions in a *.lammpstrj* file by
499-
adding the following line into *input.lammps*:
503+
Let us also print the atom positions in a *.lammpstrj* file
504+
and control the printing of thermodynamic outputs by
505+
adding the following lines to *input.lammps*:
500506

501507
.. code-block:: lammps
502508
@@ -515,7 +521,7 @@ Energy minimization
515521
.. container:: justify
516522

517523
In order to better equilibrate the system, let us perform
518-
two additional steps with a larger timestep and a larger
524+
two additional steps with a larger timestep and a higher
519525
imposed temperature:
520526

521527
.. code-block:: lammps
@@ -534,7 +540,7 @@ Energy minimization
534540
535541
.. container:: justify
536542

537-
For the last of the 3 steps, fix *nve* is used instead of
543+
For the last of the three steps, fix *nve* is used instead of
538544
*nve/limit*, which will allow for a better relaxation of the
539545
atom positions.
540546

@@ -555,8 +561,9 @@ Energy minimization
555561

556562
.. container:: figurelegend
557563

558-
Figure: Energy as a function of time extracted from the log
559-
file using *Python* and *lammps_logfile*.
564+
Figure: Total energy of the system :math:`E_\text{tot}` as a function of
565+
time :math:`t` extracted from the log
566+
file using *Python* and *lammps_logfile*. The vertical dashed lines demarcate the three consecutive steps.
560567

561568
.. container:: justify
562569

@@ -568,7 +575,7 @@ System equilibration
568575

569576
.. container:: justify
570577

571-
Now, let us equilibrate further the entire system by letting both
578+
Let us equilibrate further the entire system by letting both
572579
fluid and piston relax at ambient temperature.
573580

574581
.. container:: justify
@@ -592,12 +599,6 @@ System equilibration
592599
include ../PARM.lammps
593600
include ../GROUP.lammps
594601
595-
.. container:: justify
596-
597-
Finally, let us complete the *input.lammps* file:
598-
599-
.. code-block:: lammps
600-
601602
fix mynve all nve
602603
fix myber all temp/berendsen 300 300 100
603604
fix myshk H2O shake 1.0e-4 200 0 b 1 a 1
@@ -648,7 +649,7 @@ System equilibration
648649
.. container:: justify
649650

650651
As seen from the data printed by *fix myat1*,
651-
the distance :math:`\delta_z` between the two walls
652+
the distance between the two walls
652653
reduces until it reaches an equilibrium value.
653654

654655
.. figure:: ../figures/level2/nanosheared-electrolyte/equilibration-light.png
@@ -669,17 +670,17 @@ System equilibration
669670

670671
Note that it is generally recommended to run longer equilibration.
671672
Here, for instance, the slowest
672-
process in the system is probably the ionic diffusion. Therefore the equilibration
673+
process in the system is probably the ionic diffusion. Therefore, the equilibration
673674
should in principle be longer than the time
674675
the ions need to diffuse over the size of the pore
675-
(:math:`\approx 1.2\,\text{nm}`), i.e. of the order of half a nanosecond.
676+
(:math:`\approx 1.2\,\text{nm}`), i.e. on the order of half a nanosecond.
676677

677678
Imposed shearing
678679
================
679680

680681
.. container:: justify
681682

682-
From the equilibrated configuration, let us impose a laterial
683+
From the equilibrated configuration, let us impose a lateral
683684
motion to the two walls and shear the electrolyte.
684685
In a new folder called *shearing/*,
685686
create a new *input.lammps* file that starts like the previous ones:
@@ -719,10 +720,10 @@ Imposed shearing
719720
720721
.. container:: justify
721722

722-
One difference here is that two thermostats are used,
723+
One difference with the previous input is that, here, two thermostats are used,
723724
one for the fluid (*myber1*) and one
724725
for the solid (*myber2*). The use of *fix_modify* together
725-
with *compute* ensures that the right temperature value
726+
with *compute temp* ensures that the right temperature value
726727
is used by the thermostats.
727728

728729
.. container:: justify
@@ -735,14 +736,14 @@ Imposed shearing
735736
.. container:: justify
736737

737738
Then, let us impose the velocity of the two walls
738-
by adding the following command to *input.lammps*:
739+
by adding the following commands to *input.lammps*:
739740

740741
.. code-block:: lammps
741742
742-
fix mysf1 walltop setforce 0 NULL NULL
743-
fix mysf2 wallbot setforce 0 NULL NULL
744-
velocity wallbot set -2e-4 NULL NULL
745-
velocity walltop set 2e-4 NULL NULL
743+
fix mysf1 walltop setforce 0 NULL NULL
744+
fix mysf2 wallbot setforce 0 NULL NULL
745+
velocity wallbot set -2e-4 NULL NULL
746+
velocity walltop set 2e-4 NULL NULL
746747
747748
.. container:: justify
748749

@@ -789,13 +790,14 @@ Imposed shearing
789790
790791
.. container:: justify
791792

792-
Here, a binning of :math:`1\,\text{Å}` is used. For smoother
793-
profiles, you can reduce its value.
793+
Here, a binning of :math:`1\,\text{Å}` is used for the density profiles
794+
generated by the *ave/chunk* commands. For smoother profiles, you can
795+
reduce its value.
794796

795797
.. container:: justify
796798

797799
The averaged velocity profile of the fluid
798-
can be plotted. As expected here, the velocity
800+
can be plotted. As expected for such Couette flow geometry, the velocity
799801
of the fluid is found to increase linearly along :math:`z`.
800802

801803
.. figure:: ../figures/level2/nanosheared-electrolyte/shearing-light.png
@@ -828,13 +830,13 @@ Imposed shearing
828830
.. container:: justify
829831

830832
From the force applied by the fluid on the solid, one can
831-
extract the stress within the fluid, which allows one to
832-
measure its viscosity :math:`\dot{\eta}`
833+
extract the stress within the fluid, which allows for the measurement of
834+
its viscosity :math:`\dot{\eta}`
833835
according to |reference_gravelle2021|:
834836
:math:`\eta = \tau / \dot{\gamma}` where :math:`\tau`
835837
is the stress applied by the fluid on the shearing wall, and
836838
:math:`\dot{\gamma}` the shear rate (which is imposed
837-
here) :cite:`gravelle2021violations`. Here the shear rate
839+
here) :cite:`gravelle2021violations`. Here, the shear rate
838840
is approximatively :math:`\dot{\gamma} = 16 \cdot 10^9\,\text{s}^{-1}`,
839841
and using a surface area of :math:`A = 6 \cdot 10^{-18}\,\text{m}^2`, one
840842
gets an estimate for the shear viscosity for the confined
@@ -853,8 +855,8 @@ Imposed shearing
853855

854856
.. container:: justify
855857

856-
Another important point is that the viscosity of a fluid next to a solid surface is
857-
typically larger than in bulk due to interaction with the
858+
Another important point to keep in mind is that the viscosity of a fluid
859+
next to a solid surface is typically larger than in bulk due to interaction with the
858860
walls. Therefore, one expects the present simulation to return
859861
a viscosity that is slightly larger than what would
860862
be measured in the absence of a wall.

0 commit comments

Comments
 (0)