trouble using fix wall/region command

Dear all
I want to model fluid flow passing throgh a tube, when the lefthandside and the righthandside of the tube is fluid reservior. (In fact, the geometry consists of two blocks connected by a tube)
I want to use wall model for tube.( by use of fix wall/region command) here is my input script:

dimension 3

boundary p p p

create geometry

lattice fcc 0.7

region simbox block 0 10 0 10 0 10

region wallbox block 4 6 0 10 0 10

region wallbox2 block 3.6 5.6 0 10 0 10

region cylinderout cylinder x 5 5 3 4 6 side out

region cylinderout2 cylinder x 5 5 3.2 3.8 5.8 side out

region wallout1 intersect 2 wallbox cylinderout side out

region wallout2 intersect 2 wallbox2 cylinderout2 side out

region flowreg intersect 2 simbox wallout1

create_box 1 simbox

create_atoms 1 region flowreg

mass 1 1.0

LJ potentials

pair_style lj/cut 2.5

pair_coeff * * 1.0 1.0 2.5

define groups

group flow region flowreg

fix smothwall1 flow wall/region wallout2 lj93 1 1.0 1

initial velocities

compute mobile flow temp

velocity flow create 1 90000 temp mobile

fix 1 all nve

#Poiseuille flow

fix 33 flow temp/rescale 1 1 1 .01 1

fix 22 flow addforce 1 0.0 0.0

timestep 0.001

thermo 1000

thermo_style custom step temp atoms

thermo_modify temp mobile

#dump 2 all xyz 500 ljsmoth.xyz

run 3000000

If you run the code above you see “lost atom ERROR”. i tried diffrent “timesteps” and “boundary conditions” and “epsilon” and “cutoffs” But the Error remained.

in some cases because of going atoms inside of the “wallout2 region” another Error is appeared.

how can i solve the problem?

Thanks in advance

regards

mahdi

Did you read carefully and follow the IMPORTANT NOTE
guidelines on the fix wall/region doc page?

Steve

hi Steve
doc page says:" As a general rule you should not use the fix wall/region command with union or interesect regions that have convex points or edges"
then how can we use a curved surface as wall model in Lammps? For example can you tell me, how can one model fluid flow through a single tube while the wall is the side area (or lateral area) of the cylinder( = tube)? ( fluid enters from one end of the tube and exists from other one)

A single region cylinder should suffice?

Steve

what do you mean by “A single region cylinder should suffice?”?
No, i want to model fluid flow throw a cylinder while the silinder lateral area is the wall of the tube (wall model i mean not setting atoms as a wall). and flow enters from one end of the sylinder and exits from other end. I know that atoms should not be on wall surfaces or in the wall so i have to use a thinner sylinder to set atoms in it. But when i use the thicker sylinder as wall (by use of fix wall/region) and applying a force to each atom (by use of fix addforce) no Fluid flux observed because i can Not exclude the two ends of my cylinder from beeing wall. i mean the two ends of the sylinder acts as wall and the atoms could not pass throgh it But i want the ends of the sylinder to acts as entering and existing faces. How can i solve this problem?
Here is a part of my input script commands:

Try visualize your system. I ran your input with a timestep decreased
10 times smaller, and the system fell apart in as short as 1000 steps.
  It seems you don't even have a stable structure, not to mention
observing anything physically meaningful.

Ray

Oh dear Steve i get your purpose.
i have to make two cylinders one thicker from the other and subtract the thinner from the thicker and use the result as a region in “fix wall/region” command. i did this method and it worked successfully.

But the main problem still exists. as you know, i want to have two reservoirs before and after the entrance and exist section of my cylinder. if i use the above method (i.e. subtracing two cylinders to have a wall) i still have the sharp corner problem. i.e. as DOC page says atoms will feel strong forces and will lost. Is there any idea to solve this problem?

I'm somewhat confused why people use the "fix wall" commands. There
are alternatives.
Although I don't know the details about your system, I have a general comment.

If you are having difficulty with the "fix wall" commands, why don't
you create a data file containing atoms arranged in a tube shape, and
immobilize them. You can immobilize any group of atoms by not
including them in the group of atoms you pass to fix nvt or fix npt.
This way, you can give the container boundaries any shape you want
(and the force between them and the fluid atoms can be anything you
want). You can run your simulations at NVT or NPT conditions and you
don't have to worry about odd behavior at the boundaries.

I made a "Translocation of a Short Polymer Through a Pore" example to
show how to do this:
http://www.moltemplate.org/examples/translocation/run.in.npt
http://www.moltemplate.org/images/translocation/walls.jpg
http://www.moltemplate.org/images/translocation/walls+solvent+polymer_t=0.jpg

