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/)
-   -   F_AREA causes ACCESS_VIOLATION (http://www.cfd-online.com/Forums/fluent-udf/109396-f_area-causes-access_violation.html)

cpmcguir November 16, 2012 10:52

F_AREA causes ACCESS_VIOLATION
 
Hello,

I have a nested function in my UDF that is to return the average face area for a cell passed to it. I have been receiving the "FLUENT received fatal signal (ACCESS_VIOLATION)" error when using this code, and found that only the line F_AREA(area,f,tf) is having this effect. The model runs without issue when I impose area[0] = 1e-5 or something similar instead of using F_AREA. Any suspicion of why this could be the case?

Thanks in advance, code below

float fun_face_area(cell_t c, Thread *tc)
{
face_t f;
Thread *tf;
int n, i = 0;
float area[ND_ND], A = 0.;
c_face_loop(c,tc,n);
{
f = C_FACE(c,tc,n);
tf = C_FACE_THREAD(c,tc,n);
//area[0] = 1e-5;
F_AREA(area,f,tf);
A += NV_MAG(area);
i++;
}
return A/i;
}


All times are GMT -4. The time now is 17:49.