[lammps-users] (no subject)

Hi Steve,

What is the difference between “fix enforce2d” and “velocity set x y z NULL NULL 0” to simulate a 2D system in a NVT ensemble?

Sincerely,

Dongsheng

The former zeroes force and velocity every step. The latter only
initializes velocity.

Steve

Hi Steve,

Thank you for your reply. When I use the dump command to output z, fz, and vz, they are all zeros by these two methods (fix enfore2d and velocity set x y z NULL NULL 0). If the latter one just initializes vz of all particles, why they keep zero all the time. By the way, I put the latter command before AND after fix nvt command.

Dongsheng

Hi Steve,

I got the same result by using " fix 2 all setforce NULL NULL 0" and “velocity set x y z NULL NULL 0”, which is different from the result of “fix enforce2d”. However, all methods give me zero value of fz, vz, z. Could you please tell me the difference between them and double check if “velocity set x y z NULL NULL 0” only initially set vz=0 or it updates every step? Thanks!

Dongsheng

The velocity command does not re-zero the velocities
every step. If your system is 2d, then there will be
no z forces, hence no z velocities. However, you may
get some small ones over time. Hence use fix enforce2d.

Steve