fix insert (Base Insertion Engine)#
Overview#
In WASHLIGGGHTS (and LIGGGHTS), fix insert serves as the abstract base class for all particle insertion commands. While fix insert is generally not invoked directly by itself in simulation scripts, all of its keywords and underlying insertion routines are inherited by its derived commands:
fix insert/pack — Generates particle packings within a geometric region up to a target volume fraction, particle count, or mass.
fix insert/pack/multpos — WASHLIGGGHTS extension that inserts packs of particles at multiple explicit coordinate positions (
atP).fix insert/stream — Streams particles continuously into the simulation domain across a mesh or geometric face.
fix insert/rate/region — Periodically inserts particles into a 3D region at a specified rate.
WASHLIGGGHTS extends the base fix insert engine with the Superquadric Shape Catalogue feature via the keyword superquadric_shape_file. This allows inserting polydisperse non-spherical superquadric particles whose geometrical dimensions, blockiness parameters, material densities, and occurrence frequencies are defined in an external catalogue file.
Syntax#
The general keywords supported by fix insert (and therefore all derived insert/* commands) are:
fix ID group-ID insert/style seed seed_value distributiontemplate dist-ID [general_keywords general_values ...] [style_specific_keywords ...]
ID, group-ID are documented in fix command.
insert/style = style name of the derived insertion fix (e.g.
insert/pack,insert/stream,insert/rate/region,insert/pack/multpos).seed seed_value = obligatory random number generator seed (prime integer greater than 10000).
distributiontemplate dist-ID = obligatory ID of a fix particledistribution/discrete defining the insertion template.
General Keywords Inherited from Base Fix Insert#
verbose yes or no = Controls screen logging of insertion statistics.
maxattempt ma = Maximum number of insertion attempts per particle (positive integer, default = 50).
insert_every once or ie = Insertion timestep frequency (positive integer or once).
start ts = Starting timestep for particle insertion.
overlapcheck yes or no = Enable/disable overlap detection upon particle placement.
all_in yes or no = Require entire bounding sphere (yes) or only particle center (no) to reside within insertion boundary.
random_distribute exact or uncorrelated = Strategy for distributing insertion count across MPI processes.
compress_tags yes or no = Re-assign atom IDs consecutively upon insertion (default = no).
vel constant | uniform | gaussian = Prescribe initial translational velocities.
orientation random | template | constant q1 q2 q3 q4 = Prescribe initial particle orientation quaternions.
omega constant ox oy oz = Prescribe initial angular velocity.
set_property varname val = Initialize per-particle scalar property from a fix property/atom.
WASHLIGGGHTS Exclusive Keyword#
superquadric_shape_file filename
filename = Name of the custom shape catalogue text file containing superquadric parameter definitions and their statistical frequencies.
Shape Catalogue for Superquadric Particles#
Background & Motivation#
In standard LIGGGHTS, non-spherical superquadric particles are generated via fix particletemplate/superquadric. Standard templates only support a single constant shape or uncorrelated random distributions (uniform/Gaussian) for semi-axes \((a, b, c)\) and blockiness exponents \((n_1, n_2)\).
However, real particulate systems (e.g., crushed rocks, gravel, agricultural grains, pharmaceutical tablets, catalyst pellets) possess correlated shape attributes, such as:
Distinct aspect ratios (\(b/a\), \(c/a\)) that correlate with particle size.
Varying blockiness/angularity across different sieve fractions.
Shape-dependent densities or composite compositions.
Empirical particle size and shape distributions (PSSD) obtained from X-ray micro-computed tomography (\(\mu\text{-CT}\)) or dynamic image analysis (e.g., QICPIC).
Simulating such systems in standard LIGGGHTS would require defining hundreds or thousands of individual fix particletemplate/superquadric commands and linking them into a massive fix particledistribution/discrete, which is tedious, inefficient, and error-prone.
WASHLIGGGHTS solves this with the Shape Catalogue feature. Users define a single bounding template in the input script and provide a catalogue text file listing an arbitrary number of distinct superquadric particle shapes and their relative frequencies.
Catalogue File Format#
The catalogue file is a plain ASCII text file. Blank lines are ignored. Each valid line defines one unique particle shape with 7 space-separated numerical values:
a b c n1 n2 density frequency
Parameter |
Type / Unit |
Description |
|---|---|---|
|
Float > 0 (length) |
Semi-axis length along the local x-axis. |
|
Float > 0 (length) |
Semi-axis length along the local y-axis. |
|
Float > 0 (length) |
Semi-axis length along the local z-axis. |
|
Float >= 2.0 |
North-South blockiness exponent (meridional curvature; controls roundness along z-axis). |
|
Float >= 2.0 |
East-West blockiness exponent (equatorial curvature; controls cross-section in xy-plane). |
|
Float > 0 (density) |
Material mass density of particles possessing this specific shape (\(\text{kg/m}^3\)). |
|
Float >= 0 |
Relative statistical weight / frequency of occurrence in the mixture. |
Example Shape Catalogue File (superquadric_shapes.dat):
# Semi-axes [m] Blockiness [-] Density [kg/m^3] Frequency [-]
0.0050 0.0040 0.0030 2.5 2.5 2500.0 15.0
0.0065 0.0035 0.0025 4.0 2.0 2600.0 30.0
0.0040 0.0040 0.0040 2.0 2.0 2450.0 10.0
0.0080 0.0060 0.0040 3.5 3.5 2550.0 45.0
Note
Frequencies do not need to be normalized to 1.0; WASHLIGGGHTS automatically accumulates frequencies to compute the cumulative distribution function (CDF).
Densities must be strictly positive (
density > 0), and frequencies cannot be negative (frequency >= 0).
Internal Processing & Insertion Workflow#
When superquadric_shape_file is specified, WASHLIGGGHTS executes the following workflow:
Initialization Phase (``FixInsert::init``): * The shape file is parsed, loading all shapes into internal memory vectors. * Total frequency weight \(\Omega_{\text{tot}} = \sum_{k} \omega_k\) and the Cumulative Distribution Function (CDF) array \(\text{CDF}_k = \sum_{j=1}^{k} \omega_j\) are constructed. * On MPI rank 0, the loaded catalogue is printed to the terminal screen and logfile, displaying each shape’s index, dimensions, blockiness, density, and cumulative probability.
Template Positioning & Spatial Broad-Phase Placement: * At each insertion timestep,
FixInsertcalls the discrete distribution to place particles according to the specifiedfix particletemplate/superquadric. * Broad-phase overlap checks and domain bounding boxes use the template bounding sphere.In-situ Shape Realization (``FixInsert::pre_exchange``):
Immediately after placement, WASHLIGGGHTS intercepts all newly inserted local particles.
For each particle \(i\):
A uniform random deviate \(r \in [0, \Omega_{\text{tot}})\) is drawn.
Binary search (
std::lower_bound) identifies the sampled shape index from the catalogue CDF.The particle’s semi-axes \((a, b, c)\), blockiness exponents \((n_1, n_2)\), and density are assigned.
The solver calculates the exact superquadric properties using analytical/numerical integration routines:
Volume: \(V_i = \text{volume\_superquadric}(a, b, c, n_1, n_2)\)
Mass: \(m_i = V_i \times \rho_i\)
Principal Moments of Inertia: \(\mathbf{I}_i = \text{inertia\_superquadric}(a, b, c, n_1, n_2, \rho_i)\)
Surface Area: \(A_i = \text{area\_superquadric}(a, b, c, n_1, n_2)\)
Important
Bounding Sphere Rule:
The template superquadric specified in fix particletemplate/superquadric must have bounding sphere dimensions that are equal to or larger than the maximum bounding sphere among all shapes in the catalogue. If a shape in the catalogue exceeds the template bounding sphere, WASHLIGGGHTS throws an error:
Fix insert: Custom superquadric radius (...) from catalogue exceeds the template bounding sphere (...). Increase the template dimensions.
Examples#
Example 1: Packing a Polydisperse Superquadric Bed with fix insert/pack#
atom_style superquadric
atom_modify map array
# Contact and surface physics
pair_style gran model hertz tangential history rolling_friction epsd2 surface superquadric
pair_coeff * *
# Time integration
fix integr all nve/superquadric integration_scheme 1
# Insertion region
region reg_box block -0.05 0.05 -0.05 0.05 0.0 0.10 units box
# Define bounding template (dimensions must encapsulate all catalogue shapes)
fix pts_sq all particletemplate/superquadric 15485863 atom_type 1 &
density constant 2500 &
shape constant 0.008 0.006 0.004 &
blockiness constant 3.5 3.5
# Discrete distribution referencing template
fix pdd all particledistribution/discrete 32452843 1 pts_sq 1.0
# Insert packing using shape catalogue
fix ins all insert/pack seed 49979687 distributiontemplate pdd &
insert_every once overlapcheck yes all_in yes &
region reg_box particles_in_region 1500 &
orientation random &
superquadric_shape_file superquadric_shapes.dat
Example 2: Continuous Inflow with fix insert/stream#
# Inflow face mesh
fix ins_mesh all mesh/surface/planar file inlet.stl type 1
# Continuous stream insertion with shape catalogue
fix ins_flow all insert/stream seed 71239841 distributiontemplate pdd &
nparticles 10000 particlerate 500 insert_every 1000 &
overlapcheck yes all_in yes &
mesh ins_mesh &
vel constant 0.0 0.0 -0.5 &
superquadric_shape_file superquadric_shapes.dat
Restrictions#
The
superquadric_shape_fileoption requires WASHLIGGGHTS to be compiled with superquadric particle support (-DSUPERQUADRIC_ACTIVE_FLAG) and the simulation to useatom_style superquadric.Overlap checks performed during insertion evaluate non-spherical superquadrics or bounding spheres based on the insertion fix settings.
When using GPU acceleration (via CUDA narrow-phase contact solver), particles generated through the shape catalogue are fully supported and automatically evaluated in FP64 on the GPU.