From 1670ca2d57581bf01cbe3f993c6c57c63d74e238 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 8 Jan 2010 22:54:29 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3634 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/Eqs/fix_wall_harmonic.jpg | Bin 0 -> 1050 bytes doc/Eqs/fix_wall_harmonic.tex | 9 ++ doc/Section_commands.html | 4 +- doc/Section_commands.txt | 1 + doc/fix.html | 7 +- doc/fix.txt | 7 +- doc/fix_wall.html | 54 +++++++--- doc/fix_wall.txt | 54 +++++++--- doc/fix_wall_region.html | 190 ++++++++++++++++++++++++++++++++++ doc/fix_wall_region.txt | 185 +++++++++++++++++++++++++++++++++ doc/region.html | 68 ++++++++++-- doc/region.txt | 68 ++++++++++-- 12 files changed, 595 insertions(+), 52 deletions(-) create mode 100644 doc/Eqs/fix_wall_harmonic.jpg create mode 100644 doc/Eqs/fix_wall_harmonic.tex create mode 100644 doc/fix_wall_region.html create mode 100644 doc/fix_wall_region.txt diff --git a/doc/Eqs/fix_wall_harmonic.jpg b/doc/Eqs/fix_wall_harmonic.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4dda18f32cb9cf5cec3cc4d0dbddc9148134f88e GIT binary patch literal 1050 zcmV+#1m*kx*#F=F5K2Z#MgRc;0RTtG1Oo*G1Ox>I1qKHU2nPoT z2M-Gi2@DYr5)u&)5fKv>92XN58Wj-{7$F!M9UUJZ9}^cMBqAOp93CGY|G)qX2mmbr zkpTe_0RO}Q8~_0T0{{X80000000000000041qJ~J0s{#D!~if500IF70RjXC0tW#A z000000RjU61O*Wi1|btMK~V=36(V6HaWqp^a*~zO)BoB42mt{A06zfxE|jGyN>Y@i zDN0h5r722Ml|?^QV{RzD2&@7=gV2BLHhcyKxb1EY>I@cUWWMk%rq42Vu58eZ0y2%|rT)=kzR(`N97H ztxSSelH5xyGFu%I$thi~y~>h5K6RhyUaqt23qPsimJ^JS7PghH0h(3ip(lm`;*FwI zmf0HGjnquPSzg-b@)%nVoVm$e+T)uc9C6MOrA205I$$`nx)o03Hi;!ibLDf2>U+xIng~? zb=3Cw`{=M!L5{w)nq<52)zCC=t54^Y^OWkiy(_{u;{)FQT}y$J(W>s21KFf;3R6%!VM4qtR4;1#^tR$7j`fo}p{0 zCZ8t_v>X|9A&LPf6bICDmR9}P)y*kNRX0rFW5UmwxEE4f&6deM{Lbs52}F%heik^R zQT?@W>aL8Ap_PW2NZ2FVs28SF9rtw2>*0VP{HjJIvv0?ONZ>n@`bIKOa!p(0t>?PM z+}gu**0aq6#+MPVc$ldHz~7iX{QWCCcVm$0evZIkx@HpA)-7pcEWRH%g3>h#&ZsxZ zw4p%J*DhKiNUQ7^oMTt!E^h8z$s-9aqDbT_U5bLL001t4><)n6ebm}gl%*+3Qk11B UN>Y@iDN0h5r722Ml%*^G*;VP$X8-^I literal 0 HcmV?d00001 diff --git a/doc/Eqs/fix_wall_harmonic.tex b/doc/Eqs/fix_wall_harmonic.tex new file mode 100644 index 0000000000..73a36aabf7 --- /dev/null +++ b/doc/Eqs/fix_wall_harmonic.tex @@ -0,0 +1,9 @@ +\documentstyle[12pt]{article} + +\begin{document} + +$$ + E = \epsilon \hspace{0.1cm} r^2 \qquad r < r_c +$$ + +\end{document} diff --git a/doc/Section_commands.html b/doc/Section_commands.html index 877f70e414..cc9a577d83 100644 --- a/doc/Section_commands.html +++ b/doc/Section_commands.html @@ -327,8 +327,8 @@ of each style or click on the style itself for a full description: nve/noforcenve/spherenvtnvt/aspherenvt/sllodnvt/sphereorient/fccplaneforce poemspourpress/berendsenprintreax/bondsrecenterrigidsetforce shakespringspring/rgspring/selfstore/coordstore/forcetemp/berendsentemp/rescale -thermal/conductivitytmdttmviscosityviscouswall/colloidwall/granwall/lj126 -wall/lj93wall/reflect +thermal/conductivitytmdttmviscosityviscouswall/colloidwall/granwall/harmonic +wall/lj126wall/lj93wall/reflect

