CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   my UDF can not calculation? (http://www.cfd-online.com/Forums/fluent/81263-my-udf-can-not-calculation.html)

happyrabbit October 21, 2010 08:59

my UDF can not calculation?
 
hello,everyone, I need some help to my UDF, after compiling , initialize ,and when iterate, the console appears the following text,
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 know there are some reason for it ,the condition seting , the computer system, the udf , after my consideration ,I am wondering the UDF have errors but compiling would not detected ,so please help to have a look, thanks !

my UDF :

#include "udf.h"
real p11=0.0;
real p22=0.0;
real p=0.0;
Thread *t;
face_t f;
real FC[2];
real I[2]={6,14};
int i=0,ID;
DEFINE_CG_MOTION(piston1,dt,vel,omega,time,dtime)
{ Domain *domain;
domain = Get_Domain(1);
while(i<2)
{ if(i==0)
{ ID=I[i];
t= Lookup_Thread(domain, ID);
begin_f_loop(f, t)
{
p11=F_P(f,t);
}
end_f_loop(f, t)
printf("p11 = %f ", p11);
}
i++;
if(i==1)
{ ID=I[i];
t= Lookup_Thread(domain, ID);
begin_f_loop(f, t)
{
p22=F_P(f,t);
}
end_f_loop(f, t)
printf("p22 = %f ", p22);
}
i++;}
p=(p11+p22);
printf("p = %f", p);
vel[0]=p/1000;

}
DEFINE_CG_MOTION(piston2,dt,vel,omega,time,dtime)
{

vel[0]=p/1000;

}


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