Strange Behavior in Visualization of NVT steps

Hi Lammps-Users,

I apologize if this ends up being a relatively simple error, but I’ve spent several hours trying to debug my lammps input script to help explain why this behavior is occurring but being relatively new and self taught in lammps I could not figure out what is happening…
In short, my system is a relatively simple piston aligned with the Z axis that pushes salted water through a carbon nanotube acting as a reverse osmosis membrane. On both sides of the CNT are two water boxes (one salted one pure). I’ve successfully went through both the minimization steps and heated the system to room temperature without any strange behavior I can see when visualizing in VMD, however when I reach a stage where I perform NVT dynamics and visualize the output in VMD, for some reason the piston just freezes despite having a fix aveforce applied to it in the z direction. During the equilibrium step just to debug I applied the same piston movement which when visualized works just fine in heating but the same force application doesn’t move the piston in the NVT steps and in addition I’ve upped the applied aveforce value to various high values just to see if it was a matter of not applying enough pressure but to no avail, the piston remained frozen. The heating step and dynamics steps of my input script is below and any help is very much appreciated.

print .
print =====================================
print “NVT dynamics to heat system”
print =====================================
print .
reset_timestep 0
#Applies walls on far side of piston to prevent leaving system boundry in the z direction
fix zwallhi piston2 wall/lj126 zhi EDGE 1.0 1.0 2.0
fix zwalllo piston1 wall/lj126 zlo EDGE 1.0 1.0 2.0

#sets pistons force in x and y to 0 allowing only movement in Z
fix pistonkeep bothpistons setforce 0.0 0.0 NULL

#applies force to top and bottom piston in the Z
fix piston2thrust piston2 aveforce NULL NULL -0.02
fix piston1thrust piston1 aveforce NULL NULL 0.01

timestep .5

fix shakeH water shake 0.0001 20 500 m 1.0079 a 1
fix nvtequilib target_thermostat nvt temp 1.0 {rtemp} 100.0 #fix restraint solute spring/self 10.0 velocity all create 0.0 12345678 dist uniform thermo 1000 thermo_style multi dump 1 all custom 1000 {sname}.heat.lammpstrj id type xu yu zu vx vy vz

#fix 4 solvent nvt temp 1.0 ${rtemp} 100.0
dump equilibdump not_hy atom 1000 equil.nothy.lammpstrj
run 50000
unfix nvtequilib
#unfix 4
undump 1
undump equilibdump
#unfix restraint
unfix piston1thrust
unfix piston2thrust
#unfix zwallhi
#unfix zwalllo

print .
print ================================================
print "NVT production dynamics "
print ================================================
print .

#fix piston1push piston1 aveforce NULL NULL .5
fix piston2push piston2 aveforce NULL NULL -1.0
variable num_feed_waters equal “count(ox,cntzone)”
variable num_feed_na equal “count(na,cntzone)”
variable num_feed_cl equal “count(cl,cntzone)”

#fix 2 target_thermostat nvt temp {rtemp} {rtemp} 100.0 tloop 10 ploop 10
fix dynamnvt target_thermostat nvt temp {rtemp} {rtemp} 100
thermo 1000

restart 50000 {sname}.{rtemp}K.*.restart
thermo_style custom step temp etotal vol press v_num_feed_waters v_num_feed_na v_num_feed_cl
thermo_modify line multi
dump 1 all custom 1000 {sname}.{rtemp}K.prod.lammpstrj id type xu yu zu vx vy vz
dump dynamics all atom 500 dynamics.lammpstrj
run 125000

I apologize if this ends up being a relatively simple error, but I've spent several hours trying to debug my lammps input script

"several hours"?
malevolent laughter

to help explain why this behavior is occurring but being relatively new and self taught
in lammps I could not figure out what is happening...
In short, my system is a relatively simple piston aligned with the Z axis that pushes
salted water through a carbon nanotube acting as a reverse osmosis membrane.
On both sides of the CNT are two water boxes (one salted one pure). I've
successfully went through both the minimization steps and heated the system
to room temperature without any strange behavior I can see when visualizing
in VMD, however when I reach a stage where I perform NVT dynamics and
visualize the output in VMD, for some reason the piston just freezes despite
having a fix aveforce applied to it in the z direction.

Generally, when weird stuff is happening, I recommend making the
system simpler until the problem goes away. (For example, try getting
rid of the water molecules, or the immobile walls (fix wall),
everything but the piston and see if the problem persists. This can
be an exhausting process, but it will usually help you find what you
did wrong.

However since you already have a protocol which is working, why not
use it? (see below...)

During the equilibrium step just to debug I applied the same piston movement which when visualized works just fine in heating

If that protocol was working, why not use it for the next step as well?

To save time, I suggest breaking this simulation into multiple simulations.
One for minimization,
one for heating,
one for allowing the piston to move.

At the end of each simulation, use the "write_data" command, and at
the beginning of the next one, use the "read_data" command.

For the last simulation, use the same protocol you used for heating.
(Just replace the starting temperature "1.0" with ${rtemp}, so that it
is a constant temperature simulation instead of a heating simulation.)

I suggest that at the end of the heating step, use the "write_data"
command to save the state of the system.

My apologies for being too lazy to scrutinize your input script.

Don't know if this was helpful.
But headaches like this are totally normal.

Andrew