|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Ebi
Join Date: Apr 2009
Posts: 9
Rep Power: 18 ![]() |
Dear friends,
What follows is the UDF file which aims to calculate the number of "escaped" particles from the domain in a dpm (discrete phase model) problem. Although the number of those particles is reported in the Fluent console, I need that UDF file for an optimization study. When I compile that, the following warning and error is reported by Fluent: -------------------------------- ..\..\src\particle_cells_count11.c(19): warning C4133: '=': incompatible types - from 'particle_struct *' to 'Tracked_Particle *' ..\..\src\particle_cells_count11.c(19): error C2039: 'next': is not a member of 'tracked_particle_struct' C:\PROGRA~1\ANSYSI~1\v162\fluent\fluent16.2.0\src\ dpm\dpm_types.h(680): note: see declaration of 'tracked_particle_struct' -------------------------------- Line number 19 was highlighted below (loop(p,I->p)). Any idea is highly appreciated. Thank you... -------------------------------- #include "udf.h" DEFINE_DPM_SCALAR_UPDATE(particle_cells_count11, cell, thread, initialize, p) { cell_t c; Thread *c_t; /*c=RP_CELL(&(p->cCell));*/ /*c_t=RP_THREAD(&(p->cCell));*/ Injection *Ilist; Injection *I; /*Particle *p;*/ int particles_in_the_domain = 0; int total=950; int e; real iter = N_ITER; static real iter_old = 0; Ilist = Get_dpm_injections(); loop(I,Ilist) { loop(p,I->p) { c = P_CELL(p); c_t = P_CELL_THREAD(p); particles_in_the_domain+=1; } } if (iter != iter_old) /* i.e. We are on a new iteration */ { iter_old = iter; e=total-particles_in_the_domain; } Message("Number of particles in the domain: %d\n",particles_in_the_domain); Message("Number of escaped particles: %d\n",e); } -------------------------------- |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|