calculate mixing index command
Purpose
This command creates one output file for each defined material (examples).
Note
This command is supported by Aspherix GPU.Syntax
calculate mixing_index keyword/value pairs
Keywords |
Description |
|---|---|
id |
user-assigned name for the command call
default:
mixing_index |
region in which the mixing index is evaluated
default:
simulation_domain_region_ |
Examples
calculate mixing_index
calculate mixing_index region container id mixingContainer
Description
This command calculates the GMMI (Generalized Mean Mixing Index) defined by Asmar et al. [1]. It produces an array that contains the x, y and z component of the GMMI for each material in the simulation, the single components are given as
GMMIx/y/z_i = x/y/z-center of volume of all particles of material i / x/y/z-center of volume of all particles
The center of volume
is calculated by summing over all eligible particles:

where
is the number of particles,
is the position of the
kth particle,
is a reference position and
is the volume of kth particle.
The value range of the GMMI can be interpreted as follows:
GMMI = 0 |
no data available |
GMMI = 1 |
perfect mixing |
0 < GMMI < 1 |
particles of material i have lower coordinate than average |
1 < GMMI < … |
particles of material i have higher coordinate than average |
If the region keyword is used, mixing of particles in the specified geometric
region is evaluated. The reference position is then equal to the
minimum coordinates of the regions bounding box in each direction.
The time interval at which the mixing index is calculated is defined by the write_to_terminal_timestep command.
Output information
The calculate mixing_index command produces a global array with the x, y and z position of the
center of volume of each material. The components of the generated array with ID MIXID
can be accessed by id_MIXID[i][1], id_MIXID[i][2] and MIXID[i][3] where i is the index of
the respective material. The material indicse start with 1 and are automatically assigned in
the order of their definition in the materials command.
When using the output_settings command, the results are automatically written to the simulation_data_aspherix.csv / result_monitor.txt file.
Alternatively, also the write_to_file command can be used to output the data to a specified file.
Example for saving the mixing index to a separate file
materials {coarse_sand, fine_sand}
calculate mixing_index id mix
write_to_file file mixing_index_output.txt
string "id_time id_mix[1][1] id_mix[1][1] id_mix[1][2] id_mix[1][3] id_mix[2][1] id_mix[2][2] id_mix[2][3]" &
title "# time coarse_x coarse_y coarse_z fine_x fine_y fine_z"
Per default, this command also produces an output file for each defined material
called ‘data_id_material_i.txt’, where id is the user specified command-ID (set to mixing_index
if none specified),
and
is the number
of materials. The structure of the output file for the material i is:
material_i_segregation_x material_i_segregation_y material_i_segregation_z
GMMIx_i1 GMMIy_i1 GMMIz_i1
...
GMMIx_ij GMMIy_ij GMMIz_ij
...
GMMIx_iM GMMIy_iM GMMIz_iM
where
is the number of outputs in time GMMIx/y/z_ij is the respective GMMI component
of material i at time j.