CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   DPM UDF - Segmentation Violation & Stack Backtrace (http://www.cfd-online.com/Forums/fluent-udf/50653-dpm-udf-segmentation-violation-stack-backtrace.html)

Prashanth February 23, 2009 18:55

DPM UDF - Segmentation Violation & Stack Backtrace
 
Hi All

I am working on my Masters Thesis which involves FLUENT modeling of particle deposition. I am a greenhorn when it comes to UDF's and the following is the first UDF I have ever created. The UDF is compiling without any errors and I am also able to choose it as a Boundary Condition in my setup. When I run the particle tracking though, I get the following error:

Stack backtrace generated for node id 3 on signal 11 : Please include this information with any bug report you file on this issue

/nfs/14/osu5206/.bashrc: line 1: module: command not found Primitive Error at Node 3: received Segmentation Violation

I have the code below if that would help in debugging the problem. The BC is basically calculating the particle normal velocity and critical velocity, comparing the both and determining if particle sticks based on this condition. Any help would be greatly appreciated as I have a 5 day deadline to get this working.

#include "udf.h" #include "dpm.h" #define nu_s 0.27 #define nu_p 0.27 #define YMIN 0.0 #define YMAX 0.4 #define UMEAN 1.0 #define B 1./7. #define DELOVRH 0.5 #define VISC 1.7894e-05 #define RGAS (UNIVERSAL_GAS_CONSTANT/MW) #define Tdatum 288.15 #define NUM_UDM 2

DEFINE_DPM_BC(deposition_bc, p, thread, f, f_normal, dim) { Domain *d; cell_t c; Thread *t; d=Get_Domain(1);

real Tavg,Ep,vcr; /*real norm_coeff=1.; real tang_coeff=1.;*/ real vn=0.; real R=287.; real normal[3]; int i,idim=dim; real x[ND_ND];

for (i=0.; i<idim; i++)

normal[i] = f_normal[i];

if(p->type==DPM_TYPE_INERT)

{

/*computing normal velocity*/

for(i=0.;i<idim;i++)

vn += p->state.V[i]*normal[i];

/*computing critical velocity*/

Tavg = (F_T(f,t)+P_T(p))/2.;

Ep = (3.*(pow(10.,20.)))*exp(-0.02365*Tavg);

vcr = pow(((2.*Ep)/P_DIAM(p)),(10./7.));

/*particle continues its path - no sticking*/

if (vn > vcr)

{

return PATH_ACTIVE;

}

/*particle sticks*/

else

{

thread_loop_c(t,d)

{

begin_c_loop(c,t)

{

C_UDMI(c,t,0) += P_MASS(p); /*mass of particles deposited*/

}

end_c_loop(c,t)

}

return PATH_ABORT;

} } }


kmayank July 11, 2009 05:33

any solution
 
Hey Prashant,

I am getting the same segementation error (with backtrace) problem with execute_at_end UDF. Did you get any solution to this?

Thanks
Mayank

LICH March 11, 2011 02:26

Hi kmayank, I got the same problem when I was runing a parallel calculation with a UDF about DPM, can you give any suggestions?
Thanks a lot. lich

cdf_user March 15, 2012 00:12

From where did you get the formula for critical velocity?

cdf_user July 10, 2012 10:39

critical velocity of gaseous particle
 
Here is the formula for critical velocity of a particle written in udf form:

real bk_cgs = 1.38e-16; /* cm^2-g/s */
real bk_si = 1.38e-23; /* m^2-kg/s */

lam =(1.3807e-23*P_T(p))/(3*3.141592*C_R(c,cthread)*(1/1000)*C_MU_L(c,cthread)*C_MU_L(c,cthread)*100*Reyo lds)


All times are GMT -4. The time now is 02:18.