CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Problem with bin_particles_in_cells command (https://www.cfd-online.com/Forums/fluent/66410-problem-bin_particles_in_cells-command.html)

kmayank July 14, 2009 16:14

Problem with bin_particles_in_cells command
 
Hi,

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.

Thanks
Mayank

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?

Thanks,
DR

Wikie January 18, 2011 01:33

Hi,

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!!

Thanks,
Wikie

Wikie January 23, 2011 10:37

Hi,

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??

Cheers,
Wikie

massoudepsilon November 11, 2011 03: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.

Cheers

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

hi
does anybody here solved the problem about : cxboolean init_cells?
:confused::confused::confused:
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.

Regards:
MAC

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)

{

begin_particle_cell_loop(p,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*/
}
}

fyx1995 July 3, 2018 02:28

Quote:

Originally Posted by massoudepsilon (Post 662107)
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)

{

begin_particle_cell_loop(p,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*/
}
}

hi!i‘m wondering is this udf suitable only for unsteady particle tracking

massoudepsilon July 3, 2018 02:41

Quote:

Originally Posted by fyx1995 (Post 697993)
hi!i‘m wondering is this udf suitable only for unsteady particle tracking

I have never used it for steady state. But, I guess if you use it for steady state it should loop over the streams passing from each cell.


All times are GMT -4. The time now is 00:02.