how to setup velocity inlet boundary condition in lammps

Hi all Lammps users,
I want to setup velocity inlet boundary condition in Lammps, similar to the topics raised by Shankar Subramaniam about “uniform velocity” in this June and Auguest.
The question is simple, for example, I want to study the flow past a sphere. I can use the “fix addforce” command to drive the liquid flow along the channel. But two questions raise. First, if I use the periodic boundary condition in the flow direction, the liquid before the sphere will be affected by the “wake flow” of the sphere due to the periodic condition, even I enlarge the distance. Second, I want to set the macro velocity of liquid at inlet, but it can not be done using “fix addforce”.
This problem can be handled easily in my mind. For example, in periodic boundary condition, when an atom move out of the box (e.g. x_atom > x_max), the atom will reenter into the box at a_min. The velocity of the reenter atom can be set according to the inlet temperature and then an additional macro velocity can be added to vx.
But there is some questions to do this in Lammps. First, how to recognize the atoms enter into the box from x_min. Second, at what frequency should this process be repeated. Third, is it appropriate to setup a small region of box to stand for a reservoir and in this region, the velocity are reset every timestep.
Is there anyone who have done this or similar problems before? Looking forward to your reply. Thank you very much.

Regards.
Fubing

Hi,

look at fix append/atoms. Maybe it'll be ok in your case to just add atoms repeatedly on one side of the box and remove it from another. The problem is that fix adds atoms in lattice nodes, so achieving needed (liquid) conditions may be tricky.

Oleg.

09.10.2013, 17:32, "Fubing BAO" <[email protected]...>:

Hi all Lammps users,
    I want to setup velocity inlet boundary condition in Lammps, similar to
the topics raised by Shankar Subramaniam about "uniform velocity" in this
June and Auguest.
    The question is simple, for example, I want to study the flow past a
sphere. I can use the "fix addforce" command to drive the liquid flow along
the channel. But two questions raise. First, if I use the periodic boundary
condition in the flow direction, the liquid before the sphere will be
affected by the "wake flow" of the sphere due to the periodic condition,
even I enlarge the distance.

you can dampen that out through using fix langevin on a given region
there, if you use a sufficiently short time constant. that will add
quite a bit of friction and random noise.

Second, I want to set the macro velocity of
liquid at inlet, but it can not be done using "fix addforce".

true, but since you can simply adjust the added force until you get a
steady state at the desired velocity.

    This problem can be handled easily in my mind. For example, in periodic
boundary condition, when an atom move out of the box (e.g. x_atom > x_max),
the atom will reenter into the box at a_min. The velocity of the reenter
atom can be set according to the inlet temperature and then an additional
macro velocity can be added to vx.

in my opinion, that is far too complex and not worth the effort. you
have to remember that simulations do not have to exactly be "operated"
like experiments, but you need to achieve a state, where you can
extract the same information. that often may result in different
approaches. with a simulation, you have ways to interact with a
system, that are not accessible for experiments.

    But there is some questions to do this in Lammps. First, how to
recognize the atoms enter into the box from x_min. Second, at what frequency
should this process be repeated. Third, is it appropriate to setup a small
region of box to stand for a reservoir and in this region, the velocity are
reset every timestep.

to make the continuous addition of boxes of (pre-equilibrated) atoms
work, you have to add them "frozen" and then "thaw" them. that has to
be done in a very similar fashion as you can dampen out the turbulence
from letting the same atoms return to the inlet via PBC.

the problem with shankar was, that he was dead set on doing things in
a very complicated way and didn't want to realize that all those
complications are not really necessary and create more problems than
they solve.

axel.