Skip to content

Postprocessing of particle fields

hamidrezanorouzi edited this page Oct 9, 2022 · 4 revisions

Background

It often required to perform some operations on the particles fields to obtain spatial fields (sum or average). For example, we may need to know the space-averaged velocity of particles in the simulated granular flow. For the spatial operation on the particles fields, the space is divided into some rectilinear cells and the operation is done on the particles in each cell. The spatial field $\bar\phi$ is calculated based on the following equation (number-based):

$$ \bar\phi _ { cell } = \frac {\sum \phi_{i}}{denominator}, \ i\in cell,\ and \ i\in mask$$

where denominator depends on the type of operation we are performing:

  • If we are performing sum operation, $denominator = 1$
  • If we are performing average operation, $denominator = \sum _ {i} 1,\ i\in cell$, which means number of particles in each cell.
  • If we are performing averageMask operation, $denominator = \sum _ {i} 1, i\in cell$, and $i\in mask$, which means number of particles in each cell that satisfies the include mask.

Problem definition

We are going to post-process the simulation results of the case rotating drum with binary particles. We divide the whole drum into some rectangular cells (here cubes) and calculate the spatial average velocity of particles in each cell, concentration (number-based) of small particles in the drum, and number of particles in each cell.

Post processing of the particle fields yields some new space-averaged fields

Note: the images are obtained from a similar case setup with higher number of particles.

Case setup

Here we only will have a look at the post-processing part of the simulation. It is assumed that you have already executer the simulation and the results are available for post-processing. Simulation case setup files can be found in tutorials/postprocessPhasicFlow/segregation/ folder.

In settings/postprocessDict, you can provide the information for post-processing the simulation results. In rectMesh dictionary, the information about the hexagonal mesh is provided. min and max define corner points of the whole mesh and nx, ny, and nz define number of divisions in each direction. In numberBased dictionary, you can define all the spatial fields for post processing. Three spatial fields are defined. The first spatial field, numParticles, calculates number of particles in each cell. It creates a uniform field one for particles and sum these ones over particles each cell, which results number of particles in each cell.

The second spatial field, smallConc, calculates number-based concentration of small particles in each cell. For this, we need to create a uniform field that replaces $\phi _{i}$. The summation in the numerator is performed on particles that satisfy the lessThan include mask. lessThanInfo define an include mask for particles whose diameters are less than 0.004 (which only selects small particles). So, the numerator is number of small particles in each cell. The operation is average, which means the denominator is the sum of particles (small and large) in each cell. So, the results becomes concentration of small particles in each cell.

The third spatial field, avVelocity, calculates space-averaged velocity of particles in each cell. velocity field of particles is read from time folder and performs an average operation for all the particles in each cell. Note that threshold is set to 3, which skips field calculation for the cells that contain less than or equal 3 particles and set the calculated value to zero in these cells. Default value is for threshold is one.

in caseSetup/postprocessDict file
rectMesh
{
    min (-0.12 -0.12 0.0);  //minimum corner point 
    max (0.12   0.12 0.1);  //maximum corner point 
    nx 24;         // number of divisions in x direction
    ny 24;         // number of divisions in y direction
    nz 10;         // number of divisions in z direction 
}
numberBased
{
    // num particles in a cell 
    numParticles
    {
        field       real 1.0;  // uniform field with value 1 
        operation   sum;       // sum over all particles in a cell 
        includeMask all;       // select all
    }
    // concentration of small particles (number based)
    smallConc
    {
        field       real 1.0;   // uniform field with value 1 
        operation   average;    // average over all particles in a cell    
        threshold   1;          // exclude cells with number of particles less than 1
        includeMask lessThan;   // include mask 
        lessThanInfo
        { 
            field diameter;     // include particles with diameter less than 0.004
            value 0.004;
        }
    }
    // average velocity of particles 
    avVelocity
    {
        field       velocity;   // read velocity field from time folder 
        operation   average;    // average over all particles in the cell
        threshold   3;          // exclude cells with number of particles less than 3
        includeMask all;        // select all
        
    }
}

Include mask options are:

  • all: all
  • lessThan: less than value
  • lessThanEq: less than or equal to value
  • greaterThan: greater than value
  • greaterThanEq: greater than or equal to value
  • equal: equal to value
  • between: between value1 and value2
  • betweenEq: between value1 and value2 or equal to them

Running the post-processing tool

Enter the following command in the terminal:

$ postprocessPhasicFlow

the results will be stored in folder ./VTK/postprocess folder.

Note: enter this command postprocessPhasicFlow -h in the terminal to see available options for this tool.