This example has flat walls, but I can post an example how to make a
tube-like container if you like.
(The purpose of this web page was to show of "moltemplate", so the
data file for this system is in LT format. If it's a problem, I can
send you the data file.)

Cheers
Andrew

Dear Andrew
Thank you very much for your answer and kindness.
But i don’t want to use immobilized atoms as wall. I want to use “wall model” i.e. smooth wall without roughness.
In my knowledge, the only way to model curved surfaces as wall is using “fix wall/region command”.
there is a difficulty: please see the attached pic. it is my simulation geometry. i want to have fluid flow from left container to the right through a 3D tube. the red lines in the pic show walls. if i use these lines as walls, sharp corners shown in the picture cause lost atom as mentioned in Lammps manual.
Can i eliminate these sharp corners or is there another way to model such problem? do you have any idea?

problemPic.jpg

Dear Andrew
Thank you very much for your answer and kindness.
But i don't want to use immobilized atoms as wall. I want to use "wall
model" i.e. smooth wall without roughness.

Ahh, this explains why people use the "fix wall" commands.
I did not realize this. Thanks!

In my knowledge, the only way to model curved surfaces as wall is using "fix
wall/region command".
there is a difficulty: please see the attached pic. it is my simulation
geometry. i want to have fluid flow from left container to the right through
a 3D tube. the red lines in the pic show walls. if i use these lines as
walls, sharp corners shown in the picture cause lost atom as mentioned in
Lammps manual.
Can i eliminate these sharp corners or is there another way to model such
problem? do you have any idea?

No, but that does not mean it's not easy to do. (I just don't know
very much about the fix wall commands.)
Do you really need these corners? Could you just change the shape of
the containers? (In other words to make them part of the cylinder?)

I don't know the details of what you are trying to do, so forgive me
if I am missing the point. I have two comments.

1)
The picture you posted has a wall with convex corners. If that is
what you want to simulate, then if I were in your shoes, I would build
the surface out of atoms (in other words, create a DATA file), and
immobilize these atoms. I can't really think of another way unless
you are willing to change the shape of your containers. You can
minimize friction with the walls to some degree by using purely
replusive interactions between fluid and the atoms which make up the
wall.

2)
Do you need to simulate the two containers on each side of the tube?
Or are they only there to function as a reservoir?

Instead could you not create an infinitely long cylinder (using the
"INF" keword) and use something like "fix addforce" to push the fluid
through the tube (and periodic boundary conditions to insure that
particles exiting one side of the boundary box, enter at the other
side)? (If so, would you not want to consider friction with the
walls?)

http://lammps.sandia.gov/doc/fix_addforce.html

Again, I'm not sure what you are doing, (or what thermostat you are
using) so forgive me if my question seems dumb.

Thanks again for explaining the fix wall/region details to me.
Andrew

Dear Andrew
Thank you very much for your answer and kindness.
But i don't want to use immobilized atoms as wall. I want to use "wall
model" i.e. smooth wall without roughness.

can you please elaborate a little bit on why this is necessary?
depending on the choice of potential parameters, a wall of LJ
particles can be pretty smooth, and if you are modeling atomic
scale system, there would be that kind of corrugation in any case.

the main advantage of using fix wall is that it saves computational
cost, since it replaces the force computation of an atom near the
wall with all wall atoms within reach of the cutoff with a single force
computation. thus whether there is a benefit for you significantly
depends on the size of your system, the overall computational
cost and availability of computational resources.

In my knowledge, the only way to model curved surfaces as wall is using "fix
wall/region command".

correction: the only way that is *currently implemented*.

there is a difficulty: please see the attached pic. it is my simulation
geometry. i want to have fluid flow from left container to the right through
a 3D tube. the red lines in the pic show walls. if i use these lines as
walls, sharp corners shown in the picture cause lost atom as mentioned in
Lammps manual.
Can i eliminate these sharp corners or is there another way to model such
problem? do you have any idea?

you can program a custom wall type that is written specifically
to handle your wall topology. i could imagine that there would be
others that appreciate such an effort. mind you, computing interactions
for "smooth edges" might be non-trivial (you need something akin to
the sphere-asphere interactions programmed in the aspherical pair styles).

on the other hand, using just LJ particles with a sufficiently large sigma,
or even overlaying LJ particles with different sigma (check out, e.g.,
arxiv.org/pdf/1202.2450) can be a very efficient and practical method
to build any kind of shape, even *if* you want sharp edges.
(and doesn't require any programming outside of building those systems).

HTH,
     axel.

Thanks Axel, your comments were very helpful.