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

:link(lws,http://www.cfdem.com)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)

:line

fix insert/pack command :h3
fix insert/stream command :h3

[Syntax:]

fix ID group-ID insert/pack   seed seed_value distributiontemplate dist-ID general_keywords general_values pack_keywords pack_values ... :pre
fix ID group-ID insert/stream seed seed_value distributiontemplate dist-ID general_keywords general_values stream_keywords stream_values ... :pre

ID, group-ID are documented in "fix"_fix.html command :ulb,l
insert/pack and insert/stream = style names of these fix commands :l
seed = obligatory keyword :l
seed_value = random # seed (positive integer) :l
distributiontemplate = obligatory keyword :l
dist-ID = ID of a "fix_particledistribution_discrete"_fix_particledistribution_discrete.html to be used for particle insertion :l
one or more general keyword/value pairs can be appended :l
general_keywords = {maxattampt} or {nparticles} or {mass} or {particlerate} or {massrate} or {insert_every} or {overlapcheck} or {all_in} or {vel} or {omega} :l
  {maxattempt} value = ma
    ma = max # of insertion attempts per atom (positive integer)
  {nparticles} values = np
    np =  number of particles to insert (positive integer)
  {mass} values = mp
    mp = mass of particles to be inserted (positive float)
  {particlerate} values = pr
    pr = particle inseration rate (particles/time units)
  {massrate} values = mr
    mr = mass inseration rate (mass/time units)
  {insert_every} value = once or ie
    once = value to signalise that isertion takes place only once (the step after the fix is issued)
    ie = every how many time-steps particles are inserted - insertion happens periodically (positive integer)
  {start} value = ts
    ts = time-step at which insertion should start (positive integer larger than current time-step)
  {overlapcheck} value = yes or no
  {all_in} value = yes or no
  {vel} values = vx vy vz
    vx = x-velocity at insertion (velocity units)
    vy = y-velocity at insertion (velocity units)
    vz = z-velocity at insertion (velocity units)
  {omega} values = omegax omegay omegaz
    omegax = x-comonent of angular velocity (1/time units)
    omegay = y-comonent of angular velocity (1/time units)
    omegaz = z-comonent of angular velocity (1/time units) :pre

following the general keyword/value section, one or more pack keyword/value pairs can be appended for the fix insert/pack command :l
pack_keywords = {region} or {volumefraction} or {ntry_mc} :l
  {region} value = region-ID
    region-ID = ID of the region where the particles will be generated (positive integer)
  {volumefraction} values = vol
    vol =  volume fraction for filling the volume (positive float, 0 < vol < 1)
  {ntry_mc} values = n
    n = number of Monte-Carlo steps for calculating the region's volume  (positive integer) :pre

following the general keyword/value section, one or more stream keyword/value pairs can be appended for the fix insert/stream command :l
stream_keywords = {insertion_face} or {extrude_length} :l
  {insertion_face} value = mesh-ID
    mesh-ID = ID of the "fix mesh/gran"_fix_mesh_gran.html to use as starting face for particle generation
  {extrude_length} values = L
    L =  length for extruding the insertion face in normal direction so to generate in insertion volume
  {duration} values = du
    du =  duration of insertion in time-steps :pre
:ule

[Examples:]

fix ins all insert/stream seed 1001 distributiontemplate pdd1 nparticles 5000 vel constant 0. -0.5 -2. particlerate 1000 overlapcheck yes insertion_face ins_mesh extrude_length 0.6 
fix ins all insert/pack seed 1001 distributiontemplate pdd1 insert_every once overlapcheck yes volumefraction 0.3 region mysphere ntry_mc 10000 :pre

[General description:]

Insert particles into a granular run either once or every few timesteps 
within a specified region until either np particles have been inserted
or the desired particle mass (mp) has been reached. 

This command must use the distributiontemplate keyword to refer to a 
"fix_particledistribution_discrete"_fix_particledistribution_discrete.html (defined by dist-fix-ID) that defines the properties of the 
inserted particles.

To specify the numbe of particles to be inserted, you must use either
the {nparticles} or the {mass} keyword (but not both). In the latter
case, the number of particles to be inserted is calculated from the
mass expectancy given by the particle distribution. The {start} keyword
can be used to set the time-step at which the insertion should start,

Likewise, you can use the {particlerate} or the {massrate} keyword (but not both) 
to control the insertion rate. Particles are not inserted continuously,
but in packets (for efficiency reasons). The frequency of the particle
insertion can be controlled by the keyword {insert_every}, which defines 
the number of time-steps between two insertions. Alternatively, by 
specifying {insert_every once}, particles are inserted only once (only 
applicable to fix insert/pack). The number of particles to be inserted
at each insertion event is calculated from the insertion rate and {insert_every}.

Inserted particles are assigned the atom type specified by the 
particledistribution defined via the "fix_particledistribution_discrete"_fix_particledistribution_discrete.html and
are assigned to 4 groups: the default group "all" and the group
specified in the fix insert command, as well as the groups specified 
in the "fix_particledistribution_discrete"_fix_particledistribution_discrete.html and "fix_particletemplate_sphere"_fix_particletemplate_sphere.html
command (all of which can also be "all").

The keyword {overlapcheck} controls if overlap is checked for at insertion,
both within the inserted particle package and with other existig particles. 
If this option is turned off, insertion will scale very well in parallel, 
otherwise not. Be aware that in case of no overlap check, highly overlapping
configurations will be produced, so you will have to relax these configurations.

If overlapcheck if performed, the number of insertion attempts per 
particle can be specified via the {maxattempt} keyword. Each timestep 
particles are inserted, the command will make up to a total of M tries 
to insert the new particles without overlaps, where 
M = # of inserted particles * ma.  If unsuccessful at completing all 
insertions, a warning will be printed.

The {all_in} flag determines if the particle is completely contained 
in the insertion region ({all_in yes}) or only the particle center 
({all_in no}). Currently {all_in yes} is not yet supported for all
types of insertion.

The initial velocity and rotational velocity can be controlled via the
{vel} and {omega} keywords.

[Description for fix insert/pack:]

This command must use the {region} keyword to define an insertion
volume. The specified region must have been previously defined with a
"region"_region.html command. Each timestep particles are inserted, 
they are placed randomly inside the insertion volume. 

The {volumefraction} option specifies what volume fraction of the insertion
volume will be filled with particles. The higher the value, the more
particles are inserted each timestep. Since inserted particles should not
overlap, the maximum volume fraction should be no higher than about 0.6. 

To determine the volume of the insertion region, a Monte Carlo approach
might be used for some cases where the volume is difficult to calculate
or where the volume calculation is simply not implemented by the region.
The {ntry_mc} keyword is used to control the number of MC tries that
are used for the volume calculation.

[Description for fix insert/stream:]

Each timestep particles are inserted, they are placed randomly inside
the insertion volume so as to mimic a stream of poured particles. The 
insertion volume is generated by extruding the insertion face as 
specified via {insertion_face} in the direction of the face normal.


The amount of extrusion is either calculated from the insertion frequency 
(keyword {insert_every}) or specified directly via keyword {extrude_length}.
In case the former case, you have the possibility to define the duration
of each insertion via the {duration} keyword. {duration} < {insert_every}
will generate a "pulsed" stream as opposed to a continuous stream.
Example: Setting {insert_every} = 1000 and {duration} = 600 will produce
a stream that pour material for 600 time-steps, will pause for 400 time-steps,
pour for another 600 time-steps etc. 
{duration} and {extrude_length} cannot be used together.

Particles are inserted again after enough time has elapsed
that the previously inserted particles have left the insertion
volume. Until the time these particles reach the insertion face, no
other forces affect the particles (pair forces, gravity etc.). Fix 
insert/stream internally issues a special integrator to take care 
of this. This procedure guarantees that the specified velocity, 
omega etc. values are perfectly met at the specified insertion face.

The larger the volume, the more particles that can be inserted at one
insertion step. Insertions will continue until the desired # of particles 
has been inserted.

NOTE: The insertion face must be a planar face, and the insertion
velocity projected on the face normal must be non-zero.

NOTE: Keywords {insert_every} and {extrude_length} may not be used
together

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

Information about this fix is written to "binary restart
files"_restart.html.  This means you can restart a simulation simulation
while inserting particles, when the restart file was written during the
insertion operation. 

None of the "fix_modify"_fix_modify.html options are relevant to this
fix.  No global scalar or vector or per-atom quantities are stored by
this fix for access by various "output
commands"_Section_howto.html#4_15.  No parameter of this fix can be
used with the {start/stop} keywords of the "run"_run.html command.
This fix is not invoked during "energy minimization"_minimize.html.

[Restrictions:]

The {overlapcheck} = 'yes' option performs an inherently serial operation
and will thus not scale well in parallel. For this reason, if you
want to generate large systems, you are advised to turn {overlapcheck} 
off and let the packing relax afterwards to generate a valid packing.

Keywords {duration} and {extrude_length} can not be used together.

Currently {all_in yes} is not yet supported for all types of insertion.

[Related commands:]

"fix_deposit"_fix_deposit.html, "fix_gravity"_fix_gravity.html,
"region"_region.html, "fix_pour_dev"_fix_pour_dev.html, "fix_pour"_fix_pour.html

[Default:]

The defaults are maxattempt = 50, all_in = no, overlapcheck = yes
vel = 0.0 0.0 0.0, omega = 0.0 0.0 0.0, start = next time-step,
duration = insert_every

For fix insert/pack, defaults are ntry_mc = 100000

For fix insert/stream, no further defaults apply
