Skip to content

Commit 72b3b35

Browse files
committed
started cleaning tutorial 7
1 parent 0805df1 commit 72b3b35

3 files changed

Lines changed: 70 additions & 11 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
variable sigma equal 3.405
3+
variable epsilon equal 0.238
4+
variable U0 equal 2*${epsilon}
5+
variable dlt equal 0.5
6+
variable x0 equal 5.0
7+
8+
units real
9+
atom_style atomic
10+
pair_style lj/cut 3.822
11+
pair_modify shift yes
12+
boundary p p p
13+
14+
region myreg block −25 25 −5 5 −25 25
15+
create_box 1 myreg
16+
create_atoms 1 random 200 34134 myreg overlap 1.5 maxtry 50
17+
18+
mass * 39.95
19+
pair_coeff * * ${epsilon} ${sigma}
20+
neigh_modify every 1 delay 4 check yes
21+
22+
minimize 1e−4 1e−6 100 1000
23+
reset_timestep 0
24+
25+
variable U atom ${U0}*atan((x+${x0})/${dlt})-${U0}*atan((x−${x0})/${dlt})
26+
variable F atom ${U0}/((x−${x0})^2/${dlt}^2+1)/${dlt}-${U0}/((x+${x0})^2/${dlt}^2+1)/${dlt}
27+
fix myadf all addforce v_F 0.0 0.0 energy v_U
28+
29+
fix mynve all nve
30+
fix mylgv all langevin 119.8 119.8 50 1530917
31+
32+
region mymes block −${x0} ${x0} INF INF INF INF
33+
variable n_center equal count(all,mymes)
34+
thermo_style custom step temp etotal v_n_center
35+
thermo 10000
36+
37+
dump viz all image 50000 myimage−*.ppm type type &
38+
shiny 0.1 box yes 0.01 view 180 90 zoom 7 size 1600 400
39+
dump_modify viz backcolor white acolor 1 cyan adiam 1 1 boxcolor black
40+
41+
timestep 2.0
42+
run 500000
43+
reset_timestep 0
44+
45+
compute cc1 all chunk/atom bin/1d x 0.0 1.0
46+
fix myac all ave/chunk 10 400000 4000000 cc1 density/number file density_profile.dat
47+
48+
run 4000000

journal-article.bib

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,3 +757,14 @@ @article{della1992molecular
757757
year={1992},
758758
publisher={American Institute of Physics}
759759
}
760+
761+
@article{loche2022molecular,
762+
title={Molecular dynamics simulations of the evaporation of hydrated ions from aqueous solution},
763+
author={Loche, Philip and Bonthuis, Douwe J and Netz, Roland R},
764+
journal={Communications Chemistry},
765+
volume={5},
766+
number={1},
767+
pages={55},
768+
year={2022},
769+
publisher={Nature Publishing Group UK London}
770+
}

lammps-tutorials.tex

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3540,30 +3540,30 @@ \subsection{Tutorial 7: Free energy calculation}
35403540
\end{figure}
35413541

35423542
\noindent The objective of this tutorial is to measure the free energy profile
3543-
of particles across a barrier potential using two methods: free sampling and
3543+
of particles through a barrier potential using two methods: free sampling and
35443544
umbrella sampling \cite{kastner2011umbrella, allen2017computer, frenkel2023understanding} (Fig.\,\ref{fig:US}).
3545-
For simplicity and to reduce computation time, the barrier potential will be
3546-
imposed on the atoms with an additional force, mimicking the presence of a repulsive
3547-
area in the middle of the simulation box without the need to simulate extra atoms.
3545+
To simplify the process and minimize computation time, the barrier potential will be
3546+
imposed on the atoms using an additional force, mimicking the presence of a repulsive
3547+
area in the middle of the simulation box without needing to simulate additional atoms.
35483548
The procedure is valid for more complex systems and can be adapted to many other
3549-
situations, such as measuring the adsorption barrier near an interface, or for
3550-
calculating a translocation barrier through a membrane
3551-
\cite{wilson1997adsorption, makarov2009computer, gravelle2021adsorption}.
3549+
situations, such as measuring adsorption barriers near an interface or calculating
3550+
translocation barriers through a membrane
3551+
\cite{wilson1997adsorption, makarov2009computer, gravelle2021adsorption, loche2022molecular}.
35523552

35533553
\subsubsection{Method 1: Free sampling}
35543554
The most direct way to calculate a free energy profile is to extract the partition
35553555
function from a classical (i.e.~unbiased) molecular dynamics simulation, and
3556-
then estimate the Gibbs free energy using
3556+
then estimate the Gibbs free energy by using
35573557
\begin{equation}
35583558
\Delta G = -RT \ln(p/p_0),
35593559
\label{eq:G}
35603560
\end{equation}
35613561
where $\Delta G$ is the free energy difference, $R$ is the gas constant, $T$
35623562
is the temperature, $p$ is the pressure, and $p_0$ is a reference pressure.
3563-
As an illustration, let us apply this method to an extremely simple configuration
3563+
As an illustration, let us apply this method to a simple configuration
35643564
that consists of a few particles diffusing in a box in the presence of a
3565-
position-dependent repelling force that makes the center of the box a relatively
3566-
unfavorable area to explore.
3565+
position-dependent repulsive force that makes the center of the box a less
3566+
favorable area to explore.
35673567

35683568
\paragraph{Basic LAMMPS parameters}
35693569
\noindent Create a folder called \textit{FreeSampling/}, and create an input

0 commit comments

Comments
 (0)