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

 August 4, 2012, 04:57 Velocity gradient on edge #1 Senior Member   Vaze Join Date: Jun 2009 Posts: 145 Rep Power: 9 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

August 6, 2012, 02:39
#2
Senior Member

Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 109
Rep Power: 8
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.

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 ;
begin_f_loop(f,t)
{
F_CENTROID(xf,f,t);
c0=F_C0(f,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 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

 August 6, 2012, 05:12 Velocity gradient on edge #3 Senior Member   Vaze Join Date: Jun 2009 Posts: 145 Rep Power: 9 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

August 6, 2012, 10:30
#4
Senior Member

Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 109
Rep Power: 8
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 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

 August 7, 2012, 00:23 #5 Senior Member   Vaze Join Date: Jun 2009 Posts: 145 Rep Power: 9 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.

August 7, 2012, 04:05
#6
Senior Member

Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 109
Rep Power: 8
Quote:
 Originally Posted by mvee 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?

 August 7, 2012, 04:46 #7 Senior Member   Vaze Join Date: Jun 2009 Posts: 145 Rep Power: 9 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

September 19, 2012, 17:43
#8
New Member

moon
Join Date: Feb 2012
Posts: 24
Rep Power: 6
Quote:
 Originally Posted by mvee 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 ?

 December 24, 2012, 12:50 #9 Member   Satish Gupta Join Date: Jun 2012 Posts: 30 Rep Power: 6 @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

January 26, 2014, 17:48
#10
New Member

Chandrasekhar
Join Date: Oct 2013
Location: new jersey
Posts: 24
Rep Power: 4
Quote:
 Originally Posted by mvee 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

 September 9, 2014, 21:33 Zero Gradient Boundary Condition #11 New Member   Majid Join Date: Jan 2014 Location: Canada Posts: 23 Rep Power: 4 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

September 4, 2016, 17:00
#12
New Member

Join Date: Jul 2016
Posts: 1
Rep Power: 0
Quote:
 Originally Posted by sharif88 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.

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post liguifan OpenFOAM 0 July 24, 2011 05:56 saewoong98 CFX 4 October 29, 2009 19:09 J.Y.Shin FLUENT 2 January 19, 2007 19:04 Merinadica FLUENT 0 December 16, 2006 05:53 Stephen FLUENT 0 April 7, 2003 10:29

All times are GMT -4. The time now is 16:44.