@@ -2087,43 +2087,52 @@ \subsubsection{Stretching the PEG molecule}
20872087contribution from both water and PEG molecules (it was chosen by trial and error).
20882088Then, copy the same lines as previously:
20892089{\normalsize \begin {verbatim }
2090- units real
2091- atom_style full
2092- bond_style harmonic
2093- angle_style harmonic
2094- dihedral_style harmonic
2095- pair_style lj/cut/coul/long 10
2096- kspace_style pppm 1e-5
2097- special_bonds lj 0.0 0.0 0.5 &
2098- coul 0.0 0.0 1.0 &
2099- angle yes dihedral yes
2090+ units real
2091+ atom_style full
2092+ bond_style harmonic
2093+ angle_style harmonic
2094+ dihedral_style harmonic
2095+ pair_style lj/cut/coul/long 10
2096+ kspace_style pppm 1e-5
2097+ special_bonds lj 0.0 0.0 0.5 &
2098+ coul 0.0 0.0 1.0 &
2099+ angle yes dihedral yes
21002100\end {verbatim }}
21012101Start the simulation from the equilibrated PEG-water system and include again the
21022102parameter file by adding the following lines to the \textit {input.lmp }:
21032103{\normalsize \begin {verbatim }
2104- read_data ../mergePEGH2O/mix.data
2105- include ../PARM.lmp
2104+ read_data ../mergePEGH2O/mix.data
2105+ include ../PARM.lmp
21062106\end {verbatim }}
21072107Next, let us create some useful atom groups, including H2O and PEG (as previously),
21082108as well as 2 groups containing a single atom each, the oxygen atoms at the ends
21092109of the chain. Atoms of types OAlc correspond to the hydroxy (alcohol) group oxygen
21102110atoms located at the ends of the PEG molecule, which we are going to use to pull
21112111on the PEG molecule. Add the following lines to the \textit {input.lmp }:
21122112{\normalsize \begin {verbatim }
2113- group H2O type OW HW
2114- group PEG type C CPos H HC OAlc OE
2115- group ends type OAlc
2116- variable xcm equal xcm(ends,x)
2117- variable oxies atom type==label2type(atom,OAlc)
2118- variable end1 atom v_oxies*(x>v_xcm)
2119- variable end2 atom v_oxies*(x<v_xcm)
2120- group topull1 variable end1
2121- group topull2 variable end2
2113+ group H2O type OW HW
2114+ group PEG type C CPos H HC OAlc OE
2115+ group ends type OAlc
2116+ variable xcm equal xcm(ends,x)
2117+ variable oxies atom type==label2type(atom,OAlc)
2118+ variable end1 atom v_oxies*(x>v_xcm)
2119+ variable end2 atom v_oxies*(x<v_xcm)
2120+ group topull1 variable end1
2121+ group topull2 variable end2
21222122\end {verbatim }}
2123- Add the following \textit {dump } command to the input to print the atom positions
2124- every 1000 steps:
2123+ Add the following \textit {dump } command to create images of the system:
21252124{\normalsize \begin {verbatim }
2126- dump mydmp all atom 1000 dump.lammpstrj
2125+ dump mydmp all image 1000 dump.*.ppn type &
2126+ type shiny 0.1 box no 0.01 &
2127+ view 0 90 zoom 1.8 fsaa yes bond atom 0.8
2128+ dump_modify mydmp backcolor white &
2129+ acolor OW red acolor HW white &
2130+ acolor OE red acolor OAlc red &
2131+ acolor C gray acolor CPos gray &
2132+ acolor H white acolor HC white &
2133+ adiam OW 0.2 adiam HW 0.2 &
2134+ adiam C 3 adiam CPos 3 adiam OAlc 2.8 &
2135+ adiam H 1 adiam HC 1 adiam OE 2.8
21272136\end {verbatim }}
21282137Let us use a single Nosé-Hoover thermostat applied to all the atoms by adding the
21292138following lines to \textit {input.lmp }:
@@ -2133,44 +2142,37 @@ \subsubsection{Stretching the PEG molecule}
21332142\end {verbatim }}
21342143Let us also print the end-to-end distance of the PEG,
21352144here defined as the distance between the groups \textit {topull1 }
2136- and \textit {topull2 }, as well as the temperature of the system and the gyration
2145+ and \textit {topull2 }, as well as the gyration
21372146radius of the molecule \cite {fixmanRadiusGyrationPolymer1962a }
21382147by adding the following lines to \textit {input.lmp }:
2139- % S.G.: should we keep the data file, or just use thermo custom as its better for LAMMPS-GUI?
2140- {\normalsize \begin {verbatim }
2141- variable mytemp equal temp
2142- fix myat1 all ave/time 10 10 100 &
2143- v_mytemp file temperature.dat
2144- variable x1 equal xcm(topull1,x)
2145- variable x2 equal xcm(topull2,x)
2146- variable y1 equal xcm(topull1,y)
2148+ {\normalsize \begin {verbatim }
2149+ variable x1 equal xcm(topull1,x)
2150+ variable x2 equal xcm(topull2,x)
2151+ variable y1 equal xcm(topull1,y)
21472152variable y2 equal xcm(topull2,y)
2148- variable z1 equal xcm(topull1,z)
2149- variable z2 equal xcm(topull2,z)
2150- variable delta_r equal &
2151- sqrt((v_x1-v_x2)^2+(v_y1-v_y2)^2 &
2152- +(v_z1-v_z2)^2)
2153- fix myat2 all ave/time 10 10 100 v_delta_r &
2154- file end-to-end-distance.dat
2155- compute rgyr PEG gyration
2156- fix myat3 all ave/time 10 10 100 c_rgyr &
2157- file gyration-radius.dat
2158- thermo 1000
2153+ variable z1 equal xcm(topull1,z)
2154+ variable z2 equal xcm(topull2,z)
2155+ variable delta_r equal &
2156+ sqrt((v_x1-v_x2)^2+(v_y1-v_y2)^2 &
2157+ +(v_z1-v_z2)^2)
2158+ compute rgyr PEG gyration
2159+ thermo_style custom step temp etotal v_delta_r c_rgyr
2160+ thermo 1000
21592161\end {verbatim }}
21602162Finally, let us simulate 30 picoseconds without any external forcing:
21612163{\normalsize \begin {verbatim }
2162- run 30000
2164+ run 30000
21632165\end {verbatim }}
21642166This first run will serve as a benchmark to quantify later the changes induced
2165- by the forcing. Then, let us apply a forcing on the 2 oxygen atoms using two
2167+ by the forcing. Then, let us apply a forcing on the 2 selected oxygen atoms using two
21662168\textit {add\_ force } commands, and run for an extra 30 ps:
21672169{\normalsize \begin {verbatim }
2168- fix myaf1 topull1 addforce ${f0} 0 0
2169- fix myaf2 topull2 addforce -${f0} 0 0
2170- run 30000
2170+ fix myaf1 topull1 addforce ${f0} 0 0
2171+ fix myaf2 topull2 addforce -${f0} 0 0
2172+ run 30000
21712173\end {verbatim }}
2172- Run the \textit {input.lmp } file using LAMMPS. If you open the \textit { dump.lammpstrj }
2173- file using \textit { VMD }, you should see that the PEG molecule eventually aligns
2174+ Run the \textit {input.lmp } file using LAMMPS. From the generated images of the system,
2175+ you should see that the PEG molecule eventually aligns
21742176in the direction of the force (as seen in Fig.\, \ref {fig:PEG-in-water }).
21752177The evolutions of the end-to-end distance and of the gyration radius over
21762178time show that the PEG is adjusting to the external forcing in less than
0 commit comments