CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Problem with bin_particles_in_cells command (

kmayank July 14, 2009 16:14

Problem with bin_particles_in_cells command

I see that the command "bin_particles_in_cells(domain)" is giving me error in Fluent 12 version, saying "Too few arguments". Looks like it needs one more argument, and of int type. The command used to work fine in Fluent 6 with just the 'domain' argument.
If anyone has any idea of the updated usage, I would be grateful.


mcdhrim May 13, 2010 16:05

experiencing the same problem
I have been using User Defined Function: bin_particles_in_cells(d).

This function worked with Fluent 6.3.26 but it does not work anymore with ANSYS FLUENT.

Does anyone know how to go around this problem?


Wikie January 18, 2011 02:33


did anybody solve this problem?? I also want to use the command "bin_particles_in_cells(domain)". I'm using version 12.1. The error message is "Too few arguments".
Can anybody help me please I stuck here!!


Wikie January 23, 2011 11:37


I found the function bin_particles_in_cells in the cl_dpm.h file.
"FLUENT_EXPORT void bin_particles_in_cells(Domain *domain, cxboolean init_cells);"
So this function needs another argument init_cells of cxboolean type. Right now I dont't know how to handle this. Does anybody else what is meant by init_cells??


massoudepsilon November 11, 2011 04:48

Hi every body,

I am using a UDF containing bin_particles_in_cell and I need to know that what this macro does.

I will be grateful if someone can answer it.


LICH May 2, 2012 03:33

Hi Wikie,
Do you have any idea about the argument "cxboolean init_cells"? I've tried some value(0,1,FALSE,TRUE) for the argument. There is no error and the case can run. BUT the results are obviously wrong. There is NO particle is tracked in the domain.
Thanks a lot.

HyperNova April 10, 2015 13:43

does anybody here solved the problem about : cxboolean init_cells?
i am using Fluent v 15.0

mac_09 June 8, 2015 23:46

Hello guys,

I have just solved this issue.

Cxboolean type is just T/F data type and init_cells is something I suppose we have to do like, initialize particles in cells.

So try your cases with:

So you can just try

Bin_particles_in_cells(domain, TRUE)

Thanks and good luck.


massoudepsilon August 28, 2017 03:41

Simple UDF for looping on all particles in each cell.
Since Fluent 12, the implementation of bin_particles_in_cells(domain, count) has changed and you need additional macro (unthread_particles_to_all_inj(domain, check)). Please be aware that this additional macro had only one argument at least until Fluent version 14. Since Fluent 17 it needs 2 arguments (domain and check (which is a boolean variable)).

Here is a simple UDF for looping on all particles in each cell.

DEFINE_ADJUST(Looping, domain)
cxboolean count;
cxboolean check;
Thread *t;
cell_t c;
Particle *p;

Alloc_Storage_Vars(domain, SV_DPM_PARTICLE_BIN, SV_NULL);

bin_particles_in_cells(domain, count);
thread_loop_c (t,domain)
begin_c_loop(c, t)


/* you can do your calculation on particles in one cell here*/
end_particle_cell_loop(p, c, t)
end_c_loop(c, t)
unthread_particles_to_all_inj(domain, check);
Free_Storage_Vars(domain, SV_DPM_PARTICLE_BIN, SV_NULL); /* release allocated memory*/

All times are GMT -4. The time now is 14:51.