please check DEFINE_ADJUST code
please check follow UDF code
I'm trying to calculate the V_cell (Eulerian particulate velocity) . I must summation the variables around all particle injected to the control volume. there are 368 particles injected to the C.V and I want to storage the V_cell to the UDM5 . What should I do? please help DEFINE_ADJUST(v_cell_adjust, domain) { real sigma2=0, sigma3=0, v_cell; Tracked_Particle *tp; cell_t c = RP_CELL(&(tp->cCell)); Thread *t = RP_THREAD(&(tp->cCell)); Particle *p; domain = Get_Domain(1); thread_loop_c(t,domain) { begin_particle_cell_loop(p,c,t) { for(p=0;p<368;p++) { sigma3 += P_MASS(p)*P_VEL(p)[0]*0.65; } } end_particle_cell_loop(p,c,t) } C_UDMI(c,t,5)=sigma2/(0.001*C_VOLUME(c,t)); } thank you IVI |
All times are GMT -4. The time now is 20:39. |