CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Particle tracking help (http://www.cfd-online.com/Forums/fluent/94807-particle-tracking-help.html)

ali hemmati November 26, 2011 05:58

Particle tracking help
 
Hello,

I am working on a project in which particle tracking is needed. I have a UDS that stores body forces, so the force is spacial. The problem is how to adjust body force on each particle in space in the code.

I used below code:
Code:

DEFINE_DPM_BODY_FORCE(body_force,p,i)        // returns ACCELERATION
{

real bforce;
real Fx, Fy;

cell_t c;
Thread *t;

Domain *domain;
domain = Get_Domain(1);

thread_loop_c(t,domain)
{
    begin_c_loop_all(c,t)
    {
        if (P_CELL(p) == c)
          {Fx = C_UDSI(c,t,0); Fy = C_UDSI(c,t,1); break;}
    }
    end_c_loop_all(c,t)
}

if (i==0)                          // x direction
        bforce = (1.0/P_MASS(p)) * ( Fx );
else if (i==1)                  // y direction
        bforce = (1.0/P_MASS(p)) * ( Fy );

return bforce;
}

in which "p" has "Tracked_Particle *" type. The code does not recognize P_CELL(p). I think that P_CELL(p) is available if "p" is a "Particle *" not "Tracked_Particle *".

Is there any way to obtain value of UDS at the particle position?

ali hemmati November 29, 2011 12:04

Does anyone know about particle tracking macros?


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