|
| 1 | +# Postprocessing to calculate Lecey mixing index in a rotating drum (v-1.0) |
| 2 | + |
| 3 | +## Problem definition |
| 4 | + |
| 5 | +The problem is to simulate a rotating drum with the diameter 0.24 m and the length 0.1 m rotating at 11.6 rpm. It is filled with 30,240 4-mm spherical particles. Particles are grouped into two types to measure the mixing dynamics in the drum. Lacey mixing index is used to evaluate the mixing quality. |
| 6 | + |
| 7 | +Lacey mixing index is defined as: |
| 8 | +$$LMI = \frac{σ^2_{max} - σ^2}{σ^2_{max} - σ^2_{min}}$$ |
| 9 | + |
| 10 | +where $σ^2$ is the variance of the concentration/fraction of one type of particles in sample volumes taken from the drum at a given time, $σ^2_{min}$ is the minimum variance corresponding to the completely mixed state, and $σ^2_{max}$ is the maximum variance corresponding to the completely segregated state. LMI near 0 shows a complete segregated bed, while LMI near 1 shows a completely mixed bed. |
| 11 | + |
| 12 | +<div align="center"> |
| 13 | +<b> |
| 14 | + |
| 15 | +A view of rotating drum |
| 16 | +</b> |
| 17 | +<b> |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +</b></div> |
| 22 | + |
| 23 | +*** |
| 24 | + |
| 25 | +## Setting up the case |
| 26 | + |
| 27 | +Many of the settings in this simulation is similar to the tutorial [rotating drum small](../../sphereGranFlow/rotatingDrumSmall/README.md). Here, we only explain the differences. |
| 28 | + |
| 29 | +### Creating particles with two types for mixing study |
| 30 | + |
| 31 | +Let's start with caseSetup/shapes file. |
| 32 | + |
| 33 | +<div align="center"> |
| 34 | +in <b>caseSetup/shapes</b> file |
| 35 | +</div> |
| 36 | + |
| 37 | +```C++ |
| 38 | +names (sphere1 sphere2); // names of shapes |
| 39 | + |
| 40 | +diameters (0.004 0.004); // diameter of shapes |
| 41 | + |
| 42 | +materials (prop1 prop1); // material names for shapes |
| 43 | +``` |
| 44 | +
|
| 45 | +it defines two particles (`sphere1` and `sphere2`) with the same size and properites. The `shapeIndex` for `sphere1` is 0 and for `sphere2` is 1. So, in the mixing quality evaluations, particles with `shapeIndex` of 0 refer to `sphere1` and particles with `shapeIndex` of 1, refer to `sphere2`. |
| 46 | +
|
| 47 | +Open the file `settings/particlesDict`. Two dictionaries, `positionParticles` and `setFields` position particles and set the field values for the particles. |
| 48 | +In dictionary `positionParticles`, the positioning `method` is `ordered`, which position particles in order in the space defined by `box`. `box` space is defined by two corner points `min` and `max`. In dictionary `orderedInfo`, `numPoints` defines number of particles; `distance`, the distance between two adjacent particles, and `axisOrder` defines the axis order for filling the space by particles. |
| 49 | +
|
| 50 | +<div align="center"> |
| 51 | +in <b>settings/particlesDict</b> file |
| 52 | +</div> |
| 53 | +
|
| 54 | +```C++ |
| 55 | +positionParticles // positions particles |
| 56 | +{ |
| 57 | + method ordered; // other options: random and empty |
| 58 | +
|
| 59 | + mortonSorting Yes; // perform initial sorting based on morton code? |
| 60 | +
|
| 61 | + orderedInfo |
| 62 | + { |
| 63 | + distance 0.004; // minimum space between centers of particles |
| 64 | +
|
| 65 | + numPoints 30240; // number of particles in the simulation |
| 66 | +
|
| 67 | + axisOrder (z x y); // axis order for filling the space with particles |
| 68 | + } |
| 69 | +
|
| 70 | + regionType box; // other options: cylinder and sphere |
| 71 | +
|
| 72 | + boxInfo // box information for positioning particles |
| 73 | + { |
| 74 | + min (-0.08 -0.08 0.015); // lower corner point of the box |
| 75 | +
|
| 76 | + max ( 0.08 0.08 0.098); // upper corner point of the box |
| 77 | + } |
| 78 | +} |
| 79 | +``` |
| 80 | + |
| 81 | +In dictionary `setFields`, dictionary `defaultValue` defines the initial value for all particles fields (here, `velocity`, `acceleration`, `rVelocity`, and `shapeName`). Note that `shapeName` field should be consistent with the names of shapes that you set in `caseSetup/shapes` file. In the `selectors` part, in the `shapeAssigne` sub-dictionary, a box that encompass half of the drum (left side of the drum) is defined and all the particles inside that box are selected. The `shapeName` for all the selected particles is set to `sphere2`. In this way, half of the particles in the left side are of type `sphere2` and the other half in the right side of the drum are of type `sphere1`. |
| 82 | + |
| 83 | +<div align="center"> |
| 84 | +in <b>settings/particlesDict</b> file |
| 85 | +</div> |
| 86 | + |
| 87 | +```C++ |
| 88 | +setFields |
| 89 | +{ |
| 90 | + /* |
| 91 | + Default value for fields defined for particles |
| 92 | + These fields should always be defined for simulations with |
| 93 | + spherical particles. |
| 94 | + */ |
| 95 | + defaultValue |
| 96 | + { |
| 97 | + velocity realx3 (0 0 0); // linear velocity (m/s) |
| 98 | + acceleration realx3 (0 0 0); // linear acceleration (m/s2) |
| 99 | + rVelocity realx3 (0 0 0); // rotational velocity (rad/s) |
| 100 | + shapeName word sphere1; // name of the particle shape |
| 101 | + } |
| 102 | + |
| 103 | + selectors |
| 104 | + { |
| 105 | + shapeAssigne |
| 106 | + { |
| 107 | + selector box; // other options: cylinder, sphere, randomPoints |
| 108 | + // select particles in the half of the drum to set to sphere2 |
| 109 | + boxInfo |
| 110 | + { |
| 111 | + min (-0.1 -0.1 0.0); |
| 112 | + max ( 0.0 0.1 0.1); |
| 113 | + } |
| 114 | + |
| 115 | + fieldValue // fields that the selector is applied to |
| 116 | + { |
| 117 | + shapeName word sphere2; // sets shapeName of the selected points to sphere2 |
| 118 | + } |
| 119 | + } |
| 120 | + } |
| 121 | +} |
| 122 | +``` |
| 123 | + |
| 124 | +Enter the following command in the terminal to create the particles and store them in `0` folder. |
| 125 | + |
| 126 | +`> particlesPhasicFlow` |
| 127 | + |
| 128 | +### Setting up Lacey mixing index parameters |
| 129 | + |
| 130 | +Lacey mixing index calculation is a post-processing operation. To set it up, we need to provide the file `postprocessDataDict` under `settings` folder. For more information on postprocessData module in PhasicFlow, [click here](./../../../src/PostprocessData/readme.md). |
| 131 | + |
| 132 | +In the `mixingInedexCalc` dictionary, `processMethod` is set to `mixingIndex` and the `processRegion` is set to `rectMesh`. `processRegion` represents a rectangular mesh whose cells are used for sampling points for evaluating the mixing index. The information of the rectMesh is given in `rectMeshInfo` sub-dictionary. `indexType` is set to `Lacey`, and information for calculating the Lacey mixing index is given in `LaceyInfo` sub-dictionary. In this sub-dictionary, `threshold` defines a minimum limit for number of particles in each sample (cell) to be included in the mixing index calculations. `type1Frac` is set to 0.5, which is equal to number fraction (concentration) of type1 particles in the drum. `type1Selection` specifies how to identify type1 particles. Here, it is set to `equal`, which means that type1 particles are those whose `shapeIndex` field is equal to 0 (as defined in `caseSetup/shapes` file). The `equalInfo` sub-dictionary provides more information for this selection. |
| 133 | + |
| 134 | +<div align="center"> |
| 135 | +in <b>settings/postprocessDataDict</b> file |
| 136 | +</div> |
| 137 | + |
| 138 | +```C++ |
| 139 | +runTimeActive yes; |
| 140 | + |
| 141 | +shapeType sphere; |
| 142 | + |
| 143 | +defaultTimeControl |
| 144 | +{ |
| 145 | + timeControl simulationTime; |
| 146 | + startTime 0; |
| 147 | + executionInterval 0.5; |
| 148 | +} |
| 149 | + |
| 150 | +components |
| 151 | +( |
| 152 | + mixingInedexCalc |
| 153 | + { |
| 154 | + processMethod mixingIndex; |
| 155 | + |
| 156 | + processRegion rectMesh; |
| 157 | + |
| 158 | + indexType Lacey; |
| 159 | + |
| 160 | + timeControl default; |
| 161 | + |
| 162 | + precision 4; |
| 163 | + |
| 164 | + scientific no; |
| 165 | + |
| 166 | + rectMeshInfo |
| 167 | + { |
| 168 | + min (-0.12 -0.12 0.00); // lower corner point of the box |
| 169 | + max (0.12 0.12 0.11); // upper corner point of the box |
| 170 | + |
| 171 | + nx 15; // number of divisions in x direction |
| 172 | + ny 15; // number of divisions in y direction |
| 173 | + nz 8; // number of divisions in z direction |
| 174 | + } |
| 175 | + |
| 176 | + LaceyInfo |
| 177 | + { |
| 178 | + type1Frac 0.5; |
| 179 | + threshold 20; |
| 180 | + type1Selection equal; |
| 181 | + |
| 182 | + equalInfo |
| 183 | + { |
| 184 | + field shapeIndex; |
| 185 | + value 0; |
| 186 | + } |
| 187 | + } |
| 188 | + |
| 189 | + } |
| 190 | + |
| 191 | +); |
| 192 | +``` |
| 193 | +
|
| 194 | +## Running the case |
| 195 | +
|
| 196 | +The solver for this simulation is `sphereGranFlow`. Enter the following command in the terminal. Depending on the computational power, it may take a few minutes to a few hours to complete. |
| 197 | +
|
| 198 | +`> sphereGranFlow` |
| 199 | +
|
| 200 | +The results of the post-processing are stored under folder `postprocessData` in the root folder of the simulation. |
0 commit comments