Barostat¶
The barostat plugin turns the periodic simulation cell into a dynamical degree of freedom: the size of the cell
along each periodic axis evolves in time, driven by the difference between the measured stress of the granular
assembly and a target stress. The typical use is a stress-controlled tri-periodic compression: a loose packing is
compressed until the mean stress reaches a prescribed value, without any wall, which avoids wall effects on the
packing structure.
The design follows Rockable's PeriodicCell and cellControl. Only the diagonal of the cell is controlled (axial
deformation, no shear), and non-periodic axes are left untouched.
Principle¶
Periodic cell and deformation¶
In exaDEM, particle positions are stored in a reference (grid) space and mapped to physical space by the domain
transformation xform, a \(3\times3\) matrix. The barostat only uses its diagonal:
where \(L_{0,i}\) is the size of the domain given in domain: bounds, \(h_i\) is dimensionless (1 at startup), \(L_i\) is
the current length of the cell along axis \(i\) and \(V\) the cell volume (computed by domain_volume). Changing \(h_i\)
moves every particle affinely with the cell and changes the distance between the periodic images, which loads the
contacts.
Measured stress¶
The stress of the assembly is the average (Love-Weber) stress tensor computed from the contact forces \(\mathbf{f}_c\) and the branch vectors \(\mathbf{b}_c\) (from the particle center to the contact point):
The contribution of each particle is computed by stress_tensor (field stress) and reduced over the domain by
avg_stress_tensor. With this convention, a compressive stress has negative diagonal components.
Equation of motion of the cell¶
Each periodic axis \(i\) behaves as a particle of fictive mass \(m\) and viscous damping \(c\). The driving force is the stress mismatch multiplied by the area of the face normal to \(i\), \(V / L_i\):
where \(\sigma^*_i\) is the target stress cell_sig (compressive is positive), \(m\) is cell_mass and \(c\) is
cell_damping. While the assembly is less loaded than requested (\(-\sigma_{ii} < \sigma^*_i\)), \(\ddot h_i < 0\) and
the cell shrinks; once the packing is jammed, the contact forces build up until \(-\sigma_{ii} = \sigma^*_i\) and the
cell stops.
Note
\(h_i\) is dimensionless while the right-hand side is a force, so cell_mass is a fictive parameter with units of
force × time². It has no physical meaning and must be tuned (see Tuning).
Time integration¶
The cell is integrated with the same velocity-Verlet splitting as the particles, in two halves around the force
computation, with \(v_i = \dot h_i\) (slot cell_vh) and \(a_i = \ddot h_i\) (slot cell_ah).
cell_barostat_prolog (before the neighbor update and compute_force):
cell_barostat_epilog (after the stress tensor of the new configuration has been computed):
The prolog stops the simulation if a cell length becomes non-finite or non-positive, or if \(h_i < 10^{-6}\) (collapsed
cell, usually because \(\sigma^*\) cannot be reached with the contact stiffness, or because cell_mass/cell_damping
are too small for dt).
Example: tri-periodic compression of dodecahedra¶
The example example/polyhedra/triperiodic_compression compresses 125 dodecahedra, initially on a simple cubic
lattice in a \(6\times6\times6\) tri-periodic box, under an isotropic target stress \(\sigma^* = 0.5\). The particles have
random orientations and random initial velocities.
cd build-exaDEM/example/polyhedra/triperiodic_compression
../../../exaDEM triperiodic_compression.msp
The cell first shrinks at nearly constant speed while the particles are not in contact (\(\sigma \approx 0\)). Around \(t \approx 9\) the packing jams, the stress rises and oscillates around the target, then settles at \(-\sigma_{ii} \approx \sigma^*\) (see Analyses).
Setup¶
Include the configuration file¶
The barostat is opt-in. Include config_barostat.msp after the particle configuration file, and make all the
controlled axes periodic:
config_barostat.msp redefines the numerical scheme to insert the cell integration around the force computation:
Since the cell size changes at every step, nbh_dist recomputes the neighbor search distance and the ghost layer
thickness in grid space after each cell update: in grid space, the same physical cutoff gets larger when the cell
shrinks. Without it, these distances would keep their initial values and contacts could be missed during the
compression.
Set the target stress¶
config_barostat.msp defines compute_barostat with a zero target. Redefine it in your input file:
Warning
Give cell_sig inline on cell_barostat_epilog as above. A bracketed list in the global block is parsed as
vector<double>, which does not match the Vec3d type of the slot.
Different values per axis give an anisotropic (triaxial, stress-controlled) loading, e.g. cell_sig: [ 1.0, 0.5, 0.5 ].
Operators¶
| Operator | Description |
|---|---|
cell_barostat_prolog |
drift and first half-kick of the cell; updates the diagonal of xform. Once per step, before compute_force |
cell_barostat_epilog |
new cell acceleration and second half-kick. Once per step, after the stress tensor has been recomputed |
domain_volume |
cell volume \(V\) (slot volume) |
avg_stress_tensor |
average stress tensor \(\boldsymbol\sigma\) (slot stress_tensor) from the per-particle stresses |
Parameters of cell_barostat_epilog:
| Name | Type | Default | Description |
|---|---|---|---|
cell_sig |
Vec3d |
required | target normal stress per axis \(\sigma^*_i\), compressive is positive |
cell_mass |
double |
required | fictive mass \(m\) of the cell; larger values give a slower, smoother response |
cell_damping |
double |
0.0 |
viscous damping \(c\) of the cell velocity; with 0 the cell oscillates around the target |
The cell velocity and acceleration (slots cell_vh and cell_ah) are kept from one step to the next and start at
zero. They are not written in the restart files: after a restart, the cell starts again with a zero velocity, from the
xform stored in the dump.
Tuning¶
cell_massandcell_dampinghave no general formula and must be tuned for each system. The ratio \(m/c\) is the relaxation time of the cell velocity (0.1 in the example above); it should be large compared todtand small compared to the duration of the compression.- A too small
cell_massmakes the cell react faster than the contacts can transmit the load: the stress overshoots, oscillates, and the cell can collapse. - A too small
cell_dampingleaves the stress oscillating around the target; increase it to settle without overshoot. - The target stress must be reachable with the contact stiffness: \(\sigma^*\) should give overlaps small compared to the particle size (\(\sigma^* d / k_n \ll 1\)).
Cell size check¶
Compressing the cell also shrinks the grid cells in physical space (\(\mathrm{cell\_size} \times \min_i h_i\)). The
neighbor search requires the largest particle diameter to stay smaller than this size. config_spheres.msp and
config_polyhedra.msp plug check_sphere_cell_size and check_polyhedra_cell_size in check_cell_size, which is
called at every neighbor list update and stops the simulation with an explicit message when the cells become too
small. Choose cell_size so that \(\mathrm{cell\_size} \times h_{\min}\) remains larger than the largest diameter at the
end of the compression. In the example, \(h\) goes from 1 to about 0.68, giving physical cells of about 2.0 for
particles of diameter about 1.
Analyses¶
The compression is usually followed through the compacity (solid fraction) and the average stress tensor. These
operators are added to the analyses block, executed every simulation_analyses_frequency steps; their outputs are
written in <dir_name>/ExaDEMAnalyses.
Compacity¶
The compacity \(\phi\) is the ratio between the volume of the particles and the volume of the cell:
where \(h_p\) is the homothety of the polyhedron. Both operators require the cell volume \(V\), so domain_volume must
be called first. The sums are reduced in parallel (OpenMP / GPU and MPI) over the real (non-ghost) particles.
| Operator | Output file | Columns |
|---|---|---|
sphere_compacity |
SphereCompacity.txt |
Time NbParticles MeanRadius Compacity |
polyhedra_compacity |
PolyhedraCompacity.txt |
Time NbParticles SolidVolume Compacity |
The output file name can be changed with the name parameter. Plot it with gnuplot:
gnuplot -p -e "set xlabel 'Time'; set ylabel 'Compacity'; \
plot 'PolyhedraTriperiodicCompressionDir/ExaDEMAnalyses/PolyhedraCompacity.txt' u 1:4 every ::1 w lp t ''"
Stress tensor¶
With analysis_dump_stress_tensor_frequency set, the average stress tensor is written in
<dir_name>/AvgStressTensor.txt (columns Time Sxx Sxy Sxz Syx Syy Syz Szx Szy Szz, see
Stress tensor). For a converged compression, the diagonal satisfies
\(-\sigma_{ii} \approx \sigma^*_i\) and the off-diagonal terms fluctuate around zero.
gnuplot -p -e "plot 'PolyhedraTriperiodicCompressionDir/AvgStressTensor.txt' u 1:(-\$2) w l t '-Sxx', \
'' u 1:(-\$6) w l t '-Syy', '' u 1:(-\$10) w l t '-Szz', 0.5 dt 2 t 'target'"
Contact statistics (spheres)¶
For sphere packings, sphere_contact_stats gives the micromechanical state of the compressed packing, written in
SphereContactStats.txt (columns Time NbContacts CoordinationNumber MeanContactForce):
where \(N_c\) is the number of active sphere-sphere contacts (overlap \(\delta_n < 0\)), each counted once, and \(N_p\) the number of real particles.
Regression test¶
The example is also a regression test (Example_ExaDEM_PolyhedraTriperiodicCompression, sequential run). The script
check_compacity.py reads PolyhedraCompacity.txt and checks that the number of particles and the solid volume are
conserved, that the compacity increases at every output, and that it exceeds 0.26 at the end of the shortened run
(t = 2):