Skip to content

Stress Tensor

The stress tensor of a particle is

\[ \sigma_{loc} = \sum_{ij \in I} f_{ij}\, c_{ij}^T \]

with \(I\) the active interactions, \(f_{ij}\) the force between particles \(i\) and \(j\), and \(c_{ij} = r_i - p_{ij}\) the vector between the center \(r_i\) of particle \(i\) and the contact position \(p_{ij}\). The stress of the system is \(\sigma = \frac{1}{V} \sum_{loc} \sigma_{loc}\), with \(V\) the volume.

The per-particle stress is computed by stress_tensor (field stress), the average stress by avg_stress_tensor, and the output file is written by write_stress_tensor. Set analysis_dump_stress_tensor_frequency in the global block (default -1, never):

1
2
3
4
5
global:
  simulation_end_iteration: 150000
  simulation_log_frequency: 1000
  simulation_paraview_frequency: 10000
  analysis_dump_stress_tensor_frequency: 1000

The result is written in <dir_name>/AvgStressTensor.txt, with the columns Time Sxx Sxy Sxz Syx Syy Syz Szx Szy Szz.

Pipeline

This frequency triggers the computation of the per-particle stresses, then the chaining of three blocks: the volume, the average stress tensor and the output.

compute_volume:
  - domain_volume

global_stress_tensor:
  - avg_stress_tensor

dump_stress_tensor_if_triggered:
  condition: trigger_write_stress_tensor
  body:
    - compute_volume
    - global_stress_tensor
    - write_stress_tensor

By default, the volume is the volume of the simulation domain. For a deposit or another simulation where the domain does not match the volume of the sample, replace compute_volume by your own operator:

1
2
3
4
5
compute_volume:
  - my_volume:
     my_param1: x
     my_param2: y
     my_param3: z

or give a fixed volume:

1
2
3
4
5
compute_volume: nop

global_stress_tensor:
  - avg_stress_tensor:
     volume: 21952

Example: example/polyhedra/analyses/write_avg_stress.msp, hexapods dropped into a box.

scripts/post_processing/avg_stress.gnu plots the components:

1
2
3
4
5
6
7
set key autotitle columnhead
N = system("awk 'NR==1{print NF}' AvgStressTensor.txt")
plot for [i=2:N] "AvgStressTensor.txt" u 1:i w l
set key autotitle columnhead
set term png
set output "avgStress.png"
replot
Average stress