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

Velocity gradient on edge

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 4, 2012, 05:57
Default Velocity gradient on edge
  #1
Senior Member
 
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17
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, 03:39
Default
  #2
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
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, 06:12
Default Velocity gradient on edge
  #3
Senior Member
 
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17
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, 11:30
Default
  #4
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
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, 01:23
Default
  #5
Senior Member
 
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17
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, 05:05
Default
  #6
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
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, 05:46
Default
  #7
Senior Member
 
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17
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, 18:43
Default
  #8
New Member
 
moon
Join Date: Feb 2012
Posts: 26
Rep Power: 14
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: 14
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: 13
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, 22:33
Default Zero Gradient Boundary Condition
  #11
New Member
 
Majid
Join Date: Jan 2014
Location: Canada
Posts: 23
Rep Power: 12
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

Old   September 4, 2016, 18:00
Default
  #12
New Member
 
Mohammad Soroush
Join Date: Jul 2016
Posts: 1
Rep Power: 0
mshojayan is on a distinguished road
Quote:
Originally Posted by sharif88 View Post
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
Hi. You don't need to use UDF to do that. There is a simple way. When you want to set boundary conditions in fluent, you open a window in a particular zone. In UDS tab, you can set either the flux of UDS variable, or its value. If you choose the flux of UDS, the fluent will exactly apply the normal gradient of UDS in that zone.
mshojayan 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
axial velocity in bend pipe with adverse pressure gradient liguifan OpenFOAM 0 July 24, 2011 06: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 11:29


All times are GMT -4. The time now is 21:54.