CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Parallel DPM-UDF problem (https://www.cfd-online.com/Forums/main/93789-parallel-dpm-udf-problem.html)

sfotovati October 26, 2011 12:58

Parallel DPM-UDF problem
 
Hey all,

I wrote a UDF using DPM_SCALAR_UPDATE macro,

DEFINE_DPM_SCALAR_UPDATE(part,c,t,initialize,p)
{
.
.
.
C_CENTROID(pvct,c,t);
.
.
begin_c_loop(c0,tin)
{
c_face_loop(c0,tin,n)
{
xu[0]=0.,xu[1]=0.,Lcf=0.;
f=C_FACE(c0,tin,n);
tf=C_FACE_THREAD(c0,tin,n);
F_AREA(cface,f,tf);
Lcf=0.5*(NV_MAG(cface));
F_CENTROID(xu,f,tf);
r0=sqrt(pow((pvct[0]-xu[0]),2)+pow((pvct[1]-xu[1]),2));
if (r0<=Lcf)
{
C_UDMI(c,t,0)+=P_MASS(p);
}
}
}
end_c_loop(c0,tin);
.
.
.
}

Whenever I am running this UDF in parallel, the values for "cface" and "xu" become zero. If not parallel though, they get the correct values regarding to the cell faces. IF anyone can help me how to take care of it while running parallel, it is highly appreciated.

Thanks

Sean


All times are GMT -4. The time now is 10:40.