MFIX tutorial rotating drum case learning

Now,I’m studying the mixing of particles in a rotating drum.I want to derive the number of two different particles in each grid cell. How can I do that? Thank you!


I think we will need more details about what you are trying to do to answer your question. What do you mean by “derive the number of two different particles in each grid cell”? Are you saying that you want to count the number of particles of two different types in each grid cell at each point in time i.e. by storing the number of particle type A in A_count(IJK,time) and particle type B in B_count(IJK,time)?

I want to know the number of particles A and B in each grid cell at each point in time


You can either do this with UDFs while the simulation is running, or by postprocessing your simulation data with Paraview/Python/Jupyter Notebooks/etc. I think the first one is faster to learn so I’ll describe what that looks like.

You’ll need to write a user-defined function that is called every time step (i.e. usr2_des). In that UDF, you’ll want to loop through each particle (index from 1 to PARTICLES) and increment a counter based on whether that particle is type A (store in A_count) or type B (store in B_count). This will involve importing some modules containing particle-phase data like “use discretelement”. Finally, export your A_count and B_count arrays in some way for visualization after the simulation is complete.

Beyond that, I would recommend studying the MFIX source code and tutorials to understand how to write loops and what modules contain the solver data you need.

Thank you for your help! I will study hard.@julia