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

Merge pull request #1691 from toquydong/stochasticwall

Implementation of statistical gas wall boundary conditions
parents 285138ea 00ffa5cc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ OPT.
   * :doc:`wall/morse <fix_wall>`
   * :doc:`wall/piston <fix_wall_piston>`
   * :doc:`wall/reflect (k) <fix_wall_reflect>`
   * :doc:`wall/reflect/stochastic <fix_wall_reflect_stochastic>`
   * :doc:`wall/region <fix_wall_region>`
   * :doc:`wall/region/ees <fix_wall_ees>`
   * :doc:`wall/srd <fix_wall_srd>`
   *
+1 −0
Original line number Diff line number Diff line
@@ -386,6 +386,7 @@ accelerated styles exist.
* :doc:`wall/morse <fix_wall>` - Morse potential wall
* :doc:`wall/piston <fix_wall_piston>` - moving reflective piston wall
* :doc:`wall/reflect <fix_wall_reflect>` - reflecting wall(s)
* :doc:`wall/reflect/stochastic <fix_wall_reflect_stochastic>` - reflecting wall(s) with finite temperature
* :doc:`wall/region <fix_wall_region>` - use region surface as wall
* :doc:`wall/region/ees <fix_wall_ees>` - use region surface as wall for ellipsoidal particles
* :doc:`wall/srd <fix_wall_srd>` - slip/no-slip wall for SRD particles
+26 −24
Original line number Diff line number Diff line
@@ -21,13 +21,9 @@ Syntax
  
  .. parsed-literal::
  
       *xlo*\ ,\ *ylo*\ ,\ *zlo* arg = EDGE or constant or variable
       arg = EDGE or constant or variable
         EDGE = current lo edge of simulation box
         constant = number like 0.0 or -30.0 (distance units)
         variable = :doc:`equal-style variable <variable>` like v_x or v_wiggle
       *xhi*\ ,\ *yhi*\ ,\ *zhi* arg = EDGE or constant or variable
         EDGE = current hi edge of simulation box
         constant = number like 50.0 or 100.3 (distance units)
         constant = number like 0.0 or 30.0 (distance units)
         variable = :doc:`equal-style variable <variable>` like v_x or v_wiggle

* zero or more keyword/value pairs may be appended
@@ -62,11 +58,12 @@ by a distance delta (e.g. due to :doc:`fix nve <fix_nve>`), then it is
put back inside the face by the same delta, and the sign of the
corresponding component of its velocity is flipped.

When used in conjunction with :doc:`fix nve <fix_nve>` and :doc:`run\_style verlet <run_style>`, the resultant time-integration algorithm is
equivalent to the primitive splitting algorithm (PSA) described by
:ref:`Bond <Bond1>`.  Because each reflection event divides
the corresponding timestep asymmetrically, energy conservation is only
satisfied to O(dt), rather than to O(dt\^2) as it would be for
When used in conjunction with :doc:`fix nve <fix_nve>` and
:doc:`run\_style verlet <run_style>`, the resultant time-integration
algorithm is equivalent to the primitive splitting algorithm (PSA)
described by :ref:`Bond <Bond1>`.  Because each reflection event
divides the corresponding timestep asymmetrically, energy conservation
is only satisfied to O(dt), rather than to O(dt\^2) as it would be for
velocity-Verlet integration without reflective walls.

Up to 6 walls or faces can be specified in a single command: *xlo*\ ,
@@ -156,17 +153,19 @@ perturbation on the particles:
Styles with a *gpu*\ , *intel*\ , *kk*\ , *omp*\ , or *opt* suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
page.  The accelerated styles take the same arguments and should
hardware, as discussed on the :doc:`Speed packages <Speed_packages>`
doc page.  The accelerated styles take the same arguments and should
produce the same results, except for round-off and precision issues.

These accelerated styles are part of the GPU, USER-INTEL, KOKKOS,
USER-OMP and OPT packages, respectively.  They are only enabled if
LAMMPS was built with those packages.  See the :doc:`Build package <Build_package>` doc page for more info.
LAMMPS was built with those packages.  See the :doc:`Build package
<Build_package>` doc page for more info.

