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/)
-   -   fatal error in udf (http://www.cfd-online.com/Forums/fluent-udf/103907-fatal-error-udf.html)

fatemeh chitgarha June 28, 2012 17:28

fatal error in udf
 
Hi, the following UDF gives access violation fatal error during execution in FLUENT while running in interpreted mode.
my udf is interprted correctly but when it ( define_profile) hook in boundary condition( outlet) gives access violation fatal error.
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()

#include "udf.h"
#include "sg_mem.h"
DEFINE_INIT(my_uds0, domain)
{
cell_t c;
Thread *t;

/* loop over all cell threads in the domain */
thread_loop_c (t,domain)
{
/* loop over all cells */
begin_c_loop_all (c,t)
{
if (C_FMEAN(c,t)>0.06)

C_UDSI(c,t,0) = 1.0;
else
C_UDSI(c,t,0) = 0.0;
}
end_c_loop_all (c,t)
}
}
DEFINE_DIFFUSIVITY(diffu,c,t,i)
{
return (C_MU_T(c,t)) / 0.9;
}

DEFINE_PROFILE(scaler_outlet,t,i)
{
real s;
face_t f;
begin_f_loop(f,t)
{
s=C_UDSI(F_C0(f,t),THREAD_T0(t),0);
F_PROFILE(f,t,i) = 1.;
}
end_f_loop(f,t)
}

Thanks in advance ...


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