These are fix styles contributed by users, which can be used if diff --git a/doc/Section_commands.txt b/doc/Section_commands.txt index b018906a35..0d2ac94e8a 100644 --- a/doc/Section_commands.txt +++ b/doc/Section_commands.txt @@ -442,6 +442,7 @@ of each style or click on the style itself for a full description: "viscous"_fix_viscous.html, "wall/colloid"_fix_wall.html, "wall/gran"_fix_wall_gran.html, +"wall/harmonic"_fix_wall.html, "wall/lj126"_fix_wall.html, "wall/lj93"_fix_wall.html, "wall/reflect"_fix_wall_reflect.html :tb(c=8,ea=c) diff --git a/doc/fix.html b/doc/fix.html index 255ef467c7..b97d302188 100644 --- a/doc/fix.html +++ b/doc/fix.html @@ -218,10 +218,11 @@ list of fix styles available in LAMMPS:

  • ttm - two-temperature model for electronic/atomic coupling
  • viscosity - Muller-Plathe momentum exchange for viscosity calculation
  • viscous - viscous damping for granular simulations -
  • wall/colloid - Lennard-Jones wall interacting with finite-size particles +
  • wall/colloid - Lennard-Jones wall interacting with finite-size particles
  • wall/gran - frictional wall(s) for granular simulations -
  • wall/lj126 - Lennard-Jones 12-6 wall -
  • wall/lj93 - Lennard-Jones 9-3 wall +
  • wall/harmonic - harmonic spring wall +
  • wall/lj126 - Lennard-Jones 12-6 wall +
  • wall/lj93 - Lennard-Jones 9-3 wall
  • wall/reflect - reflecting wall(s)

    There are also additional fix styles submitted by users which are diff --git a/doc/fix.txt b/doc/fix.txt index 11a48c5034..5ec9842095 100644 --- a/doc/fix.txt +++ b/doc/fix.txt @@ -223,10 +223,11 @@ list of fix styles available in LAMMPS: "viscosity"_fix_viscosity.html - Muller-Plathe momentum exchange for \ viscosity calculation "viscous"_fix_viscous.html - viscous damping for granular simulations -"wall/colloid"_fix_wall_colloid.html - Lennard-Jones wall interacting with finite-size particles +"wall/colloid"_fix_wall.html - Lennard-Jones wall interacting with finite-size particles "wall/gran"_fix_wall_gran.html - frictional wall(s) for granular simulations -"wall/lj126"_fix_wall_lj126.html - Lennard-Jones 12-6 wall -"wall/lj93"_fix_wall_lj93.html - Lennard-Jones 9-3 wall +"wall/harmonic"_fix_wall.html - harmonic spring wall +"wall/lj126"_fix_wall.html - Lennard-Jones 12-6 wall +"wall/lj93"_fix_wall.html - Lennard-Jones 9-3 wall "wall/reflect"_fix_wall_reflect.html - reflecting wall(s) :ul There are also additional fix styles submitted by users which are diff --git a/doc/fix_wall.html b/doc/fix_wall.html index 4d4378a13d..3dd3bbd6ea 100644 --- a/doc/fix_wall.html +++ b/doc/fix_wall.html @@ -21,7 +21,7 @@

    • ID, group-ID are documented in fix command -
    • style = wall/lj93 or wall/lj126 or wall/colloid +
    • style = wall/lj93 or wall/lj126 or wall/colloid or wall/harmonic
    • one or more keyword/value pairs may be appended @@ -29,7 +29,7 @@
        xlo, xhi, ylo, yhi, zlo, zhi values = coord epsilon sigma cutoff
           coord = position of wall (distance units)
      -    epsilon = strength factor for wall-particle interaction (energy units)
      +    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)
         vel value = v
      @@ -72,6 +72,11 @@ the pair_style colloid potential:
       

      +

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

      +
      +

      In all cases, r is the distance from the particle to the wall at position coord, and Rc is the cutoff distance at which the particle and wall no longer interact. The energy of the wall @@ -80,28 +85,48 @@ potential is shifted so that the wall-particle interaction energy is

      For the wall/lj93 and wall/lj126 styles, epsilon and sigma are the usual Lennard-Jones parameters, which determine the strength and -size of the particle as it interacts with the wall. Note that this -epsilon and sigma may be different than any epsilon or sigma -values defined for a pair style that computes particle-particle -interactions. +size of the particle as it interacts with the wall. Epsilon has +energy units. Note that this epsilon and sigma may be different +than any epsilon or sigma values defined for a pair style that +computes particle-particle interactions.

      The wall/lj93 interaction is derived by integrating over a 3d half-lattice of Lennard-Jones 12/6 particles. The wall/lj126 interaction is effectively a harder, more repulsive wall interaction.

      For the wall/colloid style, epsilon is effectively a Hamaker -constant for the colloid-wall interaction, R is the radius of the -colloid particle, D is the distance from the surface of the colloid -particle to the wall (r-R), and sigma is the size of the constituent -LJ particle inside the colloid particle. Note that the cutoff -distance Rc in this case is the distance from the colloid particle -center to the wall. +constant with energy units for the colloid-wall interaction, R is +the radius of the colloid particle, D is the distance from the +surface of the colloid particle to the wall (r-R), and sigma is the +size of a constituent LJ particle inside the colloid particle. Note +that the cutoff distance Rc in this case is the distance from the +colloid particle center to the wall.

      The wall/colloid interaction is derived by integrating over constituent LJ particles of size sigma within the colloid particle and a 3d half-lattice of Lennard-Jones 12/6 particles of size sigma in the wall.

      +

      For the wall/harmonic style, epsilon is effectively the spring +constant K, and has units (energy/distance^2). The input parameter +sigma is ignored. The minimum energy position of the harmonic +spring is at the cutoff. This is a repulsive-only spring since the +interaction is truncated at the cutoff +

      +

      IMPORTANT NOTE: For all of the styles, you must insure that r is +always > 0 for all particles in the group, or LAMMPS will generate an +error. This means you cannot start your simulation with particles at +the wall position coord (r = 0) or with particles on the wrong side +of the wall (r < 0). For the wall/lj93 and wall/lj126 styles, the +energy of the wall/particle interaction (and hence the force on the +particle) blows up as r -> 0. The wall/colloid style is even more +restrictive, since the energy blows up as D = r-R -> 0. This means +the finite-size particles of radius R must be a distance larger than R +from the wall position coord. The harmonic style is a softer +potential and does not blow up as r -> 0, but you must use a large +enough epsilon that particles always reamin on the correct side of +the wall (r > 0). +

      If the vel keyword is specified, the position of all walls will move during the simulation in a perpendicular direction, based on their initial coord position, the specified velocity vel, and the time @@ -195,8 +220,9 @@ together.

      Related commands:

      -

      fix wall/reflect, fix -wall/gran +

      fix wall/reflect, +fix wall/gran, +fix wall/region

      Default:

      diff --git a/doc/fix_wall.txt b/doc/fix_wall.txt index aae01ec73a..faf9f5c590 100644 --- a/doc/fix_wall.txt +++ b/doc/fix_wall.txt @@ -15,12 +15,12 @@ fix wall/colloid command :h3 fix ID group-ID style keyword values ... :pre ID, group-ID are documented in "fix"_fix.html command :ulb,l -style = {wall/lj93} or {wall/lj126} or {wall/colloid} :l +style = {wall/lj93} or {wall/lj126} or {wall/colloid} or {wall/harmonic} :l one or more keyword/value pairs may be appended :l keyword = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} or {vel} or {wiggle/sin} or {wiggle/cos} or {units} :l {xlo}, {xhi}, {ylo}, {yhi}, {zlo}, {zhi} values = coord epsilon sigma cutoff coord = position of wall (distance units) - epsilon = strength factor for wall-particle interaction (energy units) + 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) {vel} value = v @@ -62,6 +62,11 @@ 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 wall at position {coord}, and Rc is the {cutoff} distance at which the particle and wall no longer interact. The energy of the wall @@ -70,28 +75,48 @@ potential is shifted so that the wall-particle interaction energy is For the {wall/lj93} and {wall/lj126} styles, {epsilon} and {sigma} are the usual Lennard-Jones parameters, which determine the strength and -size of the particle as it interacts with the wall. Note that this -{epsilon} and {sigma} may be different than any {epsilon} or {sigma} -values defined for a pair style that computes particle-particle -interactions. +size of the particle as it interacts with the wall. Epsilon has +energy units. Note that this {epsilon} and {sigma} may be different +than any {epsilon} or {sigma} values defined for a pair style that +computes particle-particle interactions. The {wall/lj93} interaction is derived by integrating over a 3d half-lattice of Lennard-Jones 12/6 particles. The {wall/lj126} interaction is effectively a harder, more repulsive wall interaction. For the {wall/colloid} style, {epsilon} is effectively a Hamaker -constant for the colloid-wall interaction, {R} is the radius of the -colloid particle, {D} is the distance from the surface of the colloid -particle to the wall (r-R), and {sigma} is the size of the constituent -LJ particle inside the colloid particle. Note that the cutoff -distance Rc in this case is the distance from the colloid particle -center to the wall. +constant with energy units for the colloid-wall interaction, {R} is +the radius of the colloid particle, {D} is the distance from the +surface of the colloid particle to the wall (r-R), and {sigma} is the +size of a constituent LJ particle inside the colloid particle. Note +that the cutoff distance Rc in this case is the distance from the +colloid particle center to the wall. The {wall/colloid} interaction is derived by integrating over constituent LJ particles of size {sigma} within the colloid particle and a 3d half-lattice of Lennard-Jones 12/6 particles of size {sigma} in the wall. +For the {wall/harmonic} style, {epsilon} is effectively the spring +constant K, and has units (energy/distance^2). The input parameter +{sigma} is ignored. The minimum energy position of the harmonic +spring is at the {cutoff}. This is a repulsive-only spring since the +interaction is truncated at the {cutoff} + +IMPORTANT NOTE: For all of the styles, you must insure that r is +always > 0 for all particles in the group, or LAMMPS will generate an +error. This means you cannot start your simulation with particles at +the wall position {coord} (r = 0) or with particles on the wrong side +of the wall (r < 0). For the {wall/lj93} and {wall/lj126} styles, the +energy of the wall/particle interaction (and hence the force on the +particle) blows up as r -> 0. The {wall/colloid} style is even more +restrictive, since the energy blows up as D = r-R -> 0. This means +the finite-size particles of radius R must be a distance larger than R +from the wall position {coord}. The {harmonic} style is a softer +potential and does not blow up as r -> 0, but you must use a large +enough {epsilon} that particles always reamin on the correct side of +the wall (r > 0). + If the {vel} keyword is specified, the position of all walls will move during the simulation in a perpendicular direction, based on their initial {coord} position, the specified velocity {vel}, and the time @@ -185,8 +210,9 @@ together. [Related commands:] -"fix wall/reflect"_fix_wall_reflect.html, "fix -wall/gran"_fix_wall_gran.html +"fix wall/reflect"_fix_wall_reflect.html, +"fix wall/gran"_fix_wall_gran.html, +"fix wall/region"_fix_wall_region.html [Default:] diff --git a/doc/fix_wall_region.html b/doc/fix_wall_region.html new file mode 100644 index 0000000000..cbbdabd2ef --- /dev/null +++ b/doc/fix_wall_region.html @@ -0,0 +1,190 @@ + +
      LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands +
      + + + + + + +
      + +

      fix wall/region command +

      +

      Syntax: +

      +
      fix ID group-ID wall/region region-ID style epsilon sigma cutoff 
      +
      +
      • ID, group-ID are documented in fix command +
      • wall/region = style name of this fix command +
      • region-ID = region whose boundary will act as wall +
      • style = lj93 or lj126 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) +
      +

      Examples: +

      +
      fix wall all wall/region mySphere lj93 1.0 1.0 2.5 
      +
      +

      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. +

      +

      Regions are defined using the region 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. 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. +

      +

      IMPORTANT NOTE: As discussed on the region 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 command when +using a region as a wall that bounds particle motion. +

      +

      IMPORTANT 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 the worst-case +scenario, this can blow particles out of the simulation box. Thus, as +a general rule you should not use the fix wall/region command with +union or interesect regions that have convex points or edges. +

      +

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

      +

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

      +
      +
      +

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

      +
      +
      +

      For style colloid, the energy E is given by an integrated form of +the pair_style colloid potential: +

      +
      +
      +

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

      +
      +
      +

      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 the lj93 and lj126 styles, epsilon and sigma are the usual +Lennard-Jones parameters, which determine the strength and size of the +particle as it interacts with the wall. Epsilon has energy units. +Note that this epsilon and sigma may be different than any +epsilon or sigma values defined for a pair style that computes +particle-particle interactions. +

      +

      The lj93 interaction is derived by integrating over a 3d +half-lattice of Lennard-Jones 12/6 particles. The lj126 interaction +is effectively a harder, more repulsive wall interaction. +

      +

      For the colloid style, epsilon is effectively a Hamaker constant +with energy units for the colloid-wall interaction, R is the radius +of the colloid particle, D is the distance from the surface of the +colloid particle to the wall (r-R), and sigma is the size of a +constituent LJ particle inside the colloid particle. Note that the +cutoff distance Rc in this case is the distance from the colloid +particle center to the wall. +

      +

      The colloid interaction is derived by integrating over constituent +LJ particles of size sigma within the colloid particle and a 3d +half-lattice of Lennard-Jones 12/6 particles of size sigma in the +wall. +

      +

      For the wall/harmonic style, epsilon is effectively the spring +constant K, and has units (energy/distance^2). The input parameter +sigma is ignored. The minimum energy position of the harmonic +spring is at the cutoff. This is a repulsive-only spring since the +interaction is truncated at the cutoff +

      +

      IMPORTANT NOTE: For all of the styles, you must insure that r is +always > 0 for all particles in the group, or LAMMPS will generate an +error. This means you cannot start your simulation with particles on +the region surface (r = 0) or with particles on the wrong side of the +region surface (r < 0). For the wall/lj93 and wall/lj126 styles, +the energy of the wall/particle interaction (and hence the force on +the particle) blows up as r -> 0. The wall/colloid style is even +more restrictive, since the energy blows up as D = r-R -> 0. This +means the finite-size particles of radius R must be a distance larger +than R from the region surface. The harmonic style is a softer +potential and does not blow up as r -> 0, but you must use a large +enough epsilon that particles always reamin on the correct side of +the region surface (r > 0). +

      +

      Restart, fix_modify, output, run start/stop, minimize info: +

      +

      No information about this fix is written to binary restart +files. +

      +

      The fix_modify 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. +

      +

      This fix computes a scalar energy and a 3-length vector of forces, +which can be accessed by various output +commands. The scalar and vector values +calculated by this fix are "extensive", meaning they scale with the +number of atoms in the simulation. 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. +

      +

      No parameter of this fix can be used with the start/stop keywords of +the run command. +

      +

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

      +

      IMPORTANT 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 +energy option for this fix. +

      +

      Restrictions: none +

      +

      Related commands: +

      +

      fix wall/lj93, +fix wall/lj126, +fix wall/colloid, +fix wall/gran +

      +

      Default: none +

      + diff --git a/doc/fix_wall_region.txt b/doc/fix_wall_region.txt new file mode 100644 index 0000000000..6ac90926c3 --- /dev/null +++ b/doc/fix_wall_region.txt @@ -0,0 +1,185 @@ +"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 {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. + +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. 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. + +IMPORTANT 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. + +IMPORTANT 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 the worst-case +scenario, this can blow particles out of the simulation box. Thus, as +a general rule you should not use the fix wall/region command with +{union} or {interesect} regions that have convex points or edges. + +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 {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 the {lj93} and {lj126} styles, {epsilon} and {sigma} are the usual +Lennard-Jones parameters, which determine the strength and size of the +particle as it interacts with the wall. Epsilon has energy units. +Note that this {epsilon} and {sigma} may be different than any +{epsilon} or {sigma} values defined for a pair style that computes +particle-particle interactions. + +The {lj93} interaction is derived by integrating over a 3d +half-lattice of Lennard-Jones 12/6 particles. The {lj126} interaction +is effectively a harder, more repulsive wall interaction. + +For the {colloid} style, {epsilon} is effectively a Hamaker constant +with energy units for the colloid-wall interaction, {R} is the radius +of the colloid particle, {D} is the distance from the surface of the +colloid particle to the wall (r-R), and {sigma} is the size of a +constituent LJ particle inside the colloid particle. Note that the +cutoff distance Rc in this case is the distance from the colloid +particle center to the wall. + +The {colloid} interaction is derived by integrating over constituent +LJ particles of size {sigma} within the colloid particle and a 3d +half-lattice of Lennard-Jones 12/6 particles of size {sigma} in the +wall. + +For the {wall/harmonic} style, {epsilon} is effectively the spring +constant K, and has units (energy/distance^2). The input parameter +{sigma} is ignored. The minimum energy position of the harmonic +spring is at the {cutoff}. This is a repulsive-only spring since the +interaction is truncated at the {cutoff} + +IMPORTANT NOTE: For all of the styles, you must insure that r is +always > 0 for all particles in the group, or LAMMPS will generate an +error. This means you cannot start your simulation with particles on +the region surface (r = 0) or with particles on the wrong side of the +region surface (r < 0). For the {wall/lj93} and {wall/lj126} styles, +the energy of the wall/particle interaction (and hence the force on +the particle) blows up as r -> 0. The {wall/colloid} style is even +more restrictive, since the energy blows up as D = r-R -> 0. This +means the finite-size particles of radius R must be a distance larger +than R from the region surface. The {harmonic} style is a softer +potential and does not blow up as r -> 0, but you must use a large +enough {epsilon} that particles always reamin on the correct side of +the region surface (r > 0). + +[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. + +This fix computes a scalar energy and a 3-length vector of forces, +which can be accessed by various "output +commands"_Section_howto.html#4_15. The scalar and vector values +calculated by this fix are "extensive", meaning they scale with the +number of atoms in the simulation. 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. + +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. + +IMPORTANT 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 diff --git a/doc/region.html b/doc/region.html index ac720a46e0..c86c614894 100644 --- a/doc/region.html +++ b/doc/region.html @@ -32,7 +32,7 @@ radius = cylinder radius (distance units) lo,hi = bounds of cylinder in dim (distance units) plane args = px py pz nx ny nz - px,py,pz = point on the plane + px,py,pz = point on the plane (distance units) nx,ny,nz = direction normal to plane (distance units) prism args = xlo xhi ylo yhi zlo zhi xy xz yz xlo,xhi,ylo,yhi,zlo,zhi = bounds of untilted prism (distance units) @@ -77,6 +77,8 @@ commands use regions. For example, the region can be filled with atoms via the create_atoms command. Or the atoms in the region can be identified as a group via the group command, or deleted via the delete_atoms command. +Or the surface of the region can be used as a boundary wall via the +fix wall/region command.

      The lo/hi values for block or cone or cylinder or prism styles can be specified as EDGE or INF. EDGE means they extend all the way @@ -87,11 +89,26 @@ it should encompass the simulation box even if it changes size. If a region is defined before the simulation box has been created (via create_box or read_data or read_restart commands), then an EDGE or INF -parameter cannot be used. +parameter cannot be used. For a prism region, a non-zero tilt +factor in any pair of dimensions cannot be used if both the lo/hi +values in either of those dimensions are INF. E.g. if the xy tilt is +non-zero, then xlo and xhi cannot both be INF, nor can ylo and yhi. +

      +

      IMPORTANT NOTE: Regions in LAMMPS do not get wrapped across periodic +boundaries, as specified by the boundary command. For +example, a spherical region that is defined so that it overlaps a +periodic boundary is not treated as 2 half-spheres, one on either side +of the simulation box. +

      +

      IMPORTANT NOTE: Regions in LAMMPS are always 3d geometric objects, +regardless of whether the dimension of a simulation +is 2d or 3d. Thus when using regions in a 2d simulation, you should +be careful to define the region so that its intersection with the 2d +x-y plane of the simulation is the 2d geometric object you want.

      For style cone, an axis-aligned cone is defined which is like a cylinder except that two different radii (one at each end) can be -defined. Either of the radii can be 0.0. +defined. Either of the radii (but not both) can be 0.0.

      For style cone and cylinder, the c1,c2 params are coordinates in the 2 other dimensions besides the cylinder axis dimension. For dim = @@ -100,6 +117,12 @@ Thus the third example above specifies a cylinder with its axis in the y-direction located at x = 2.0 and z = 3.0, with a radius of 5.0, and extending in the y-direction from -5.0 to the upper box boundary.

      +

      For style plane, a plane is defined which contain the point +(px,py,pz) and has a normal vector (nx,ny,nz). The normal vector does +not have to be of unit length. The "inside" of the plane is the +half-space in the direction of the normal vector; see the discussion +of the side option below. +

      For style prism, a parallelepiped is defined (it's too hard to spell parallelepiped in an input script!). Think of the parallelepiped as initially an axis-aligned orthogonal box with the same xyz lo/hi @@ -138,12 +161,41 @@ region would be all the volume in the simulation box that was outside both of the spheres.

      The units keyword determines the meaning of the distance units used -to define the region. A box value selects standard distance units -as defined by the units command, e.g. Angstroms for units -= real or metal. A lattice value means the distance units are in -lattice spacings. The lattice command must have been -previously used to define the lattice spacing. +to define the region for any argument above listed as having distance +units. A box value selects standard distance units as defined by +the units command, e.g. Angstroms for units = real or +metal. A lattice value means the distance units are in lattice +spacings. The lattice command must have been +previously used to define the lattice spacings which are used as +follows:

      +
      • For style block, the lattice spacing in dimension x is applied to +xlo and xhi, similarly the spacings in dimensions y,z are applied to +ylo/yhi and zlo/zhi. + +
      • For style cone, the lattice spacing in argument dim is applied to +lo and hi. The spacings in the two radial dimensions are applied to +c1 and c2. The two cone radii are scaled by the lattice +spacing in the dimension corresponding to c1. + +
      • For style cylinder, the lattice spacing in argument dim is applied +to lo and hi. The spacings in the two radial dimensions are applied +to c1 and c2. The cylinder radius is scaled by the lattice +spacing in the dimension corresponding to c1. + +
      • For style plane, the lattice spacing in dimension x is applied to +px and nx, similarly the spacings in dimensions y,z are applied to +py/ny and pz/nz. + +
      • For style prism, the lattice spacing in dimension x is applied to +xlo and xhi, similarly for ylo/yhi and zlo/zhi. The lattice spacing +in dimension x is applied to xy and xz, and the spacing in dimension y +to yz. + +
      • For style sphere, the lattice spacing in dimensions x,y,z are +applied to the sphere center x,y,z. The spacing in dimension x is +applied to the sphere radius. +

      Restrictions:

      A prism cannot be of 0.0 thickness in any dimension; use a small z diff --git a/doc/region.txt b/doc/region.txt index 51784db1f3..f1cf039f68 100644 --- a/doc/region.txt +++ b/doc/region.txt @@ -27,7 +27,7 @@ style = {block} or {cone} or {cylinder} or {plane} or {prism} or {sphere} or {un radius = cylinder radius (distance units) lo,hi = bounds of cylinder in dim (distance units) {plane} args = px py pz nx ny nz - px,py,pz = point on the plane + px,py,pz = point on the plane (distance units) nx,ny,nz = direction normal to plane (distance units) {prism} args = xlo xhi ylo yhi zlo zhi xy xz yz xlo,xhi,ylo,yhi,zlo,zhi = bounds of untilted prism (distance units) @@ -68,6 +68,8 @@ commands use regions. For example, the region can be filled with atoms via the "create_atoms"_create_atoms.html command. Or the atoms in the region can be identified as a group via the "group"_group.html command, or deleted via the "delete_atoms"_delete_atoms.html command. +Or the surface of the region can be used as a boundary wall via the +"fix wall/region"_fix_wall_region.html command. The lo/hi values for {block} or {cone} or {cylinder} or {prism} styles can be specified as EDGE or INF. EDGE means they extend all the way @@ -78,11 +80,26 @@ it should encompass the simulation box even if it changes size. If a region is defined before the simulation box has been created (via "create_box"_create_box.html or "read_data"_read_data.html or "read_restart"_read_restart.html commands), then an EDGE or INF -parameter cannot be used. +parameter cannot be used. For a {prism} region, a non-zero tilt +factor in any pair of dimensions cannot be used if both the lo/hi +values in either of those dimensions are INF. E.g. if the xy tilt is +non-zero, then xlo and xhi cannot both be INF, nor can ylo and yhi. + +IMPORTANT NOTE: Regions in LAMMPS do not get wrapped across periodic +boundaries, as specified by the "boundary"_boundary.html command. For +example, a spherical region that is defined so that it overlaps a +periodic boundary is not treated as 2 half-spheres, one on either side +of the simulation box. + +IMPORTANT NOTE: Regions in LAMMPS are always 3d geometric objects, +regardless of whether the "dimension"_dimension.html of a simulation +is 2d or 3d. Thus when using regions in a 2d simulation, you should +be careful to define the region so that its intersection with the 2d +x-y plane of the simulation is the 2d geometric object you want. For style {cone}, an axis-aligned cone is defined which is like a {cylinder} except that two different radii (one at each end) can be -defined. Either of the radii can be 0.0. +defined. Either of the radii (but not both) can be 0.0. For style {cone} and {cylinder}, the c1,c2 params are coordinates in the 2 other dimensions besides the cylinder axis dimension. For dim = @@ -91,6 +108,12 @@ Thus the third example above specifies a cylinder with its axis in the y-direction located at x = 2.0 and z = 3.0, with a radius of 5.0, and extending in the y-direction from -5.0 to the upper box boundary. +For style {plane}, a plane is defined which contain the point +(px,py,pz) and has a normal vector (nx,ny,nz). The normal vector does +not have to be of unit length. The "inside" of the plane is the +half-space in the direction of the normal vector; see the discussion +of the {side} option below. + For style {prism}, a parallelepiped is defined (it's too hard to spell parallelepiped in an input script!). Think of the parallelepiped as initially an axis-aligned orthogonal box with the same xyz lo/hi @@ -129,11 +152,40 @@ region would be all the volume in the simulation box that was outside both of the spheres. The {units} keyword determines the meaning of the distance units used -to define the region. A {box} value selects standard distance units -as defined by the "units"_units.html command, e.g. Angstroms for units -= real or metal. A {lattice} value means the distance units are in -lattice spacings. The "lattice"_lattice.html command must have been -previously used to define the lattice spacing. +to define the region for any argument above listed as having distance +units. A {box} value selects standard distance units as defined by +the "units"_units.html command, e.g. Angstroms for units = real or +metal. A {lattice} value means the distance units are in lattice +spacings. The "lattice"_lattice.html command must have been +previously used to define the lattice spacings which are used as +follows: + +For style {block}, the lattice spacing in dimension x is applied to +xlo and xhi, similarly the spacings in dimensions y,z are applied to +ylo/yhi and zlo/zhi. :ulb,l + +For style {cone}, the lattice spacing in argument {dim} is applied to +lo and hi. The spacings in the two radial dimensions are applied to +c1 and c2. The two cone radii are scaled by the lattice +spacing in the dimension corresponding to c1. :l + +For style {cylinder}, the lattice spacing in argument {dim} is applied +to lo and hi. The spacings in the two radial dimensions are applied +to c1 and c2. The cylinder radius is scaled by the lattice +spacing in the dimension corresponding to c1. :l + +For style {plane}, the lattice spacing in dimension x is applied to +px and nx, similarly the spacings in dimensions y,z are applied to +py/ny and pz/nz. :l + +For style {prism}, the lattice spacing in dimension x is applied to +xlo and xhi, similarly for ylo/yhi and zlo/zhi. The lattice spacing +in dimension x is applied to xy and xz, and the spacing in dimension y +to yz. :l + +For style {sphere}, the lattice spacing in dimensions x,y,z are +applied to the sphere center x,y,z. The spacing in dimension x is +applied to the sphere radius. :l,ule [Restrictions:]