Skip to content

Commit e48cec2

Browse files
Tutorial for mixing Lacey mixing index
1 parent 9ee29d0 commit e48cec2

11 files changed

Lines changed: 633 additions & 0 deletions

File tree

133 KB
Loading
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
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+
![](./LaceyMixingIndex.png)
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.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* -------------------------------*- C++ -*--------------------------------- *\
2+
| phasicFlow File |
3+
| copyright: www.cemf.ir |
4+
\* ------------------------------------------------------------------------- */
5+
objectName interaction;
6+
objectType dicrionary;
7+
fileFormat ASCII;
8+
/*---------------------------------------------------------------------------*/
9+
materials (prop1); // a list of materials names
10+
11+
densities (1000.0); // density of materials [kg/m3]
12+
13+
contactListType sortedContactList;
14+
15+
contactSearch
16+
{
17+
18+
method NBS; // method for broad search
19+
20+
updateInterval 10;
21+
22+
sizeRatio 1.1;
23+
24+
cellExtent 0.55;
25+
26+
adjustableBox Yes;
27+
}
28+
29+
model
30+
{
31+
contactForceModel nonLinearNonLimited;
32+
33+
rollingFrictionModel normal;
34+
35+
Yeff (1.0e6); // Young modulus [Pa]
36+
37+
Geff (0.8e6); // Shear modulus [Pa]
38+
39+
nu (0.25); // Poisson's ratio [-]
40+
41+
en (0.7); // coefficient of normal restitution
42+
43+
mu (0.3); // dynamic friction
44+
45+
mur (0.1); // rolling friction
46+
}
47+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* -------------------------------*- C++ -*--------------------------------- *\
2+
| phasicFlow File |
3+
| copyright: www.cemf.ir |
4+
\* ------------------------------------------------------------------------- */
5+
objectName sphereDict;
6+
objectType sphereShape;
7+
fileFormat ASCII;
8+
/*---------------------------------------------------------------------------*/
9+
names (sphere1 sphere2); // names of shapes
10+
11+
diameters (0.004 0.004); // diameter of shapes
12+
13+
materials (prop1 prop1); // material names for shapes
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
cd ${0%/*} || exit 1 # Run from this directory
3+
4+
ls | grep -P "^(([0-9]+\.?[0-9]*)|(\.[0-9]+))$" | xargs -d"\n" rm -rf
5+
rm -rf VTK
6+
rm -rf postprocessData
7+
#------------------------------------------------------------------------------
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
cd ${0%/*} || exit 1 # Run from this directory
3+
echo "\n<--------------------------------------------------------------------->"
4+
echo "1) Creating particles"
5+
echo "<--------------------------------------------------------------------->\n"
6+
particlesPhasicFlow
7+
8+
echo "\n<--------------------------------------------------------------------->"
9+
echo "2) Creating geometry"
10+
echo "<--------------------------------------------------------------------->\n"
11+
geometryPhasicFlow
12+
13+
echo "\n<--------------------------------------------------------------------->"
14+
echo "3) Running the case"
15+
echo "<--------------------------------------------------------------------->\n"
16+
sphereGranFlow
17+
18+
19+
20+
21+
#------------------------------------------------------------------------------
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* -------------------------------*- C++ -*--------------------------------- *\
2+
| phasicFlow File |
3+
| copyright: www.cemf.ir |
4+
\* ------------------------------------------------------------------------- */
5+
objectName domainDict;
6+
objectType dictionary;
7+
fileFormat ASCII;
8+
/*---------------------------------------------------------------------------*/
9+
globalBox // Simulation domain: every particles that goes outside this domain will be deleted
10+
{
11+
min (-0.12 -0.12 0.00); // lower corner point of the box
12+
13+
max (0.12 0.12 0.11); // upper corner point of the box
14+
}
15+
16+
boundaries
17+
{
18+
left
19+
{
20+
type exit;
21+
}
22+
23+
right
24+
{
25+
type exit;
26+
}
27+
28+
bottom
29+
{
30+
type exit;
31+
}
32+
33+
top
34+
{
35+
type exit;
36+
}
37+
38+
rear
39+
{
40+
type exit;
41+
}
42+
43+
front
44+
{
45+
type exit;
46+
}
47+
}

0 commit comments

Comments
 (0)