fix wall/gran/sdf#
Syntax#
fix ID group-ID wall/gran/sdf sdf mesh_sdf_id [store_force yes|no] model contact_model tangential tangential_model [cohesion cohesion_model] [rolling_friction rolling_model] [surface surface_model] keyword value ...
ID, group-ID are documented in fix command.
wall/gran/sdf= style name of this fix command.sdf mesh_sdf_id= ID of the corresponding fix mesh/surface/sdf defining the boundary wall.store_force= optional keyword to record per-atom wall contact forces:yes= store the contact force vector exerted on each particle into a per-atom property namedwallforce_<id>.no= do not store per-atom forces (default).
Contact Model Specification:
fix wall/gran/sdfintegrates directly with the modular contact model engine of WASHLIGGGHTS. The following model components are supported:model contact_model= normal contact model:tangential tangential_model= tangential friction model:history,no_history
cohesion cohesion_model= (optional) cohesive interaction model:sjkr(Simplified JKR cohesion)
rolling_friction rolling_model= (optional) rolling friction model:epsd, epsd2, epsd2/scalingviscoplastic
surface surface_model= (optional) particle surface geometry model:superquadric (for non-spherical superquadric particles)
Examples#
# Non-linear Hertzian contact with tangential history
fix zw all wall/gran/sdf sdf cad model hertz tangential history
# Linear Hookean contact with stored wall forces
fix zw all wall/gran/sdf sdf cad store_force yes model hooke tangential history
# Hertzian contact with SJKR cohesion
fix zw all wall/gran/sdf sdf cad model hertz tangential history cohesion sjkr
# Hookean contact with CDT rolling friction
fix zw all wall/gran/sdf sdf cad model hooke tangential history rolling_friction cdt
# Adhesive contact using full JKR model with scaling
fix zw all wall/gran/sdf sdf cad model JKR/scaling tangential history/JKR/scaling
# Concurrent execution of two SDF meshes with independent kinematics
fix cad_rot all mesh/surface/sdf file rotor.stl type 1 dx 0.005 solid inside
fix move_rot all move/mesh mesh cad_rot rotate origin 0 0 0 axis 0 0 1 period 1.0
fix wall_rot all wall/gran/sdf sdf cad_rot model hooke tangential history
fix cad_chute all mesh/surface/sdf file chute.stl type 1 dx 0.005 thickness 0.01
fix wall_chute all wall/gran/sdf sdf cad_chute model hertz tangential history
Description#
fix wall/gran/sdf evaluates contact, friction, cohesion, and rolling resistance forces between granular particles and complex geometry walls represented by a Signed Distance Function (SDF) grid (fix mesh/surface/sdf).
Unlike traditional mesh wall interaction fixes that traverse triangle lists or bounding volume hierarchies per particle, fix wall/gran/sdf queries a precomputed 3D Cartesian Eulerian distance field. This provides:
\(O(1)\) constant-time contact evaluation, independent of the number of triangles in the CAD mesh.
Elimination of edge and corner penetration artifacts, where particles could otherwise slip through triangle boundaries or experience artificial force spikes.
Seamless kinematic integration with dynamic moving meshes (fix move/mesh).
Full support for modular contact models, matching standard mesh walls (fix wall/gran) to machine precision while running at higher performance.
High-performance evaluation pipeline:
Lazy pre-filtering: Fast scalar distance queries (using hardware-accelerated FMA trilinear interpolation) bypass gradient and normal evaluations for non-colliding particles.
Static mesh fast-path: Automatically skips coordinate frame rotations and cross products when the mesh has no active motion.
Near-wall candidate caching: Particle candidate lists are synchronized with neighbor list rebuilds, avoiding full-domain atom loops on intermediate timesteps.
Mathematical Formulation#
Distance and Surface Normal Evaluation: For a particle with centroid position \(\mathbf{x}_i\) and radius \(r_i\), the local signed distance \(\phi\) and gradient \(\nabla \phi\) are evaluated from the 3D SDF grid via trilinear interpolation:
\[\mathbf{n} = \frac{\nabla \phi}{\|\nabla \phi\|}\]The normal overlap \(\delta_n\) is computed as:
\[\delta_n = r_i - \phi\]Contact occurs when particles intersect the wall (\(\phi \le r_i\)) or are within the interaction distance factor \(d_{\text{contact}}\) (when cohesive or non-contact force models are active):
\[\phi \le d_{\text{contact}} \cdot r_i\]Relative Contact Velocity and Contact Arm: The contact arm vector from the particle center to the wall surface point is:
\[\mathbf{r}_{\text{arm}} = r_{\text{eff}} \mathbf{n}, \quad \text{with } r_{\text{eff}} = \max(10^{-6} r_i, \phi)\]The relative velocity at the particle-wall contact point accounts for particle translation, particle rotation, and the analytical surface velocity \(\mathbf{v}_{\text{wall}}\) of moving meshes (fix move/mesh):
\[\mathbf{v}_{\text{contact}} = \mathbf{v}_i + \boldsymbol{\omega}_i \times \mathbf{r}_{\text{arm}} - \mathbf{v}_{\text{wall}}\]The normal and tangential velocity components are:
\[v_n = \mathbf{v}_{\text{contact}} \cdot \mathbf{n}, \quad \mathbf{v}_t = \mathbf{v}_{\text{contact}} - v_n \mathbf{n}\]Modular Contact Force Evaluation: All force evaluations (normal elasticity, viscous damping, tangential history displacement integration, Coulomb yield criteria, cohesive attraction, and rolling resistance torques) are calculated by the modular contact model engine according to the selected
model,tangential,cohesion, androlling_frictionsettings.Superquadric Surface Contact Resolution: When
surface superquadricis specified for non-spherical particles (gran surface superquadric model withatom_style superquadric), contact is resolved using exact superquadric geometry rather than bounding spheres:The local tangent contact plane is constructed at the nearest SDF wall point \(\mathbf{x}_w = \mathbf{x}_i - \phi \mathbf{n}\) with the plane normal directed toward the particle \(-\mathbf{n}\).
The superquadric particle’s plane-intersection solver evaluates whether the non-spherical particle surface physically intersects this tangent plane.
The exact contact point \(\mathbf{x}_c\) on the superquadric surface and the projected normal overlap \(\delta_n = d_{\text{proj}}\) are computed:
\[\delta_n = d_{\text{proj}}\]Eccentric normal forces generate physical contact torque about the particle centroid:
\[\boldsymbol{\tau}_c = (\mathbf{x}_c - \mathbf{x}_i) \times \mathbf{F}_n\]
Multi-Mesh Support & Independent Kinematics#
Multiple independent fix wall/gran/sdf instances can be active in the same simulation:
Independent Meshes: Each fix binds to a separate fix mesh/surface/sdf via
sdf <mesh_sdf_id>.Independent Motion: Each mesh can follow completely distinct kinematics via fix move/mesh (e.g., one rotating, one translating linearly, and another oscillating). Surface velocities and coordinate transformations are applied independently without mutual interference.
Isolated Histories: Per-atom contact histories (e.g.
history_<id>) and reaction force vectors are tracked separately per fix instance with zero cross-talk.Restarts: Contact histories are serialized into binary restart files, ensuring bit-exact continuation across simulation checkpoints.
Diagnostics and Output Info#
This fix computes a global vector with 7 components accessible via f_ID[index] in thermo_style custom or fix ave/time:
f_ID[1],f_ID[2],f_ID[3]: Total reaction force exerted on the wall by particles (\(F_x, F_y, F_z\)).f_ID[4],f_ID[5],f_ID[6]: Total reaction torque exerted on the wall by particles (\(T_x, T_y, T_z\)).f_ID[7]: Total number of active particle-wall contacts.
When store_force yes is specified, the per-atom contact force is stored in a vector property wallforce_<id> accessible in dump custom:
dump dmp all custom 500 post/dump.*.txt id type x y z f_wallforce_zw[1] f_wallforce_zw[2] f_wallforce_zw[3]
Coordination and Wall Contact Tallying#
fix wall/gran/sdf tracks active particle-wall contact intersections at each timestep. When compute contact/atom and contact/atom/gran or compute contact/atom/gran is invoked with the wall yes option, active contacts with this SDF wall are automatically tallied into each particle’s total coordination count.
Local Contact Property Extraction (compute wall/gran/local)#
fix wall/gran/sdf supports per-contact detailed data extraction via compute wall/gran/local. The following local quantities are supported:
contactPoint: 3D Cartesian coordinates of the contact point on the SDF wall surface.delta: Scalar penetration overlap \(\delta_n\).force: Normal and tangential contact force vectors exerted on each particle.vel: Relative velocity components evaluated at the contact point.pos: Particle centroid position coordinates.
Both spherical particles and non-spherical superquadric particles (gran surface superquadric model) are fully supported, using the true surface contact normal vector and accurate eccentric force/torque decompositions.
Restrictions#
Must reference a valid fix mesh/surface/sdf via the
sdfkeyword.Material properties required by the selected contact models (e.g. youngsModulus, poissonsRatio, coefficientRestitution, coefficientFriction, cohesionEnergyDensity, characteristicVelocity) must be defined via fix property/global.