
[Sponsors] 
May 20, 2005, 11:25 
UDF for slip and moving wall

#1 
Guest
Posts: n/a

Dear all:
I am trying to put a slip and moving boundary condition at the wall. so I write a UDF as the followed. But the FLUENT said there is a fatal problem "Segmentation violation". I select moving wall and nonslip at Fluent, maybe that is the reason? But if I select slip wall, I can not specify the wall velocity. Anybody has some experience to put a slip moving wall boundary? please give some suggestion. Thanks a lot #include "udf.h" DEFINE_PROFILE(wall_velocity,t,i) { face_t f; cell_t c; real cellnumber = 0; /*the number of the cells on the boundary*/ real A = 0.002; /*the amplitude of the oscillation*/ real omega = 100; /*the frequency of the oscillation*/ real dudy; /*the y derivative of the horizontal velocity*/ real sumdudy = 0; /*the sum of the velocity derivative*/ real avgdudy; /*the average of the velocity derivative*/ real beta = 0.2; /*the slippy coefficient*/ Thread *tc; tc = THREAD_T0(t); if (NULL != C_DUDY(c,tc)) { begin_c_loop(c,tc) { cellnumber = cellnumber + 1; dudy = C_DUDY(c,tc); sumdudy = sumdudy + dudy; } end_c_loop(c,tc) avgdudy = sumdudy/cellnumber; begin_f_loop(f,t) { real tempt = RP_Get_Real("flowtime"); F_PROFILE(f,t,i) = omega*A*cos(omega*tempt)  beta*avgdudy; } end_f_loop(f,t) } else { begin_f_loop(f,t) { real tempt = RP_Get_Real("flowtime"); F_PROFILE(f,t,i) = omega*A*cos(omega*tempt)  beta*avgdudy; } end_f_loop(f,t) } } 

May 21, 2005, 21:55 
How to access variables in Fluent

#2 
Guest
Posts: n/a

Dear all:
This seems a hard question. I checked that once I try to access the variables, the "Segmentation violation" appears. So what is the trick to access the varibles in Fluent? I attached my UDF again. #include "udf.h" DEFINE_PROFILE(wall_velocity, t, i) { face_t f; cell_t c; real cellnumber = 0; /*the number of the cells on the boundary*/ real A; /*the amplitude of the oscillation*/ real omega; /*the frequency of the oscillation*/ real dudy; /*the y derivative of the horizontal velocity */ real sumdudy = 0; /*the sum of the velocity derivative */ real avgdudy; /*the average of the velocity derivative */ real beta; /*the slippry coeeficient*/ if (NULL != C_DUDY(c,t)) { begin_c_loop(c, t) { cellnumber++; dudy = C_DUDY(c,t); sumdudy =+ dudy; } end_f_loop(f,t); avgdudy = sumdudy/cellnumber; begin_f_loop(f, t) { real t = RP_Get_Real("flowtime"); F_PROFILE(f,t,i) = omega*A*cos(omega*t)  beta*avgdudy; } end_f_loop(f,t); } else { begin_f_loop(f, t) { real t = RP_Get_Real("flowtime"); F_PROFILE(f,t,i) = omega*A*cos(omega*t); } end_f_loop(f,t); } } 

May 30, 2005, 14:24 
Re: UDF for slip and moving wall

#3 
Guest
Posts: n/a

Hi, DEFINE_PROFILE takes input the boundary face not the cell. So when u are running a loop on the faces u cant access the particular cell directly. Because the thread for face is different from thread for cells. If u want to access the cell of the partciular boundary face use F_C0(f,tf). I hope this should solve the problem


March 26, 2014, 05:37 
moving wall slip

#4 
New Member
elaf
Join Date: May 2013
Posts: 9
Rep Power: 4 
Hi all
I was wondering if any body can help me? I am using flow around cylinder, the shear stresses at the wall need to be specified to constant value. In this option, there are 3 components for the shear stresses, i.e. x direction components and so on. Does anyone know for example how can set these values for cylinder surface Regard. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
How to use UDF to define a moving wall  lingo  FLUENT  9  August 19, 2014 09:14 
Moving a wall with UDF  noa  FLUENT  0  March 13, 2011 06:26 
moving wall by UDF  lyf  FLUENT  14  December 25, 2010 11:27 
How to use UDF to define a moving wall  lingo  FLUENT  2  April 23, 2004 02:38 
How to use UDF to define a moving wall  Big Stone  FLUENT  10  February 23, 2004 11:03 