CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Segmentation violation wall normal velocity (http://www.cfd-online.com/Forums/main/98674-segmentation-violation-wall-normal-velocity.html)

cdf_user March 16, 2012 00:56

Segmentation violation wall normal velocity
 
I am using the following udf to calculate the wall normal velocity of particles for particle deposition studies. After compiling, I hook the udf in reports --> sample, I get a segmentation violations. Any suggestions???

#include "udf.h"
#include "dpm.h"
#include "surf.h"
#include "mem.h"
#include "sg_mphase.h"
#include "sg.h"
#include "cxiface.h"

DEFINE_DPM_OUTPUT(df_eff,header,fp,p,t,plane)

{
cell_t c;
face_t f;
int i,idim=3;
real vn=0.,normal[3],A[ND_ND];
real NV_VEC(velocity);


begin_f_loop(f,t)
{

F_AREA(A,f,t);
vn=NV_DOT(A,p->state.V);
}
end_f_loop(f,t)

printf("\n Velocity=%g \n",vn);

}


All times are GMT -4. The time now is 12:03.