CFD Online Logo CFD Online URL
Home > Forums > FLUENT

UDF : problem with c_face_loop

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   February 27, 2008, 07:08
Default UDF : problem with c_face_loop
Posts: n/a

I try to find a value of velocity of the mesh before the boundary. I've already written this UDF, but I always have a SEGMENTATION VIOLATION ...

#include "udf.h" #include "mem.h"

DEFINE_PROFILE(condition_limite_haut_air_z, t, index) {

Thread *t1, *t2, *t3, *tf;

real vitesse_avant;

face_t f,f1;

cell_t c,c0,c1,c2,c3;

int n = 0;

vitesse_avant = 0;

begin_f_loop(f, t)


c0 = F_C0(f,t);

c1 = F_C1(f,t);

if (c1=NULL)


c = c0;




c = c1;


c_face_loop(c, t1, n)


f1 = C_NODE(c,t1,n);

tf = C_FACE_THREAD(c,t1,n);

if (f1 != f)


vitesse_avant = vitesse_avant + F_W(f1,tf);



vitesse_avant = vitesse_avant/3;

if (vitesse_avant < 0)


F_PROFILE(f, t, index) = 0;




F_PROFILE(f, t, index) = -vitesse_avant;


} end_f_loop(f, t)


After some researches, I've found that the problem comes from the c_face_loop. Can somebody help me?


  Reply With Quote

Old   February 28, 2008, 07:05
Default Re: UDF : problem with c_face_loop
Posts: n/a
Hello Quentin,

you use the thread pointer t1 in the c_face_loop, but I can't see the initialization of t1.

I would you use t1=Lookup_Thread(d,index); function and then a begin_c_loop(c,t1) to iterate through the cells.


  Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 Today 07:17
what's the problem with my udf zzyan FLUENT 0 November 4, 2010 04:56
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58

All times are GMT -4. The time now is 20:09.