You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
:doc:`suffix <suffix>` command in your input script.
by including their suffix, or you can use the :doc:`-suffix
command-line switch <Run_options>` when you invoke LAMMPS, or you can
use the :doc:`suffix <suffix>` command in your input script.

See the :doc:`Speed packages <Speed_packages>` doc page for more
instructions on how to use the accelerated styles effectively.
@@ -177,11 +176,13 @@ instructions on how to use the accelerated styles effectively.

**Restart, fix\_modify, output, run start/stop, minimize info:**

No information about this fix is written to :doc:`binary restart files <restart>`.  None of the :doc:`fix\_modify <fix_modify>` options
are relevant to this fix.  No global or per-atom quantities are stored
by this fix for access by various :doc:`output commands <Howto_output>`.
No information about this fix is written to :doc:`binary restart files
<restart>`.  None of the :doc:`fix\_modify <fix_modify>` options are
relevant to this fix.  No global or per-atom quantities are stored by
this fix for access by various :doc:`output commands <Howto_output>`.
No parameter of this fix can be used with the *start/stop* keywords of
the :doc:`run <run>` command.  This fix is not invoked during :doc:`energy minimization <minimize>`.
the :doc:`run <run>` command.  This fix is not invoked during
:doc:`energy minimization <minimize>`.

Restrictions
""""""""""""
@@ -192,17 +193,18 @@ Any dimension (xyz) that has a reflecting wall must be non-periodic.
A reflecting wall should not be used with rigid bodies such as those
defined by a "fix rigid" command.  This is because the wall/reflect
displaces atoms directly rather than exerts a force on them.  For
rigid bodies, use a soft wall instead, such as :doc:`fix wall/lj93 <fix_wall>`.  LAMMPS will flag the use of a rigid
fix with fix wall/reflect with a warning, but will not generate an
error.
rigid bodies, use a soft wall instead, such as :doc:`fix wall/lj93
<fix_wall>`.  LAMMPS will flag the use of a rigid fix with fix
wall/reflect with a warning, but will not generate an error.

Related commands
""""""""""""""""

:doc:`fix wall/lj93 <fix_wall>`, :doc:`fix oneway <fix_oneway>`

**Default:** none
**Default:**

The default for the units keyword is lattice.

----------

+157 −0
Original line number Diff line number Diff line
.. index:: fix wall/reflect/stochastic

fix wall/reflect/stochastic command
===================================

Syntax
""""""


.. parsed-literal::

   fix ID group-ID wall/reflect/stochastic rstyle seed face args ... keyword value ...

* ID, group-ID are documented in :doc:`fix <fix>` command
* wall/reflect/stochastic = style name of this fix command
* rstyle = diffusive or maxwell or ccl
* seed = random seed for stochasticity (positive integer)
* one or more face/args pairs may be appended
* face = *xlo* or *xhi* or *ylo* or *yhi* or *zlo* or *zhi*
  
  .. parsed-literal::
  
       args = pos temp velx vely velz accomx accomy accomz
         pos = EDGE or constant
           EDGE = current lo or hi edge of simulation box
           constant = number like 0.0 or 30.0 (distance units)
         temp = wall temperature (temperature units)
         velx,vely,velz = wall velocity in x,y,z directions (velocity units)
         accomx,accomy,accomz = accommodation coeffs in x,y,z directions (unitless)
           not specified for rstyle = diffusive
           single accom coeff specified for rstyle maxwell
           all 3 coeffs specified for rstyle cll

* zero or more keyword/value pairs may be appended
* keyword = *units*
  
  .. parsed-literal::
  
       *units* value = *lattice* or *box*
         *lattice* = the wall position is defined in lattice units
         *box* = the wall position is defined in simulation box units



Examples
""""""""


.. parsed-literal::

   fix zwalls all wall/reflect/stochastic diffusive 23424 zlo EDGE 300 0.1 0.1 0 zhi EDGE 200 0.1 0.1 0
   fix ywalls all wall/reflect/stochastic maxwell 345533 ylo 5.0 300 0.1 0.0 0.0 0.8 yhi 10.0 300 0.1 0.0 0.0 0.8
   fix xwalls all wall/reflect/stochastic cercignanilampis 2308 xlo 0.0 300 0.0 0.1 0.9 0.8 0.7 xhi EDGE 300 0.0 0.1 0 0.9 0.8 0.7 units box

Description
"""""""""""

