fix lebc#
Syntax#
fix ID group-ID lebc keyword value ...
ID, group-ID are documented in fix command
lebc = style name of this fix command
zero or more keyword/value pairs may be appended
keyword = lebc_direction or shear_direction or shear_rate or initial_offset or deactivate_zero_vcm or trigger_factor or isobaric or p_target or bulk_modulus or tau_p or p_every or p_direction or p_max_change or p_alpha
lebc_direction value = x or y or z
direction of the Lees-Edwards boundary normal
shear_direction value = x or y or z
direction of the sliding boundary shear velocity
shear_rate value = shear rate (1/time units)
initial_offset value = initial displacement offset (distance units)
deactivate_zero_vcm value = yes or no
yes = do not subtract the center-of-mass velocity of the group
no = calculate and subtract the center-of-mass velocity of the group
trigger_factor value = factor (default 0.25)
factor multiplied by neighbor skin distance to trigger neighbor list rebuilds based on accumulated Lees-Edwards boundary shear displacement
isobaric value = yes or no (default no)
enables native Berendsen isobaric barostat for constant-pressure or constant-normal-stress shear flows
p_target (or target_pressure) value = target normal stress or pressure in pressure units (Pa, must be \(\ge 0\))
bulk_modulus (or modulus) value = effective granular bulk modulus in pressure units (Pa, must be \(> 0\))
tau_p (or tau) value = barostat relaxation time constant in time units (s, must be \(> 0\))
p_every (or every) value = update frequency for pressure evaluation and box rescaling in timesteps (default 10, must be \(\ge 1\))
p_direction value = lebc or x or y or z or iso (default lebc)
lebc = rescales the domain along the Lees-Edwards boundary normal (lebc_direction)
x, y, z = rescales along the specified Cartesian axis
iso = rescales all 3 box dimensions isotropically
p_max_change value = maximum fractional box length change (strain limit) allowed per barostat step (default 0.01, must be \(> 0\))
p_alpha (or p_filter) value = exponential moving average filter weight for measured pressure in \((0, 1]\) (default 0.5)
Examples#
# Standard Lees-Edwards shear flow with neighbor rebuild trigger
fix 1 all lebc lebc_direction y shear_direction x shear_rate 0.1 trigger_factor 0.25
# Constant-normal-stress shear flow using native isobaric barostat
fix 1 all lebc lebc_direction z shear_direction x shear_rate 0.05 &
isobaric yes p_target 200.0 bulk_modulus 2.0e4 tau_p 0.005 p_every 10 p_direction z p_alpha 0.5
Description#
Applies Lees-Edwards boundary conditions (LEBC) to the simulation domain to simulate sheared systems under constant volume or constant normal stress.
This fix modifies the boundary conditions to allow sliding periodic boundaries. The boundary normal is specified by the lebc_direction keyword, while the sliding direction is defined by the shear_direction keyword. The relative velocity of the boundaries is controlled by the shear_rate.
An initial displacement of the periodic boundaries can be specified using the initial_offset keyword. If deactivate_zero_vcm is set to no, the fix computes the center-of-mass velocity of the specified particle group and subtracts it from their velocities, effectively keeping the center of mass stationary.
Neighbor List Rebuild Trigger (trigger_factor)#
In quasi-static or low-shear-rate flows, particles may remain nearly stationary in their local frames, meaning their individual displacements do not exceed the standard half-skin neighbor list rebuild criterion. However, the Lees-Edwards periodic boundaries displace continuously at relative speed \(v_{\text{shear}} = \dot{\gamma} \cdot L_{\text{lebc}}\).
Without displacement tracking, ghost particles across the periodic boundary can cross into the interaction zone beyond the skin layer without triggering a neighbor list rebuild. This can lead to unphysical contact overlaps and kinetic energy explosions upon eventual rebuild.
The trigger_factor parameter continuously tracks accumulated boundary displacement in post_integrate():
When \(\Delta d_{\text{accum}} \ge \text{trigger\_factor} \times \text{skin}\) (default factor 0.25), a neighbor list rebuild is immediately requested for the current timestep, and the displacement accumulator is reset to zero.
Native Isobaric Barostat (isobaric)#
Granular shear flows (such as direct shear, ring shear, or planar simple shear tests) often require maintaining a constant confining normal stress \(\sigma_{nn} = P_{\text{target}}\) while applying continuous shear strain.
When isobaric yes is set, a native Berendsen-type barostat dynamically adjusts the simulation box dimension every p_every timesteps:
Scheduled Virial Pressure Evaluation: Internal computes for kinetic temperature and virial stress are automatically created and scheduled to evaluate only on barostat steps (\(\text{step} \pmod{p\_every} == 0\)), eliminating unnecessary computational overhead on intermediate steps.
Exponential Moving Average Smoothing: Instantaneous virial normal stress in granular systems can fluctuate significantly. The measured pressure \(P_{\text{meas}}\) (either the normal stress along p_direction or hydrostatic pressure \((P_{xx} + P_{yy} + P_{zz})/3\) for iso) is smoothed using an exponential moving average:
\[P_{\text{current}}(t) = (1 - \alpha) P_{\text{current}}(t - \Delta t_{\text{baro}}) + \alpha P_{\text{meas}}(t)\]where \(\alpha\) is p_alpha (default 0.5) and \(\Delta t_{\text{baro}} = p\_every \times \Delta t\).
Box Strain and Rescaling: The strain rate \(\dot{\epsilon}\) and dimension scale factor \(\mu\) are computed via:
\[\dot{\epsilon} = \frac{P_{\text{current}} - P_{\text{target}}}{K \cdot \tau_p}\]\[\mu = 1 + \dot{\epsilon} \cdot \Delta t_{\text{baro}}\]where \(K\) is the granular bulk_modulus and \(\tau_p\) is the relaxation time tau_p. The scale factor \(\mu\) is clamped to \([1 - p\_max\_change, 1 + p\_max\_change]\) to guarantee numerical stability.
Affine Coordinate Rescaling & Multisphere Support: When \(|\mu - 1| > 10^{-12}\), the domain boundary along p_direction (or all three dimensions by \(\mu^{1/3}\) if iso) is rescaled. Particle coordinates are updated affinely. For rigid multisphere assemblies (fix multisphere), rigid body center-of-mass positions are also affinely rescaled, and neighbor lists are scheduled for rebuild on the next timestep.
Restart, fix_modify, output, run start/stop, minimise info#
State information (such as accumulated boundary displacement and smoothed pressure) is preserved in binary restart files. None of the fix_modify options are relevant to this fix.
When isobaric yes is enabled, this fix computes a global scalar and a global vector of length 4:
Global scalar
f_ID: Current smoothed pressure / normal stress \(P_{\text{current}}\) (pressure units, e.g. Pa).Global vector
f_ID[1]: Current smoothed pressure \(P_{\text{current}}\) (Pa).Global vector
f_ID[2]: Target pressure \(P_{\text{target}}\) (Pa).Global vector
f_ID[3]: Current box dimension length \(L_{\text{dim}}\) along the rescaling axis (or total domain volume \(V = L_x L_y L_z\) if p_direction is iso).Global vector
f_ID[4]: Box rescaling factor \(\mu\) applied during the most recent barostat step.
These values can be monitored via thermo_style custom or averaged via fix ave/time.
No parameter of this fix can be used with the start/stop keywords of the run command. This fix is not invoked during energy minimisation.
Restrictions#
This fix is part of WASHLIGGGHTS and requires the simulation domain to be set up appropriately for Lees-Edwards boundaries.
When performing bulk shear simulations under Lees-Edwards boundary conditions, it is strongly recommended to use a SLLOD integrator (fix nve/sllod, nve/sphere/sllod, multisphere/sllod, nve/superquadric/sllod) rather than standard fix nve/sphere. The SLLOD equations of motion account for the background convective shear term \(-\dot{\gamma} v_b\), ensuring profile-unbiased peculiar velocity integration without artificial boundary-layer slip.
Default#
deactivate_zero_vcm = no, initial_offset = 0.0, trigger_factor = 0.25, isobaric = no, tau_p = 0.05, p_every = 10, p_direction = lebc, p_max_change = 0.01, p_alpha = 0.5