CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Fatal Signal (ACCESS_VIOLATION) (https://www.cfd-online.com/Forums/fluent/72641-fatal-signal-access_violation.html)

Joe101 February 12, 2010 11:01

Fatal Signal (ACCESS_VIOLATION)
 
Hi,

I have written a UDF to rotate an ellipse in 2D with a constant angular velocity. It has been compiled and loaded without any errors. However, when i come to preview the mesh motion i get the following error message:

"Updating mesh at time level N...
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: ()"

I cant work out the problem but i have a feeling it might be my udf as i am new to c programming. Here is a copy of the udf:

#include "udf.h"
DEFINE_CG_MOTION(ellipse, dt, vel, omega, time, dtime)
{
face_t f;
Thread *tf = DT_THREAD(dt); /* [5] */
Node *node;
real xn, yn, r, theta, y0, x0;
int n;
begin_f_loop(f,tf) /* Loops over all faces in the thread passed in the DEFINE macro argument [10] */
{
f_node_loop(f,tf,node) /* Loops over all nodes in the face */
{
xn = NODE_X(node); // calculate x-coordinate of a grid point on wall /* [15] */
yn = NODE_Y(node); // calculate y-coordinate of a grid point on wall
x0=0.0;
y0=0.0;
/* [20] */
r=sqrt(((xn-x0)*(xn-x0))+((yn-y0)*(yn-y0)));
theta=atan((yn-y0)/(xn-x0));
*omega=1000.0; /* [25] */
vel[0]=r*(*omega)*sin(theta);
vel[1]=-r*(*omega)*cos(theta);
} /* [30] */
}
end_f_loop(f,tf);
}

Any suggestions would be very much appreciated.

usman naseer February 16, 2010 12:59

hi,,
i think it is not the problem of udf alone.It is possible that your udf is absolutely correct but you will still get this message.it is actually due to a combination of errors due to which Fluent can't proceed further.i will suggest you to check your boundary conditions and the values of pressure assigned.
Regards

Allan Walsh February 17, 2010 12:13

If you do much with udfs, you may see this message a lot - starting all the way back from Version 4. I have not tried to look through your UDF code, but in general the error occurs when you try and access a variable that is not accessible. So you might look for something where the variable is not yet defined or you are overwriting something. Good luck.

zzyan November 18, 2010 23:59

hi joe101
i have same problem about node_x(node), have you sloved this problem, if yes, could you tell me how ?
thanks

Quote:

Originally Posted by Joe101 (Post 245863)
Hi,

I have written a UDF to rotate an ellipse in 2D with a constant angular velocity. It has been compiled and loaded without any errors. However, when i come to preview the mesh motion i get the following error message:

"Updating mesh at time level N...
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: ()"

I cant work out the problem but i have a feeling it might be my udf as i am new to c programming. Here is a copy of the udf:

#include "udf.h"
DEFINE_CG_MOTION(ellipse, dt, vel, omega, time, dtime)
{
face_t f;
Thread *tf = DT_THREAD(dt); /* [5] */
Node *node;
real xn, yn, r, theta, y0, x0;
int n;
begin_f_loop(f,tf) /* Loops over all faces in the thread passed in the DEFINE macro argument [10] */
{
f_node_loop(f,tf,node) /* Loops over all nodes in the face */
{
xn = NODE_X(node); // calculate x-coordinate of a grid point on wall /* [15] */
yn = NODE_Y(node); // calculate y-coordinate of a grid point on wall
x0=0.0;
y0=0.0;
/* [20] */
r=sqrt(((xn-x0)*(xn-x0))+((yn-y0)*(yn-y0)));
theta=atan((yn-y0)/(xn-x0));
*omega=1000.0; /* [25] */
vel[0]=r*(*omega)*sin(theta);
vel[1]=-r*(*omega)*cos(theta);
} /* [30] */
}
end_f_loop(f,tf);
}

Any suggestions would be very much appreciated.



All times are GMT -4. The time now is 16:36.