Bound the simulation with one or more walls which reflect particles
in the specified group when they attempt to move through them.

Reflection means that if an atom moves outside the wall on a timestep
(e.g. due to the :doc:`fix nve <fix_nve>` command), then it is put back
inside the wall with a changed velocity.

This fix models treats the wall as a moving solid boundary with a
finite temperature, which can exchange energy with particles that
collide with it.  This is different than the simpler :doc:`fix wall/reflect <fix_wall_reflect>` command which models mirror
reflection.  For this fix, the post collision velocity of each
particle is treated stochastically.  The randomness can come from many
sources: thermal motion of the wall atoms, surface roughness, etc.
Three stochastic reflection models are currently implemented.

For rstyle *diffusive*\ , particles are reflected diffusively. Their
velocity distribution corresponds to an equilibrium distribution of
particles at the wall temperature.  No accommodation coefficients
are specified.

For rstyle *maxwell*\ , particle reflection is Maxwellian which means
partially diffusive and partially specular (:ref:`Maxwell <Maxwell>`).  A
single accommodation coeff is specified which must be between 0.0 and
1.0 inclusive.  It determines the fraction of the collision which is
diffusive versus specular.  An accommodation coefficient of 1.0 is fully
diffusive; a coefficient of 0.0 is fully specular.

For rstyle *cll*\ , particle collisions are computed by the
Cercignani/Lampis model.  See :ref:`CL <CL>` and :ref:`To <To>` for details.
Three accommodations coefficient are specified.  Each must be between
0.0 and 1.0 inclusive.  Two are velocity accommodation coefficients;
one is a normal kinetic energy accommodation.  The normal coeff is the
one corresponding to the normal of the wall itself.  For example if
the wall is *ylo* or *yhi*\ , *accomx* and *accomz* are the tangential
velocity accommodation coefficients, and *accomy* is the normal
kinetic energy accommodation coefficient.

The optional *units* keyword determines the distance units used to
define a wall position.  A *box* value selects standard distance units
as defined by the :doc:`units <units>` command, e.g. Angstroms for units
= real or metal.  A *lattice* value means the distance units are in
lattice spacings. The :doc:`lattice <lattice>` command must have been
previously used to define the lattice spacings.


----------


Restrictions
""""""""""""


This fix has the same limitations as the :doc:`fix wall/reflect <fix_wall_reflect>` command.  Any dimension (xyz) that
has a wall must be non-periodic.  It should not be used with rigid
bodies such as those defined by the :doc:`fix rigid <fix_rigid>`
command.  The wall velocity must lie on the same plane as the wall
itself.

This fix is part of the USER-MISC package.  It is only enabled if
LAMMPS was built with that package.  See the :doc:`Build package <Build_package>` doc page for more info.

Related commands
""""""""""""""""

:doc:`fix wall/reflect <fix_wall_reflect>`

Default
"""""""

The default for the units keyword is lattice.


----------


.. _Maxwell:



**(Maxwell)** J.C. Maxwell, Philos. Tans. Royal Soc. London, 157: 49-88
(1867).

.. _CL:



**(Cercignani)** C. Cercignani and M. Lampis. Trans. Theory
Stat. Phys. 1, 2, 101 (1971).

.. _To:



**(To)** Q.D. To, V.H. Vu, G. Lauriat, and
C. Leonard. J. Math. Phys. 56, 103101 (2015).


.. _lws: http://lammps.sandia.gov
.. _ld: Manual.html
.. _lc: Commands_all.html
+4 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ Build_settings.html
Build_package.html
Build_extras.html
Build_windows.html
Build_development.html
Run_head.html
Run_basics.html
Run_options.html
@@ -412,9 +413,11 @@ fix_wall_gran.html
fix_wall_gran_region.html
fix_wall_piston.html
fix_wall_reflect.html
fix_wall_reflect_stochastic.html
fix_wall_region.html
fix_wall_srd.html


lammps_commands_compute.html
compute.html
compute_modify.html
@@ -461,6 +464,7 @@ compute_gyration_shape.html
compute_gyration_shape_chunk.html
compute_heat_flux.html
compute_hexorder_atom.html
compute_hma.html
compute_improper.html
compute_improper_local.html
compute_inertia_chunk.html
Loading