CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

udf segmentation violation when hooked

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   September 24, 2009, 02:43
Default udf segmentation violation when hooked
  #1
New Member
 
christophe
Join Date: Aug 2009
Posts: 24
Rep Power: 16
jjchristophe is on a distinguished road
I am using Fluent 6.3 under linux.
I wrote udf in order to simulate specific boundary conditions.
For one of my udf, I can compil it (as compiled udf) and load it without problem. But when I select it in the boundary condition window, I have the following message:
"fluent.6.3.26 received a fatal signal (SEGMENTATION VIOLATION)"
does any body have a clue?
here is my udf's code:

#include "udf.h"
#include "unsteady.h"
DEFINE_PROFILE(pressure_outlet_S,thread,i)
{
real A[ND_ND]; /* face's area */
real Q=0.; /* volume flow rate @ thread @ previous time step */
real t=CURRENT_TIME; /* current time */
face_t f;
float u,v,w,vn,R;
/* output of pressure outlet for 1st time step */
if (t=0.)
{
begin_f_loop(f,thread)
{
F_PROFILE(f,thread,i)=200.;
}
end_f_loop(f,thread)
}
else
{
/* computation of thread's flow rate @ previous time step */
begin_f_loop(f,thread)
{
u=F_U_M1(f,thread);
v=F_V_M1(f,thread);
w=F_W_M1(f,thread);
vn=u*u+v*v+w*w;
vn=SQR(vn);
F_AREA(A,f,thread);
Q=Q+NV_MAG(A)*vn;
}
end_f_loop(f,thread)
/* computation of thread's resistance @ current time step */
R = 0.5+(15.5/Q);
Q=0.;
begin_f_loop(f,thread)
{
u=F_U_M1(f,thread);
v=F_V_M1(f,thread);
w=F_W_M1(f,thread);
vn=u*u+v*v+w*w;
vn=SQR(vn);
F_AREA(A,f,thread);
Q=Q+NV_MAG(A)*vn;
/* output of pressure outlet @ current time step */
F_PROFILE(f,thread,i)=100*R*Q;
}
end_f_loop(f,thread)

}
}
jjchristophe is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
udf wall distance segmentation violation gento FLUENT 1 April 15, 2016 15:59
DPM UDF - Segmentation Violation & Stack Backtrace Prashanth Fluent UDF and Scheme Programming 4 July 10, 2012 10:39
Segmentation Violation Corentin FLUENT 1 February 13, 2011 01:07
[UDF] Segmentation violation visuja Fluent UDF and Scheme Programming 0 April 23, 2009 22:23
segmentation violation wasan FLUENT 0 December 23, 2008 11:37


All times are GMT -4. The time now is 07:50.