CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Velocity gradient on edge (http://www.cfd-online.com/Forums/fluent-udf/105624-velocity-gradient-edge.html)

 mvee August 4, 2012 04:57

Velocity gradient on edge

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 August 6, 2012 02:39

1 Attachment(s)
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.

Attachment 15002

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 (Post 375342) 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 August 6, 2012 05:12

Velocity gradient on edge

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 August 6, 2012 10:30

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 (Post 375547) 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 August 7, 2012 00:23

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.

 gearboy August 7, 2012 04:05

Quote:
 Originally Posted by mvee (Post 375704) 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?

 mvee August 7, 2012 04:46

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

 moun139 September 19, 2012 17:43

Quote:
 Originally Posted by mvee (Post 375739) 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 ?

 Rahul123 December 24, 2012 12:50

@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

 chandrasekhar January 26, 2014 17:48

Quote:
 Originally Posted by mvee (Post 375739) 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

 sharif88 September 9, 2014 21:33

Zero Gradient Boundary Condition

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

 mshojayan September 4, 2016 17:00

Quote:
 Originally Posted by sharif88 (Post 509751) 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.

 All times are GMT -4. The time now is 15:04.