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

Velocity gradient on edge

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 4, 2012, 04:57
Default Velocity gradient on edge
  #1
Senior Member
 
Vaze
Join Date: Jun 2009
Posts: 133
Rep Power: 8
mvee is on a distinguished road
Hi

I need to define constant velocity gradient on the edge. I though to define the value of shear stress but it will mislead due to the eddy viscosity. Hence i thought to define it through UDF. I have gone through the UDF literature in which i found DEFINE_ADJUST and C_T_G(c,t)[0] macro, but could not understand how to implement for my condition.

Can anyone shed focus on this UDF or any other way to define it?

Thank you
Mvee
mvee is offline   Reply With Quote

Old   August 6, 2012, 02:39
Default
  #2
Senior Member
 
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 106
Rep Power: 7
gearboy is on a distinguished road
You can discretize the gradient manually so as to set the velocity at the edge. For example, if the gradient is 2 and we use the first-order discretization.

无命名.gif

Uc is the velocity of neighbor cell, Uf is the velocity at the edge, Xc is the x coordinate of neighbor cell, Xf is the x coordinate of the edge.

DEFINE_PROFILE(edge_velocity,t,i)
{
real xf[ND_ND],xc[ND_ND];
face_t f;
cell_t c0 ;
Thread*t0 ;
begin_f_loop(f,t)
{
F_CENTROID(xf,f,t);
c0=F_C0(f,t) ;
t0=THREAD_T0(t) ;
C_ CENTROID(xc,c0,t0);
F_PROFILE(f,t,i) =C_U(c0,t0) -2*(xc[0]-xf[0]);
}
end_f_loop(f,t)
}


Quote:
Originally Posted by mvee View Post
Hi

I need to define constant velocity gradient on the edge. I though to define the value of shear stress but it will mislead due to the eddy viscosity. Hence i thought to define it through UDF. I have gone through the UDF literature in which i found DEFINE_ADJUST and C_T_G(c,t)[0] macro, but could not understand how to implement for my condition.

Can anyone shed focus on this UDF or any other way to define it?

Thank you
Mvee
gearboy is offline   Reply With Quote

Old   August 6, 2012, 05:12
Default Velocity gradient on edge
  #3
Senior Member
 
Vaze
Join Date: Jun 2009
Posts: 133
Rep Power: 8
mvee is on a distinguished road
Hi Gearboy

If i consider du/dx = 0 and then if i replace line "F_PROFILE(f,t,i) =C_U(c0,t0) -2*(xc[0]-xf[0]);" by "F_PROFILE(f,t,i) =C_U(c0,t0);", will it work? This is to define zero velocity gradient on edge/surface.

I think this is exactly equivalent to assign the neighboring cell velocity to the edge, right?

Thank you
Mvee
mvee is offline   Reply With Quote

Old   August 6, 2012, 10:30
Default
  #4
Senior Member
 
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 106
Rep Power: 7
gearboy is on a distinguished road
You should only define boundary edge's velocity same as the neighbor cell. Never specify cell's velocity same as the edge.

In face, if you specify the cell's velocity, it will not work. Because you can't change a cell's value in the domain. Cell's value is decided by boundary conditions and governing equation, not decided by user's specification. You can only specify boundary conditions.



Quote:
Originally Posted by mvee View Post
Hi Gearboy

If i consider du/dx = 0 and then if i replace line "F_PROFILE(f,t,i) =C_U(c0,t0) -2*(xc[0]-xf[0]);" by "F_PROFILE(f,t,i) =C_U(c0,t0);", will it work? This is to define zero velocity gradient on edge/surface.

I think this is exactly equivalent to assign the neighboring cell velocity to the edge, right?

Thank you
Mvee
gearboy is offline   Reply With Quote

Old   August 7, 2012, 00:23
Default
  #5
Senior Member
 
Vaze
Join Date: Jun 2009
Posts: 133
Rep Power: 8
mvee is on a distinguished road
Yes, you are correct. The cell values are decided by the imposed boundary condition. I would like to define zero velocity gradient as boundary condition only in one direction not in the other direction. It is like one component of shear stress as zero.
mvee is offline   Reply With Quote

Old   August 7, 2012, 04:05
Default
  #6
Senior Member
 
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 106
Rep Power: 7
gearboy is on a distinguished road
Quote:
Originally Posted by mvee View Post
Yes, you are correct. The cell values are decided by the imposed boundary condition. I would like to define zero velocity gradient as boundary condition only in one direction not in the other direction. It is like one component of shear stress as zero.
Shear stress is a wall boundary condition. That means no flow through the boundary/edge. Is it the real case?
gearboy is offline   Reply With Quote

Old   August 7, 2012, 04:46
Default
  #7
Senior Member
 
Vaze
Join Date: Jun 2009
Posts: 133
Rep Power: 8
mvee is on a distinguished road
I need to define only DVDX as zero while other component will be obtained through the solver. If i define this through the specified shear then the solver will assume all component as zero.

Thank you
mvee is offline   Reply With Quote

Old   September 19, 2012, 17:43
Default
  #8
New Member
 
moon
Join Date: Feb 2012
Posts: 23
Rep Power: 5
moun139 is on a distinguished road
Quote:
Originally Posted by mvee View Post
I need to define only DVDX as zero while other component will be obtained through the solver. If i define this through the specified shear then the solver will assume all component as zero.

Thank you
i tried to use a constant flux =2,after this a udf posted in head with the gradient equal to 2 ,i didn't find the same result .why ?
moun139 is offline   Reply With Quote

Old   December 24, 2012, 12:50
Default
  #9
Member
 
Satish Gupta
Join Date: Jun 2012
Posts: 30
Rep Power: 5
Rahul123 is on a distinguished road
@MVEE.... hope you solved the problem....can u let me know I to make the gradient in one direction as zero for boundary where rest is calculated by the solver.
Thanks
Rahul123 is offline   Reply With Quote

Old   January 26, 2014, 17:48
Default
  #10
New Member
 
Chandrasekhar
Join Date: Oct 2013
Location: new jersey
Posts: 24
Rep Power: 3
chandrasekhar is on a distinguished road
Quote:
Originally Posted by mvee View Post
I need to define only DVDX as zero while other component will be obtained through the solver. If i define this through the specified shear then the solver will assume all component as zero.

Thank you
Hi
I am having the same problem, i have to specify du/dx=0 at the outlet. Could you please tell me if u have got it. Many thanks for replying
chandrasekhar is offline   Reply With Quote

Old   September 9, 2014, 21:33
Default Zero Gradient Boundary Condition
  #11
New Member
 
Majid
Join Date: Jan 2014
Location: Canada
Posts: 23
Rep Power: 3
sharif88 is on a distinguished road
Hello everybody
I have a UDS which has a zero gradient normal to the wall boundary condition but I don't know how to impose that in FLUENT udf.
I am not sure if zero flux boundary is the same, if so please let me know.
I tried to use the F_AREA macro dotted by the gradient vector but I dont know how to set its value to zero so it would work.
Thanks
sharif88 is offline   Reply With Quote

Reply

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
axial velocity in bend pipe with adverse pressure gradient liguifan OpenFOAM 0 July 24, 2011 05:56
Velocity gradient saewoong98 CFX 4 October 29, 2009 19:09
UDF sample for velocity gradient J.Y.Shin FLUENT 2 January 19, 2007 19:04
velocity gradient Merinadica FLUENT 0 December 16, 2006 05:53
Velocity gradient Stephen FLUENT 0 April 7, 2003 10:29


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