CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   DPM velocity (https://www.cfd-online.com/Forums/fluent/127924-dpm-velocity.html)

ldm273507 December 26, 2013 01:42

DPM velocity
 
Hi,everybody. I want to make simulation of cooling tower and try to write a UDF to contorl the velocity of water (use DPM model) in a specific zone, but there are some incorrects in it. When I compile the UDF, the console apperas "uninitialized local variable ‘tp' used" and "uninitialized local variable ‘p' used". Wether the DEFINE_ADJUST Macro can be used in modifying the velocity of DPM? Please give me some suggestions, thank you. The UDF is below:

#include "udf.h"
#include "dpm.h"
DEFINE_ADJUST(my_adjust,d)
{
//UDF Manual P201
Tracked_Particle *tp;
cell_t c=P_CELL(tp);
Thread *t=P_CELL_THREAD(tp);
Particle *p;
if(P_POS(p)[2]<14.8&&P_POS(p)[2]>=13.4)
begin_particle_cell_loop(p,c,t)
{
P_VEL(p)[2] = -0.2;
}
end_particle_cell_loop(p,c,t)
}


All times are GMT -4. The time now is 16:30.