July 3, 2018, 02:28
|
|
#10
|
New Member
FENG
Join Date: Jul 2018
Posts: 1
Rep Power: 0
|
Quote:
Originally Posted by massoudepsilon
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
|
|
|