How do i obtain volumetric stresses from a simulation?

Created by Will
Keywords:
Last updated by:
Dion Weatherley

Many applications using the DEM require analysis of volumetric stress information. Volumetric stresses are a useful way to compare DEM simulations to analytical solutions or with physical modeling and can give insights into the behaviour of the experiment being conducted. Stresses can be obtained from a DEM simulation by using bulk approximation. By summing up all the forces acting on particles within a grid cell we are able to obtain an approximate stress tensor for that volume. The tool 'raw2tostress', which is automatically installed with ESyS-Particle will convert interaction output to volumetric stress information.

To run the tool we first need to output the respective forces from the interactions group we are interested in, this can be done from a fieldsaver command. An example is shown below which will save the forces from a bonded interaction group out to a file prefixed with "out_force_bond" every 10000 timesteps.

sim.createFieldSaver (
   InteractionVectorFieldSaverPrms(
      interactionName = "bondGroup",
      fieldName = "force",
      fileName = "out_force_bond",
      fileFormat = "RAW2",
      beginTimeStep = 0,
      endTimeStep = 100000,
      timeStepIncr = 10000
   )
)

N.B. the provided interactionName can be the name assigned to any particle-pair interaction e.g. NRotFrictionPrms, FrictionPrms, HertzMindlinViscoPrms, etc. It is not necessary to provide the name of a bonded particle-pair interaction, as shown in this example.

Once we have the RAW2 output information we are able to run raw2tostress. This command will take an interaction RAW2 file, extract the volumetric stress information and output the data in the form of a VTK Unstructured grid format useful for visualisation with either Paraview or Visit.

The parameters raw2tostress uses are as follows:
raw2tostress BoundingBox GridSpacing InputRAW2File OutputVTKFile

Where:
BoundingBox - is specified as a comma separated list of six values "minX,minY,minZ,maxX,maxY,maxZ"
GridSpacing - is the width of a regular grid cell for which stresses are to be averaged over.
InputRAW2File, OutputVTKFile - are self explanatory

If many stress files need to be analyzed, this can be done using a python for loop to call the command once for each interval, an example below:
import os
for numFiles in range(10):
   os.system("raw2tostress 0,0,0,10,10,10 2 out_force_friction." + str(numFiles) + ".dat stressVTK" + str(numFiles) + ".vtu")