Moving wall using fix wall/lj93

Dear LAMMPS users

I am trying to use the fix wall/lj93 command to simulate a mean field wall at one end of my simulation system. Since I am using an NPT ensemble, I wonder how to simulate a wall potential that could movfe with the boudnary of the system like a piston. I have tried to use EDGE as the position of the wall. But the wall will not move at all. If I use a variable as the position of the wall is variable, The problem is that I don’t know what variable to use to represent the boundary of the system. Thanks.

Bests,

Han Hu

Complex Fluids and Multiphase Transport Lab
Mechanical Engineering and Mechanics Department
Drexel University
Hess Engineering Research Laboratories
hh398@…1685…, edenkira@…92…

Dear LAMMPS users
I am trying to use the fix wall/lj93 command to simulate a mean field wall
at one end of my simulation system. Since I am using an NPT ensemble, I
wonder how to simulate a wall potential that could movfe with the boudnary
of the system like a piston. I have tried to use EDGE as the position of the

if you want a piston-like system, you must not use fix npt.

wall. But the wall will not move at all. If I use a variable as the position
of the wall is variable, The problem is that I don't know what variable to
use to represent the boundary of the system. Thanks.

what boundary? it is not clear what you mean by this. can you reformulate?

axel.

You could use an explicit wall (made of atoms) as a pressure piston by
applying a force to the wall atoms (pressure times wall surface)
through fix addforce or fixaveforce. "Mean field" walls such as fix
wall/lj93 cannot be used this way currently in lammps: they do not own
a mass, and you cannot apply a given force on them.

Best regards,
Laurent

Dear Alex,

Thanks for your response.

if you want a piston-like system, you must not use fix npt.
I wonder how I could simulate a piston-like system. I was thinking about using fix npt because the function of a piston, in my opinion, is to keep the pressure of the system in one direction.

what boundary? it is not clear what you mean by this. can you reformulate?
I want to put the wall potential at one boundary of the simulation system (e.g. the top boundary in z direction, zhi). Since I want to keep the pressure in z direction constant, the size of the system in z direction may change and the top boundary of the system in z direction will move during the simulation. I wonder how to make the position of the wall potential changes as the top boundary of the system. Thanks.

Bests,

Han Hu

Dear Laurent,

Thanks for your response! I will try your suggestion immediately. Thanks.

Bests,

Han Hu

Dear Alex,

Thanks for your response.

if you want a piston-like system, you must not use fix npt.

I wonder how I could simulate a piston-like system. I was thinking about
using fix npt because the function of a piston, in my opinion, is to keep
the pressure of the system in one direction.

but that would be the job of the piston model, *not* the integrator
(unless you want to use periodic boundaries in the flexible dimension.
please also note that fix npt by default dilates a system homogeneously,
which is not consistent with the model of a piston-like environment.

what boundary? it is not clear what you mean by this. can you reformulate?

I want to put the wall potential at one boundary of the simulation system
(e.g. the top boundary in z direction, zhi). Since I want to keep the
pressure in z direction constant, the size of the system in z direction may
change and the top boundary of the system in z direction will move during
the simulation. I wonder how to make the position of the wall potential
changes as the top boundary of the system. Thanks.

a piston model has a specific dynamic and pressure/density fluctuations
that are different from what an npt integrator provides, *independent*
from maintaining a constant pressure. you have to make up your mind
first, what it is exactly that you want to model and then decide how
to realize it.

laurent's suggestion is probably closer to what you want
(and doesn't need fix npt either).

axel.

Two additional suggestions:

a) There is a fix wall/piston command in the SHOCK package
you can look at.

b) The fix wall commands like fix wall/harmonic allow
a variable to be specified for their position. They also
store the force exerted by atoms on the wall. So you
could write a simple equation that time-varied the position
of the wall as a function of the force on the wall if you choose to.

Steve

Han,
The attached input file has an example as suggested by Laurent on
using the fix aveforce to model
the wall of atoms working as a piston. Look for the "fix compression"
and "fix uncompression lines" within the file. I used this file (with
the data file also attached) to create a while ago the "RECREATIONAL"
movie that shows in the link added below.

www.apmaths.uwo.ca/~ccampana/Dec_2_seminar/atomic_spill.mpg

Now, this is not personal blurb but just to enforce my previous
suggestion on how a database of Lammps scripts could help us all save
time while aiding with the learning process.
Carlos

in.glass (4.71 KB)

Hexene.opls_new.dat (5.65 KB)

Dear All,

Thanks for all your advice. And I appreciate Carlo’s idea on a database of Lammps scripts.

I am still thinking about using a mean field wall and move the all during the simulations. As I learned from Navak et al. 2008 (highlighted in the attached), they made it to move the position of a mean field wall in MD simulations. In their paper, the simualtion system consists of a liquid layer on a solid substrate. A mean field potential (9-3 L-J type potential) is set above the liquid and the position of the wall is adjusted during the simulation to keep a constant pressure in z direction. The procedures are as following,

Step 1. They calculate the sum of the forces per area on the mean field wall as the pressure in z direction (Pzz).
Step 2. The pressure in z direction is controlled by changing the acceleration of the wall using a proportional-integral controlled with the integral evaluated using a trapezoid approximation. Since the wall is introduced to keep a constant pressure in z direction, a set value of pressure in z direction is defined before simulation starts. Whenever the Pzz deviates from the set value, the acceleration of the wall could be calculated.
Step 3. The wall position is then calculated with a velocity Verlet algorithm using the acceleration calculated in step 2.

I wonder whether this procedure is feasible just using the commands of LAMMPS, or I should write an additional code to realize this function. Thanks for your time and help!

Bests,

Han Hu

Novak_PRB_2007.pdf (454 KB)

You would need to write your own fix to do that.

Steve