"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c

:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)

:line

fix wall/region command :h3

[Syntax:]

fix ID group-ID wall/region region-ID style epsilon sigma cutoff :pre

ID, group-ID are documented in "fix"_fix.html command
wall/region = style name of this fix command
region-ID = region whose boundary will act as wall
style = {lj93} or {lj126} or {lj1043} or {colloid} or {harmonic}
epsilon = strength factor for wall-particle interaction (energy or energy/distance^2 units)
sigma = size factor for wall-particle interaction (distance units)
cutoff = distance from wall at which wall-particle interaction is cut off (distance units) :ul

[Examples:]

fix wall all wall/region mySphere lj93 1.0 1.0 2.5 :pre

[Description:]

Treat the surface of the geometric region defined by the {region-ID}
as a bounding wall which interacts with nearby particles according to
the specified style.

The distance between a particle and the surface is the distance to the
nearest point on the surface and the force the wall exerts on the
particle is along the direction between that point and the particle,
which is the direction normal to the surface at that point.  Note that
if the region surface is comprised of multiple "faces", then each face
can exert a force on the particle if it is close enough.  E.g. for
"region_style block"_region.html, a particle in the interior, near a
corner of the block, could feel wall forces from 1, 2, or 3 faces of
the block.

Regions are defined using the "region"_region.html command.  Note that
the region volume can be interior or exterior to the bounding surface,
which will determine in which direction the surface interacts with
particles, i.e. the direction of the surface normal.  The surface of
the region only exerts forces on particles "inside" the region; if a
particle is "outside" the region it will generate an error, because it
has moved through the wall.

Regions can either be primitive shapes (block, sphere, cylinder, etc)
or combinations of primitive shapes specified via the {union} or
{intersect} region styles.  These latter styles can be used to
construct particle containers with complex shapes.  Regions can also
change over time via the "region"_region.html command keywords (move)
and {rotate}.  If such a region is used with this fix, then the of
region surface will move over time in the corresponding manner.

NOTE: As discussed on the "region"_region.html command doc page,
regions in LAMMPS do not get wrapped across periodic boundaries.  It
is up to you to insure that periodic or non-periodic boundaries are
specified appropriately via the "boundary"_boundary.html command when
using a region as a wall that bounds particle motion.  This also means
that if you embed a region in your simulation box and want it to
repulse particles from its surface (using the "side out" option in the
"region"_region.html command), that its repulsive force will not be
felt across a periodic boundary.

NOTE: For primitive regions with sharp corners and/or edges (e.g. a
block or cylinder), wall/particle forces are computed accurately for
both interior and exterior regions.  For {union} and {intersect}
regions, additional sharp corners and edges may be present due to the
intersection of the surfaces of 2 or more primitive volumes.  These
corners and edges can be of two types: concave or convex.  Concave
points/edges are like the corners of a cube as seen by particles in
the interior of a cube.  Wall/particle forces around these features
are computed correctly.  Convex points/edges are like the corners of a
cube as seen by particles exterior to the cube, i.e. the points jut
into the volume where particles are present.  LAMMPS does NOT compute
the location of these convex points directly, and hence wall/particle
forces in the cutoff volume around these points suffer from
inaccuracies.  The basic problem is that the outward normal of the
surface is not continuous at these points.  This can cause particles
to feel no force (they don't "see" the wall) when in one location,
then move a distance epsilon, and suddenly feel a large force because
they now "see" the wall.  In a worst-case scenario, this can blow
particles out of the simulation box.  Thus, as a general rule you
should not use the fix wall/gran/region command with {union} or
{interesect} regions that have convex points or edges resulting from
the union/intersection (convex points/edges in the union/intersection
due to a single sub-region are still OK).

NOTE: Similarly, you should not define {union} or {intersert} regions
for use with this command that share an overlapping common face that
is part of the overall outer boundary (interior boundary is OK), even
if the face is smooth.  E.g. two regions of style block in a {union}
region, where the two blocks overlap on one or more of their faces.
This is because LAMMPS discards points that are part of multiple
sub-regions when calculating wall/particle interactions, to avoid
double-counting the interaction.  Having two coincident faces could
cause the face to become invisible to the particles.  The solution is
to make the two faces differ by epsilon in their position.

The energy of wall-particle interactions depends on the specified
style.

For style {lj93}, the energy E is given by the 9/3 potential:

:c,image(Eqs/fix_wall_lj93.jpg)

For style {lj126}, the energy E is given by the 12/6 potential:

:c,image(Eqs/pair_lj.jpg)

For style {wall/lj1043}, the energy E is given by the 10/4/3 potential:

:c,image(Eqs/fix_wall_lj1043.jpg)

For style {colloid}, the energy E is given by an integrated form of
the "pair_style colloid"_pair_colloid.html potential:

:c,image(Eqs/fix_wall_colloid.jpg)

For style {wall/harmonic}, the energy E is given by a harmonic spring
potential:

:c,image(Eqs/fix_wall_harmonic.jpg)

In all cases, {r} is the distance from the particle to the region
surface, and Rc is the {cutoff} distance at which the particle and
surface no longer interact.  The energy of the wall potential is
shifted so that the wall-particle interaction energy is 0.0 at the
cutoff distance.

For a full description of these wall styles, see fix_style
"wall"_fix_wall.html

[Restart, fix_modify, output, run start/stop, minimize info:]

No information about this fix is written to "binary restart
files"_restart.html.

The "fix_modify"_fix_modify.html {energy} option is supported by this
fix to add the energy of interaction between atoms and the wall to the
system's potential energy as part of "thermodynamic
output"_thermo_style.html.

The "fix_modify"_fix_modify.html {virial} option is supported by this
fix to add the contribution due to the interaction between
atoms and each wall to the system's virial as part of "thermodynamic
output"_thermo_style.html. The default is {virial no}

The "fix_modify"_fix_modify.html {respa} option is supported by this
fix. This allows to set at which level of the "r-RESPA"_run_style.html
integrator the fix is adding its forces. Default is the outermost level.

This fix computes a global scalar energy and a global 3-length vector
of forces, which can be accessed by various "output
commands"_Section_howto.html#howto_15.  The scalar energy is the sum
of energy interactions for all particles interacting with the wall
represented by the region surface.  The 3 vector quantities are the
x,y,z components of the total force acting on the wall due to the
particles.  The scalar and vector values calculated by this fix are
"extensive".

No parameter of this fix can be used with the {start/stop} keywords of
the "run"_run.html command.

The forces due to this fix are imposed during an energy minimization,
invoked by the "minimize"_minimize.html command.

NOTE: If you want the atom/wall interaction energy to be included in
the total potential energy of the system (the quantity being
minimized), you MUST enable the "fix_modify"_fix_modify.html {energy}
option for this fix.

[Restrictions:] none

[Related commands:]

"fix wall/lj93"_fix_wall.html,
"fix wall/lj126"_fix_wall.html,
"fix wall/colloid"_fix_wall.html,
"fix wall/gran"_fix_wall_gran.html

[Default:] none
