1
# THIS EXAMPLE HAS NOT BEEN RIGOROUSLY TESTED.
2
# (This simulation may fail.
3
# However the "run.in.nvt" example in this directory should work.)
6
# To run this system at constant pressure, it might help to compile LAMMPS with
7
# the optional RIGID package, and use "fix rigid" on the carbon. (Optional.)
8
# The use of fix rigid is controversial. This method is demonstrated below.
10
# ------------------------------- Initialization Section --------------------
12
include system.in.init
14
# ------------------------------- Atom Definition Section -------------------
18
# ------------------------------- Settings Section --------------------------
20
include system.in.settings
22
# ------------------------------- Run Section -------------------------------
25
# Only the Cgraphene atoms are immobile.
26
group mobile subtract all Cgraphene
29
# Unfortunately you can not use the LAMMPS "minimize" command on this system
30
# because there is no way to immobilize the carbon graphene & nanotube atoms
31
# during minimization. Instead, we can use langevin dynamics with a large
32
# damping parameter and a small timestep.
34
print "--------- beginning minimization (using fix langevin) ---------"
37
fix fxlan mobile langevin 1.0 1.0 100.0 48279
38
fix fxnve mobile nve # <-- needed by fix langevin (see lammps documentation)
45
# -- simulation protocol --
47
print "--------- beginning simulation (using fix nvt) ---------"
50
dump 1 all custom 1000 traj_npt.lammpstrj id mol type x y z ix iy iz
52
thermo_style custom step temp pe etotal press vol epair ebond eangle edihed
53
thermo 1000 # time interval for printing out "thermo" data
59
# ------------------------- NPT ---------------------------
61
# Set temp=300K, pressure=100bar, and equilibrate volume only in the z direction
63
fix fxMoveStuff mobile npt temp 300 300 100 z 100 100 1000.0 dilate mobile
65
# ------ QUESTIONABLE (see below): ------
67
fix Ffreezestuff Cgraphene rigid/npt single temp 300 300 100 z 100 100 1000.0 force * off off off torque * off off off dilate mobile
69
# -- Alternate npt rigid method --
70
# I'm not sure which way is more correct, however
71
# this also seems to behave in a reasonable-looking way:
72
#fix Ffreezestuff Cgraphene rigid single force * off off off torque * off off off
74
# The use of either "fix rigid" or "fix rigid/npt" to immobilize
75
# an object is somewhat controversial. Feel free to omit it.
76
#(Neither Trung or Steve Plimpton use rigid or rigid/npt for immobilizing
77
#molecules, but I noticed that at NPT, it does a better job of maintaining
78
# the correct volume. However "fix rigid" has changed since then (2011),
79
# so this may no longer be true. Please use this example with caution.)
80
# ----------------------------------------
82
# IMPORTANT for NPT: You must use "neigh_modify" to turn off calculation of the
83
# forces between immobilized atoms.
84
neigh_modify exclude group Cgraphene Cgraphene
86
# The next two lines recalculate the temperature
87
# using only the mobile degrees of freedom:
89
compute tempMobile mobile temp
90
compute pressMobile all pressure tempMobile
92
thermo_style custom step c_tempMobile c_pressMobile temp press vol
94
fix_modify fxMoveStuff temp tempMobile
98
write_data system_after_npt.data
100
# (The "write_restart" and "read_restart" commands were buggy in 2012,
101
# but they should work also.)