Page MenuHomec4science

fix_srd.html
No OneTemporary

File Metadata

Created
Sun, Dec 29, 18:54

fix_srd.html

<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix srd command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID srd N groupbig-ID Tsrd hgrid seed keyword value ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>srd = style name of this fix command
<LI>N = reset SRD particle velocities every this many timesteps
<LI>groupbig-ID = ID of group of large particles that SRDs interact with
<LI>Tsrd = temperature of SRD particles (temperature units)
<LI>hgrid = grid spacing for SRD grouping (distance units)
<LI>seed = random # seed (positive integer)
</UL>
<UL><LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>lamda</I> or <I>collision</I> or <I>overlap</I> or <I>inside</I> or <I>exact</I> or <I>radius</I> or <I>bounce</I> or <I>search</I> or <I>cubic</I> or <I>shift</I> or <I>tstat</I> or <I>rescale</I>
<PRE> <I>lamda</I> value = mean free path of SRD particles (distance units)
<I>collision</I> value = <I>noslip</I> or <I>slip</I> = collision model
<I>overlap</I> value = <I>yes</I> or <I>no</I> = whether big particles may overlap
<I>inside</I> value = <I>error</I> or <I>warn</I> or <I>ignore</I> = how SRD particles which end up inside a big particle are treated
<I>exact</I> value = <I>yes</I> or <I>no</I>
<I>radius</I> value = rfactor = scale collision radius by this factor
<I>bounce</I> value = Nbounce = max # of collisions an SRD particle can undergo in one timestep
<I>search</I> value = sgrid = grid spacing for collision partner searching (distance units)
<I>cubic</I> values = style tolerance
style = <I>error</I> or <I>warn</I>
tolerance = fractional difference allowed (0 <= tol <= 1)
<I>shift</I> values = flag shiftseed
flag = <I>yes</I> or <I>no</I> or <I>possible</I> = SRD bin shifting for better statistics
<I>yes</I> = perform bin shifting each time SRD velocities are rescaled
<I>no</I> = no shifting
<I>possible</I> = shift depending on mean free path and bin size
shiftseed = random # seed (positive integer)
<I>tstat</I> value = <I>yes</I> or <I>no</I> = thermostat SRD particles or not
<I>rescale</I> value = <I>yes</I> or <I>no</I> or <I>rotate</I> or <I>collide</I> = rescaling of SRD velocities
<I>yes</I> = rescale during velocity rotation and collisions
<I>no</I> = no rescaling
<I>rotate</I> = rescale during velocity rotation, but not collisions
<I>collide</I> = rescale during collisions, but not velocity rotation
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 srd srd 10 big 1.0 0.25 482984
fix 1 srd srd 10 big 0.5 0.25 482984 collision slip search 0.5
</PRE>
<P><B>Description:</B>
</P>
<P>Treat a group of partilces as stochastic rotation dynamics (SRD)
particles that serve as a background solvent when interacting with big
(colloidal) particles in groupbig-ID. The SRD formalism is described
in <A HREF = "#Hecht">(Hecht)</A>. The key idea behind using SRD particles as a
cheap coarse-grained solvent is that SRD particles do not interact
with each other, but only with the solute particles, which in LAMMPS
can be spheroids, ellipsoids, or line segments, or triangles, or rigid
bodies containing multiple spherioids or ellipsoids or line segments
or triangles. The collision and rotation properties of the model
imbue the SRD particles with fluid-like properties, including an
effective viscosity. Thus simulations with large solute particles can
be run more quickly, to measure solute propoerties like diffusivity
and viscosity in a background fluid. The usual LAMMPS fixes for such
simulations, such as <A HREF = "fix_deform.html">fix deform</A>, <A HREF = "fix_viscosity.html">fix
viscosity</A>, and <A HREF = "fix_nvt_sllod.html">fix nvt/sllod</A>,
can be used in conjunction with the SRD model.
</P>
<P>For more details on how the SRD model is implemented in LAMMPS, <A HREF = "#Petersen">this
paper</A> describes the implementation and usage of pure SRD
fluids. <A HREF = "#Lechman">This paper</A>, which is nearly complete, describes
the implementation and usage of mixture systems (solute particles in
an SRD fluid). See the examples/srd directory for sample input
scripts using SRD particles in both settings.
</P>
<P>This fix does 2 things:
</P>
<P>(1) It advects the SRD particles, performing collisions between SRD
and big particles or walls every timestep, imparting force and torque
to the big particles. Collisions also change the position and
velocity of SRD particles.
</P>
<P>(2) It resets the velocity distribution of SRD particles via random
rotations every N timesteps.
</P>
<P>SRD particles have a mass, temperature, characteristic timestep
dt_SRD, and mean free path between collisions (lamda). The
fundamental equation relating these 4 quantities is
</P>
<PRE>lamda = dt_SRD * sqrt(Kboltz * Tsrd / mass)
</PRE>
<P>The mass of SRD particles is set by the <A HREF = "mass.html">mass</A> command
elsewhere in the input script. The SRD timestep dt_SRD is N times the
step dt defined by the <A HREF = "timestep.html">timestep</A> command. Big
particles move in the normal way via a time integration <A HREF = "fix.html">fix</A>
with a short timestep dt. SRD particles advect with a large timestep
dt_SRD >= dt.
</P>
<P>If the <I>lamda</I> keyword is not specified, the the SRD temperature
<I>Tsrd</I> is used in the above formula to compute lamda. If the <I>lamda</I>
keyword is specified, then the <I>Tsrd</I> setting is ignored and the above
equation is used to compute the SRD temperature.
</P>
<P>The characteristic length scale for the SRD fluid is set by <I>hgrid</I>
which is used to bin SRD particles for purposes of resetting their
velocities. Normally hgrid is set to be 1/4 of the big particle
diameter or smaller, to adequately resolve fluid properties around the
big particles.
</P>
<P>Lamda cannot be smaller than 0.6 * hgrid, else an error is generated
(unless the <I>shift</I> keyword is used, see below). The velocities of
SRD particles are bounded by Vmax, which is set so that an SRD
particle will not advect further than Dmax = 4*lamda in dt_SRD. This
means that roughly speaking, Dmax should not be larger than a big
particle diameter, else SRDs may pass thru big particles without
colliding. A warning is generated if this is the case.
</P>
<P>Collisions between SRD particles and big particles or walls are
modeled as a lightweight SRD point particle hitting a heavy big
particle of given diameter or a wall at a point on its surface and
bouncing off with a new velocity. The collision changes the momentum
of the SRD particle. It imparts a force and torque to the big
particle. It imparts a force to a wall. Static or moving SRD walls
are setup via the <A HREF = "fix_wall_srd.html">fix wall/srd</A> command. For the
remainder of this doc page, a collision of an SRD particle with a wall
can be viewed as a collision with a big particle of infinite radius
and mass.
</P>
<P>The <I>collision</I> keyword sets the style of collisions. The <I>slip</I>
style means that the tangential component of the SRD particle momentum
is preserved. Thus a force is imparted to a big particle, but no
torque. The normal component of the new SRD velocity is sampled from
a Gaussian distribution at temperature <I>Tsrd</I>.
</P>
<P>For the <I>noslip</I> style, both the normal and tangential components of
the new SRD velocity are sampled from a Gaussian distribution at
temperature <I>Tsrd</I>. Additionally, a new tangential direction for the
SRD velocity is chosen randomly. This collision style imparts torque
to a big particle. Thus a time integrator <A HREF = "fix.html">fix</A> that rotates
the big particles appropriately should be used.
</P>
<HR>
<P>The <I>overlap</I> keyword should be set to <I>yes</I> if two (or more) big
particles can ever overlap. This depends on the pair potential
interaction used for big-big interactions, or could be the case if
multiple big particles are held together as rigid bodies via the <A HREF = "fix_rigid.html">fix
rigid</A> command. If the <I>overlap</I> keyword is <I>no</I> and
big particles do in fact overlap, then SRD/big collisions can generate
an error if an SRD ends up inside two (or more) big particles at once.
How this error is treated is determined by the <I>inside</I> keyword.
Running with <I>overlap</I> set to <I>no</I> allows for faster collision
checking, so it should only be set to <I>yes</I> if needed.
</P>
<P>The <I>inside</I> keyword determines how a collision is treated if the
computation determines that the timestep started with the SRD particle
already inside a big particle. If the setting is <I>error</I> then this
generates an error message and LAMMPS stops. If the setting is <I>warn</I>
then this generates a warning message and the code continues. If the
setting is <I>ignore</I> then no message is generated. One of the output
quantities logged by the fix (see below) tallies the number of such
events, so it can be monitored. Note that once an SRD particle is
inside a big particle, it may remain there for several steps until it
drifts outside the big particle.
</P>
<P>The <I>exact</I> keyword determines how accurately collisions are computed.
A setting of <I>yes</I> computes the time and position of each collision as
SRD and big particles move together. A setting of <I>no</I> estimates the
position of each collision based on the end-of-timestep positions of
the SRD and big particle. If <I>overlap</I> is set to yes, the setting of
the <I>exact</I> keyword is ignored since time-accurate collisions are
needed.
</P>
<P>The <I>radius</I> keyword scales the effective size of big particles. If
big particles will overlap as they undergo dynamics, then this keyword
can be used to scale down their effective collision radius by an
amount <I>rfactor</I>, so that SRD particle will only collide with one big
particle at a time. For example, in a Lennard-Jones system at a
temperature of 1.0 (in reduced LJ units), the minimum separation
bewteen two big particles is as small as about 0.88 sigma. Thus an
<I>rfactor</I> value of 0.85 should prevent dual collisions.
</P>
<P>The <I>bounce</I> keyword can be used to limit the maximum number of
collisions an SRD particle undergoes in a single timestep as it
bounces between nearby big particles. Note that if the limit is
reached, the SRD can be left inside a big particle. A setting of 0 is
the same as no limit.
</P>
<HR>
<P>There are 2 kinds of bins created and maintained when running an SRD
simulation. The first are "SRD bins" which are used to bin SRD
particles and reset their velocities, as discussed above. The second
are "search bins" which are used to identify SRD/big particle
collisions.
</P>
<P>The <I>search</I> keyword can be used to choose a search bin size for
identifying SRD/big particle collisions. The default is to use the
<I>hgrid</I> parameter for SRD bins as the search bin size. Choosing a
smaller or large value may be more efficient, depending on the
problem. But, in a statistical sense, it should not change the
simulation results.
</P>
<P>The <I>cubic</I> keyword can be used to generate an error or warning when
the bin size chosen by LAMMPS creates SRD bins that are non-cubic or
different than the requested value of <I>hgrid</I> by a specified
<I>tolerance</I>. Note that using non-cubic SRD bins can lead to
undetermined behavior when rotating the velocities of SRD particles,
hence LAMMPS tries to protect you from this problem.
</P>
<P>LAMMPS attempts to set the SRD bin size to exactly <I>hgrid</I>. However,
there must be an integer number of bins in each dimension of the
simulation box. Thus the actual bin size will depend on the size and
shape of the overall simulation box. The actual bin size is printed
as part of the SRD output when a simulation begins.
</P>
<P>If the actual bin size in non-cubic by an amount exceeding the
tolerance, an error or warning is printed, depending on the style of
the <I>cubic</I> keyword. Likewise, if the actual bin size differs from
the requested <I>hgrid</I> value by an amount exceeding the tolerance, then
an error or warning is printed. The <I>tolerance</I> is a fractional
difference. E.g. a tolerance setting of 0.01 on the shape means that
if the ratio of any 2 bin dimensions exceeds (1 +/- tolerance) then an
error or warning is generated. Similarly, if the ratio of any bin
dimension with <I>hgrid</I> exceeds (1 +/- tolerance), then an error or
warning is generated.
</P>
<P>IMPORTANT NOTE: The fix srd command can be used with simluations the
size and/or shape of the simulation box changes. This can be due to
non-periodic boundary conditions or the use of fixes such as the <A HREF = "fix_deform.html">fix
deform</A> or <A HREF = "fix_wall_srd.html">fix wall/srd</A> commands
to impose a shear on an SRD fluid or an interaction with an external
wall. If the box size changes then the size of SRD bins must be
recalculated every reneighboring. This is not necessary if only the
box shape changes. This re-binning is always done so as to fit an
integer number of bins in the current box dimension, whether it be a
fixed, shrink-wrapped, or periodic boundary, as set by the
<A HREF = "boundary.html">boundary</A> command. If the box size or shape changes,
then the size of the search bins must be recalculated avery
reneighboring. Note that changing the SRD bin size may alter the
properties of the SRD fluid, such as its viscosity.
</P>
<P>The <I>shift</I> keyword determines whether the coordinates of SRD
particles are randomly shifted when binned for purposes of rotating
their velocities. When no shifting is performed, SRD particles are
binned and the velocity distribution of the set of SRD particles in
each bin is adjusted via a rotation operator. This is a statistically
valid operation if SRD particles move sufficiently far between
successive rotations. This is determined by their mean-free path
lamda. If lamda is less than 0.6 of the SRD bin size, then shifting
is required. A shift means that all of the SRD particles are shifted
by a vector whose coordinates are chosen randomly in the range [-1/2
bin size, 1/2 bin size]. Note that all particles are shifted by the
same vector. The specified random number <I>shiftseed</I> is used to
generate these vectors. This operation sufficiently randomizes which
SRD particles are in the same bin, even if lamda is small.
</P>
<P>If the <I>shift</I> flag is set to <I>no</I>, then no shifting is performed, but
bin data will be communicated if bins overlap processor boundaries.
An error will be generated if lamda < 0.6 of the SRD bin size. If the
<I>shift</I> flag is set to <I>possible</I>, then shifting is performed only if
lamda < 0.6 of the SRD bin size. A warning is generated to let you
know this is occurring. If the <I>shift</I> flag is set to <I>yes</I> then
shifting is performed regardless of the magnitude of lamda. Note that
the <I>shiftseed</I> is not used if the <I>shift</I> flag is set to <I>no</I>, but
must still be specified.
</P>
<P>Note that shifting of SRD coordinates requires extra communication,
hence it should not normally be enabled unless required.
</P>
<P>The <I>tstat</I> keyword will thermostat the SRD particles to the specified
<I>Tsrd</I>. This is done every N timesteps, during the velocity rotation
operation, by rescaling the thermal velocity of particles in each SRD
bin to the desired temperature. If there is a streaming velocity
associated with the system, e.g. due to use of the <A HREF = "fix_deform.html">fix
deform</A> command to perform a simulation undergoing
shear, then that is also accounted for. The mean velocity of each bin
of SRD particles is set to the position-dependent streaming velocity,
based on the coordinates of the center of the SRD bin. Note that
collisions of SRD particles with big particles or walls has a
thermostatting effect on the colliding particles, so it may not be
necessary to thermostat the SRD particles on a bin by bin basis in
that case. Also note that for streaming simulations, if no
thermostatting is performed (the default), then it may take a long
time for the SRD fluid to come to equilibrium with a velocity profile
that matches the simulation box deformation.
</P>
<P>The <I>rescale</I> keyword enables rescaling of an SRD particle's velocity
if it would travel more than 4 mean-free paths in an SRD timestep. If
an SRD particle exceeds this velocity it is possible it will be lost
when migrating to other processors or that collisions with big
particles will be missed, either of which will generate errors. Thus
the safest mode is to run with rescaling enabled. However rescaling
removes kinetic energy from the system (the particle's velocity is
reduced). The latter will not typically be a problem if
thermostatting is enabled via the <I>tstat</I> keyword or if SRD collisions
with big particles or walls effectively thermostat the system. If you
wish to turn off rescaling (on is the default), e.g. for a pure SRD
system with no thermostatting so that the temperature does not decline
over time, the <I>rescale</I> keyword can be used. The <I>no</I> value turns
rescaling off during collisions and the per-bin velocity rotation
operation. The <I>collide</I> and <I>rotate</I> values turn it on for
one of the operations and off for the other.
</P>
<HR>
<P>IMPORTANT NOTE: This fix is normally used for simulations with a huge
number of SRD particles relative to the number of big particles,
e.g. 100 to 1. In this scenario, computations that involve only big
particles (neighbor list creation, communication, time integration)
can slow down dramatically due to the large number of background SRD
particles.
</P>
<P>Three other input script commands will largely overcome this effect,
speeding up an SRD simulation by a significant amount. These are the
<A HREF = "atom_modify.html">atom_modify first</A>, <A HREF = "neigh_modify.html">neigh_modify
include</A>, and <A HREF = "comm_modify.html">comm_modify group</A>
commands. Each takes a group-ID as an argument, which in this case
should be the group-ID of the big solute particles.
</P>
<P>Additionally, when a <A HREF = "pair_style.html">pair_style</A> for big/big particle
interactions is specified, the <A HREF = "pair_coeff.html">pair_coeff</A> command
should be used to turn off big/SRD interactions, e.g. by setting their
epsilon or cutoff length to 0.0.
</P>
<P>The "delete_atoms overlap" command may be useful in setting up an SRD
simulation to insure there are no initial overlaps between big and SRD
particles.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix.
</P>
<P>This fix tabulates several SRD statistics which are stored in a vector
of length 12, which can be accessed by various <A HREF = "Section_howto.html#howto_15">output
commands</A>. The vector values calculated
by this fix are "intensive", meaning they do not scale with the size
of the simulation. Technically, the first 8 do scale with the size of
the simulation, but treating them as intensive means they are not
scaled when printed as part of thermodyanmic output.
</P>
<P>These are the 12 quantities. All are values for the current timestep,
except for quantity 5 and the last three, each of which are
cummulative quantities since the beginning of the run.
</P>
<UL><LI>(1) # of SRD/big collision checks performed
<LI>(2) # of SRDs which had a collision
<LI>(3) # of SRD/big colllisions (including multiple bounces)
<LI>(4) # of SRD particles inside a big particle
<LI>(5) # of SRD particles whose velocity was rescaled to be < Vmax
<LI>(6) # of bins for collision searching
<LI>(7) # of bins for SRD velocity rotation
<LI>(8) # of bins in which SRD temperature was computed
<LI>(9) SRD temperature
<LI>(10) # of SRD particles which have undergone max # of bounces
<LI>(11) max # of bounces any SRD particle has had in a single step
<LI>(12) # of reneighborings due to SRD particles moving too far
</UL>
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
the <A HREF = "run.html">run</A> command. This fix is not invoked during <A HREF = "minimize.html">energy
minimization</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This command can only be used if LAMMPS was built with the SRD
package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_wall_srd.html">fix wall/srd</A>
</P>
<P><B>Default:</B>
</P>
<P>The option defaults are lamda inferred from Tsrd, collision = noslip,
overlap = no, inside = error, exact = yes, radius = 1.0, bounce = 0,
search = hgrid, cubic = error 0.01, shift = no, tstat = no, and
rescale = yes.
</P>
<HR>
<A NAME = "Hecht"></A>
<P><B>(Hecht)</B> Hecht, Harting, Ihle, Herrmann, Phys Rev E, 72, 011408 (2005).
</P>
<A NAME = "Petersen"></A>
<P><B>(Petersen)</B> Petersen, Lechman, Plimpton, Grest, in' t Veld, Schunk, J
Chem Phys, 132, 174106 (2010).
</P>
<A NAME = "Lechman"></A>
<P><B>(Lechman)</B> Lechman, et al, in preparation (2010).
</P>
</HTML>

Event Timeline