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

UDF for slip and moving wall

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 20, 2005, 11:25
Default UDF for slip and moving wall
  #1
lichun Dong
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 non-slip 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("flow-time");

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("flow-time");

F_PROFILE(f,t,i) = omega*A*cos(omega*tempt) - beta*avgdudy;

}

end_f_loop(f,t) } }
  Reply With Quote

Old   May 21, 2005, 21:55
Default How to access variables in Fluent
  #2
lichun Dong
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("flow-time");

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("flow-time");

F_PROFILE(f,t,i) = omega*A*cos(omega*t);

}

end_f_loop(f,t);

}

}
  Reply With Quote

Old   May 30, 2005, 14:24
Default Re: UDF for slip and moving wall
  #3
ramesh
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
  Reply With Quote

Old   March 26, 2014, 04:37
Default moving wall slip
  #4
New Member
 
elaf
Join Date: May 2013
Posts: 15
Rep Power: 12
elaf_2003 is on a distinguished road
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.
elaf_2003 is offline   Reply With Quote

Reply


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
How to use UDF to define a moving wall Big Stone FLUENT 14 February 13, 2021 07:24
moving wall by UDF lyf FLUENT 15 August 17, 2017 07:24
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 05:26
How to use UDF to define a moving wall lingo FLUENT 2 April 23, 2004 02:38


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