You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[11. A Complete Dictionary File (postprocessDataDict)](#11-a-complete-dictionary-file-postprocessdatadict)
42
47
43
48
## 1. Overview
44
49
@@ -118,6 +123,7 @@ The postprocessing module provides several methods for processing particle data.
118
123
| `arithmetic` | bulk | Simple arithmetic mean/sum with equal weights | Each particle contributes equally |
119
124
| `uniformDistribution` | bulk | Each particle contributes inversely proportional to the total number of particles | $w_i = 1/n$ where $n$ is the number of particles |
120
125
| `GaussianDistribution` | bulk | Weight contribution based on distance from the center with Gaussian falloff | $w_i = \exp(-\|x_i - c\|^2/(2\sigma^2))/\sqrt{2\pi\sigma^2}$ |
126
+
| `mixingIndex` | bulk | Calculates mixing quality indices for multi-component granular systems | See [Section 7](#7-mixing-index-calculations) |
121
127
| `particleProbe` | individual | Extracts values from specific particles | Direct access to particle properties |
122
128
123
129
## 5. Region Types
@@ -264,9 +270,187 @@ The above fields may vary from one type of simulation to other. Pleas note that
264
270
|`fluctuation2` (in average only)| Calculate fluctuation of field values |`no`|`yes` or `no`|
265
271
|`phi`| Field to be used for weighted averaging |`one`| Any valid field name |
266
272
267
-
## 7. Examples
273
+
## 7. Mixing Index Calculations
268
274
269
-
### 7.1. Example 1: Probing Individual Particles
275
+
### 7.1. Overview
276
+
277
+
The mixing index component provides a specialized postprocessing tool to evaluate the quality of mixing in granular systems containing multiple particle types. This is particularly useful for analyzing mixing and segregation phenomena in industrial processes such as mixing in rotating drums, fluidized beds, and other granular mixers.
278
+
279
+
The mixing index calculation is a **bulk property** that operates on regions defined by the user. Unlike standard operations that calculate field averages or sums, mixing indices provide a statistical measure of how well different particle types are distributed throughout the domain.
280
+
281
+
### 7.2. Lacey Mixing Index
282
+
283
+
Currently, phasicFlow implements the **Lacey Mixing Index**, which is one of the most widely used metrics for assessing mixing quality in particulate systems.
- $p$ is the overall number fraction (concentration) of type 1 particles in the system
309
+
- $n$ is the average number of particles per sample region
310
+
- $N_s$ is the number of valid sample regions
311
+
- $p_i$ is the local fraction of type 1 particles in sample region $i$
312
+
313
+
#### Interpretation
314
+
315
+
-**M ≈ 0**: Indicates complete segregation (particles of the same type are clustered together)
316
+
-**M ≈ 1**: Indicates complete mixing (particles are randomly distributed)
317
+
-**0 < M < 1**: Indicates partial mixing
318
+
319
+
### 7.3. Configuration
320
+
321
+
To use mixing index calculations, set `processMethod` to `mixingIndex` in your postprocessing component. The mixing index component requires:
322
+
323
+
1.**Region Definition**: A `processRegion` that divides the domain into sample volumes (typically `rectMesh`)
324
+
2.**Index Type**: Specification of which mixing index to calculate (currently only `Lacey` is available)
325
+
3.**Mixing Index Parameters**: Configuration specific to the chosen index type
326
+
327
+
#### Required Parameters
328
+
329
+
| Parameter | Description | Example |
330
+
|-----------|-------------|---------|
331
+
|`processMethod`| Must be set to `mixingIndex`|`mixingIndex`|
332
+
|`processRegion`| Type of region for sampling (typically `rectMesh`) |`rectMesh`|
333
+
|`indexType`| Type of mixing index to calculate |`Lacey`|
334
+
335
+
#### Parameters for Lacey Mixing Index
336
+
337
+
The Lacey-specific parameters are defined in the `LaceyInfo` sub-dictionary:
338
+
339
+
| Parameter | Description | Type | Required |
340
+
|-----------|-------------|------|----------|
341
+
|`type1Frac`| Overall number fraction of type 1 particles in the system |`real`| Yes |
342
+
|`threshold`| Minimum number of particles in a sample region for it to be included in the calculation |`uint32`| Yes |
343
+
|`type1Selection`| Method to identify type 1 particles |`word`| Yes |
344
+
345
+
#### Type Selection Methods
346
+
347
+
The `type1Selection` parameter specifies how to identify type 1 particles. It uses the same `includeMask` system as other postprocessing operations. Common options include:
348
+
349
+
-`equal`: Select particles where a field equals a specific value
350
+
-`lessThan`: Select particles where a field is less than a value
351
+
-`greaterThan`: Select particles where a field is greater than a value
352
+
-`between`: Select particles where a field is between two values
Each selection method requires its own info sub-dictionary (e.g., `equalInfo`, `lessThanInfo`) with:
356
+
-`field`: The particle field to check (e.g., `shapeIndex`, `diameter`)
357
+
-`value`: The comparison value(s)
358
+
359
+
### 7.4. Example Configuration
360
+
361
+
Here's a complete example for calculating the Lacey mixing index in a rotating drum:
362
+
363
+
```cpp
364
+
mixingIndexCalc
365
+
{
366
+
processMethod mixingIndex;
367
+
368
+
processRegion rectMesh;
369
+
370
+
indexType Lacey;
371
+
372
+
timeControl default;
373
+
374
+
precision 4;
375
+
376
+
scientific no;
377
+
378
+
rectMeshInfo
379
+
{
380
+
min (-0.12 -0.12 0.00); // lower corner point of the box
381
+
max (0.12 0.12 0.11); // upper corner point of the box
382
+
383
+
nx 15; // number of divisions in x direction
384
+
ny 15; // number of divisions in y direction
385
+
nz 8; // number of divisions in z direction
386
+
}
387
+
388
+
LaceyInfo
389
+
{
390
+
// Overall fraction of type 1 particles (must match actual system composition)
391
+
type1Frac 0.5;
392
+
393
+
// Minimum particles per sample to be included in statistics
394
+
threshold 20;
395
+
396
+
// Method to identify type 1 particles
397
+
type1Selection equal;
398
+
399
+
// Configuration for the equal selection method
400
+
equalInfo
401
+
{
402
+
field shapeIndex; // Use shapeIndex to distinguish particle types
403
+
value 0; // Type 1 are particles with shapeIndex = 0
404
+
}
405
+
}
406
+
}
407
+
```
408
+
409
+
#### Alternative Example: Selecting by Diameter
410
+
411
+
If particle types differ by size, you can use diameter-based selection:
412
+
413
+
```cpp
414
+
LaceyInfo
415
+
{
416
+
type1Frac 0.3;
417
+
threshold 10;
418
+
type1Selection lessThan;
419
+
420
+
lessThanInfo
421
+
{
422
+
field diameter;
423
+
value 0.003; // Type 1 are particles with diameter < 3 mm
424
+
}
425
+
}
426
+
```
427
+
428
+
#### Output
429
+
430
+
The mixing index calculation produces a time-series output file in the `postprocessData` folder with the following columns:
431
+
432
+
1.**time**: Simulation time
433
+
2.**numberOfSamples**: Number of valid sample regions (cells with at least `threshold` particles)
434
+
3.**avSampleSize**: Average number of particles per valid sample
435
+
4.**LaceyMixingIndex**: The calculated Lacey mixing index value
436
+
437
+
The output file also includes a header with the complete `LaceyInfo` parameters used for the calculation, making it easy to reproduce and verify the analysis.
438
+
439
+
#### Best Practices
440
+
441
+
1.**Choose appropriate threshold**: The `threshold` value should be large enough to provide meaningful statistics but not so large that most samples are excluded. A typical range is 10-50 particles per sample.
442
+
443
+
2.**Select proper mesh resolution**: The `rectMesh` should divide the domain into enough cells to capture spatial variations in mixing, but each cell should contain sufficient particles. Typical mesh sizes range from 10×10×10 to 30×30×30 depending on the system size and particle count.
444
+
445
+
3.**Ensure accurate type1Frac**: The `type1Frac` parameter must accurately reflect the overall fraction of type 1 particles in your system. An incorrect value will lead to incorrect mixing index values.
446
+
447
+
4.**Verify particle selection**: Before running long simulations, verify that your `type1Selection` correctly identifies the intended particle type by checking the particle fields in your initial configuration.
448
+
449
+
For a complete tutorial on using Lacey mixing index calculations, see the example case in [`tutorials/postprocessPhasicFlow/LaceyMixingIndex`](./../../tutorials/postprocessPhasicFlow/LaceyMixingIndex/).
450
+
451
+
## 8. Examples
452
+
453
+
### 8.1. Example 1: Probing Individual Particles
270
454
271
455
```cpp
272
456
velocityProb
@@ -282,7 +466,7 @@ velocityProb
282
466
283
467
This example extracts the y-component of the position for particles with IDs 0, 10, and 100.
284
468
285
-
### 7.2. Example 2: Processing in a Spherical Region
469
+
### 8.2. Example 2: Processing in a Spherical Region
286
470
287
471
```cpp
288
472
on_single_sphere
@@ -342,7 +526,7 @@ This example defines a sphere region and performs three operations:
342
526
2. Calculate the fraction of particles with diameter less than 0.0031
343
527
3. Calculate the number density by summing and dividing by volume
344
528
345
-
### 7.3. Example 3: Processing Along a Line
529
+
### 8.3. Example 3: Processing Along a Line
346
530
347
531
In this example, a line region is defined. The `lineInfo` section specifies the start and end points of the line, the number of spheres to create along the line, and the radius of each point. Bulk properties are calculated in each sphere, based on the properties of particles contained in each sphere.
348
532
@@ -387,7 +571,7 @@ along_a_line
387
571
388
572
This example creates 10 spherical regions along a line from (0,0,0) to (0,0.15,0.15) and calculates the bulk density and volume density in each region.
389
573
390
-
### 7.4 Example 4: Processing in a Rectangular Mesh
574
+
### 8.4. Example 4: Processing in a Rectangular Mesh
391
575
392
576
In this example, a rectangular mesh is defined. The `rectMeshInfo` section specifies the minimum and maximum corner points of the box, the number of divisions in each direction, and an optional cell extension factor which is effective for GaussianDistribution only. In the `operations` section, two operations are defined: one for calculating the average velocity and another for calculating the solid volume fraction.
393
577
@@ -436,7 +620,7 @@ on_a_rectMesh
436
620
}
437
621
```
438
622
439
-
### 7.5 Example 5: Tracking particles
623
+
### 8.5. Example 5: Tracking particles
440
624
441
625
Suppose we want to mark and track the position of particles that are located inside a box region at t = 1 s. All particles that are inside the box at t = 1 s will be marked/selected and then the position of them are recorded along the simulation time. The following example shows how to do this. Note that marking/selecting of particles is done at the instance that is defined by `startTime`.
442
626
@@ -471,9 +655,9 @@ particlesTrack
471
655
}
472
656
```
473
657
474
-
## 8. Advanced Features
658
+
## 9. Advanced Features
475
659
476
-
### 8.1. Special functions applied on fields
660
+
### 9.1. Special functions applied on fields
477
661
478
662
You can access specific components of vector fields (`realx3`) using the `component` function:
479
663
@@ -495,7 +679,7 @@ Here is a complete list of these special functions:
0 commit comments