Unverified Commit 1599fcef authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1640 from akohlmey/fix-wall-morse

Implement fix wall/morse
parents 82b3fad1 ad83f0e2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -232,6 +232,7 @@ OPT.
"wall/lj1043"_fix_wall.html,
"wall/lj126"_fix_wall.html,
"wall/lj93 (k)"_fix_wall.html,
"wall/morse"_fix_wall.html,
"wall/piston"_fix_wall_piston.html,
"wall/reflect (k)"_fix_wall_reflect.html,
"wall/region"_fix_wall_region.html,
+6 −5
Original line number Diff line number Diff line
@@ -59,14 +59,15 @@ granular particles; all the other commands create smooth walls.
"fix wall/lj126"_fix_wall.html - flat walls, with Lennard-Jones 12/6 potential
"fix wall/colloid"_fix_wall.html - flat walls, with "pair_style colloid"_pair_colloid.html potential
"fix wall/harmonic"_fix_wall.html - flat walls, with repulsive harmonic spring potential
"fix wall/morse"_fix_wall.html - flat walls, with Morse potential
"fix wall/region"_fix_wall_region.html - use region surface as wall
"fix wall/gran"_fix_wall_gran.html - flat or curved walls with "pair_style granular"_pair_gran.html potential :ul

The {lj93}, {lj126}, {colloid}, and {harmonic} styles all allow the
flat walls to move with a constant velocity, or oscillate in time.
The "fix wall/region"_fix_wall_region.html command offers the most
generality, since the region surface is treated as a wall, and the
geometry of the region can be a simple primitive volume (e.g. a
The {lj93}, {lj126}, {colloid}, {harmonic}, and {morse} styles all
allow the flat walls to move with a constant velocity, or oscillate in
time.  The "fix wall/region"_fix_wall_region.html command offers the
most generality, since the region surface is treated as a wall, and
the geometry of the region can be a simple primitive volume (e.g. a
sphere, or cube, or plane), or a complex volume made from the union
and intersection of primitive volumes.  "Regions"_region.html can also
specify a volume "interior" or "exterior" to the specified primitive
+1 −0
Original line number Diff line number Diff line
@@ -371,6 +371,7 @@ accelerated styles exist.
"wall/lj1043"_fix_wall.html - Lennard-Jones 10-4-3 wall
"wall/lj126"_fix_wall.html - Lennard-Jones 12-6 wall
"wall/lj93"_fix_wall.html - Lennard-Jones 9-3 wall
"wall/morse"_fix_wall.html - Morse potential wall
"wall/piston"_fix_wall_piston.html - moving reflective piston wall
"wall/reflect"_fix_wall_reflect.html - reflecting wall(s)
"wall/region"_fix_wall_region.html - use region surface as wall
+29 −3
Original line number Diff line number Diff line
@@ -12,15 +12,17 @@ fix wall/lj126 command :h3
fix wall/lj1043 command :h3
fix wall/colloid command :h3
fix wall/harmonic command :h3
fix wall/morse command :h3

[Syntax:]

fix ID group-ID style face args ... keyword value ... :pre

ID, group-ID are documented in "fix"_fix.html command :ulb,l
style = {wall/lj93} or {wall/lj126} or {wall/lj1043} or {wall/colloid} or {wall/harmonic} :l
style = {wall/lj93} or {wall/lj126} or {wall/lj1043} or {wall/colloid} or {wall/harmonic} or {wall/morse} :l
one or more face/arg pairs may be appended :l
face = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} :l
  args for styles {lj93} or {lj126} or {lj1043} or {colloid} or {harmonic} :l
    args = coord epsilon sigma cutoff
    coord = position of wall = EDGE or constant or variable
      EDGE = current lo or hi edge of simulation box
@@ -31,6 +33,19 @@ face = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} :l
    sigma = size factor for wall-particle interaction (distance units)
      sigma can be a variable (see below)
    cutoff = distance from wall at which wall-particle interaction is cut off (distance units) :pre
  args for style {morse} :l
    args = coord D_0 alpha r_0 cutoff
    coord = position of wall = EDGE or constant or variable
      EDGE = current lo or hi edge of simulation box
      constant = number like 0.0 or -30.0 (distance units)
      variable = "equal-style variable"_variable.html like v_x or v_wiggle
    D_0 = depth of the potential (energy units)
      D_0 can be a variable (see below)
    alpha = width factor for wall-particle interaction (1/distance units)
      alpha can be a variable (see below)
    r_0 = distance of the potential minimum from the face of region (distance units)
      r_0 can be a variable (see below)
    cutoff = distance from wall at which wall-particle interaction is cut off (distance units) :pre
zero or more keyword/value pairs may be appended :l
keyword = {units} or {fld} :l
  {units} value = {lattice} or {box}
@@ -48,6 +63,7 @@ keyword = {units} or {fld} :l

fix wallhi all wall/lj93 xlo -1.0 1.0 1.0 2.5 units box
fix wallhi all wall/lj93 xhi EDGE 1.0 1.0 2.5
fix wallhi all wall/morse xhi EDGE 1.0 1.0 1.0 2.5 units box
fix wallhi all wall/lj126 v_wiggle 23.2 1.0 1.0 2.5
fix zwalls all wall/colloid zlo 0.0 1.0 1.0 0.858 zhi 40.0 1.0 1.0 0.858 :pre

@@ -80,6 +96,10 @@ potential:

:c,image(Eqs/fix_wall_harmonic.jpg)

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

:c,image(Eqs/pair_morse.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
@@ -147,7 +167,13 @@ constant K, and has units (energy/distance^2). The input parameter
spring is at the {cutoff}.  This is a repulsive-only spring since the
interaction is truncated at the {cutoff}

For any wall, the {epsilon} and/or {sigma} parameter can be specified
For the {wall/morse} style, the three parameters are in this order:
{D_0} the depth of the potential, {alpha} the width parameter, and
{r_0} the location of the minimum.  {D_0} has energy units, {alpha}
inverse distance units, and {r_0} distance units.

For any wall, the {epsilon} and/or {sigma} and/or {alpha} parameter can
be specified
as an "equal-style variable"_variable.html, in which case it should be
specified as v_name, where name is the variable name.  As with a
variable wall position, the variable is evaluated each timestep and
+14 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include "respa.h"
#include "error.h"
#include "force.h"
#include "utils.h"

using namespace LAMMPS_NS;
using namespace FixConst;
@@ -99,6 +100,19 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
        estyle[nwall] = CONSTANT;
      }

      if (utils::strmatch(style,"^wall/morse")) {
        if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
          int n = strlen(&arg[iarg+3][2]) + 1;
          astr[nwall] = new char[n];
          strcpy(astr[nwall],&arg[iarg+3][2]);
          astyle[nwall] = VARIABLE;
        } else {
          alpha[nwall] = force->numeric(FLERR,arg[iarg+3]);
          astyle[nwall] = CONSTANT;
        }
        ++iarg;
      }

      if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
        int n = strlen(&arg[iarg+3][2]) + 1;
        sstr[nwall] = new char[n];
Loading