CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Re: About wall shear stress (

Mike November 3, 2003 14:46

Re: About wall shear stress
Hello, Everyone. I need to access the wall shear stress through UDF. However, I found there is some difference between Tauxy= C_MU_L(c,t)*(C_DUDY(c,t) + C_DVDX(c,t)) and the wall shear stress provided by FLUENT.

Does anyone know what is the exact definition of the wall shear stress in FLUENT or the variable's name of the wall shear stress in UDF?



Markus November 4, 2003 02:51

Re: About wall shear stress
Hi Mike

The macros C_DUDY etc return the cell based velocity derivatives which are obtained by divergence theorem and thus do not represent the actual derivatives at the wall. These you should calculate for example as (F_U(f,t)-C_U(c,t))/dy.

Hope this helps Markus

Mike November 4, 2003 12:51

Re: About wall shear stress
Hi,Markus . Thanks for your message. I am recaculating the wall shear stress with (F_U(f,t)-C_U(c,t))/dy.But I have two follow-up questions:

1. Is the C_U(c,t) the velocity of the neighbour cell of the wall face cell?

2. How can I find the neighbour cell and then calculate dy?



Markus November 5, 2003 02:55

Re: About wall shear stress
Hi Mike Yes, C_U(c,ct) is the x-velocity in the center of the cell adjacent to a given wall face f. Cell c and cell thread ct can be obtained by the macros F_C0(f,f_thread) & THREAD_T0(f_thread) respectively. The macro BOUNDARY_FACE_GEOMETRY(f,f_thread,A,ds,es,A_by_es, dr0) returns dr0,which is the distance vector from face center to adjacent cell center.So dy = dr0[1] for example. See also the UDF Manual. bg Markus

Mike November 5, 2003 18:04

Re: About wall shear stress
Hi--Markus. Glad to see your response. I wrote the following code.I am confused when I saw the udm-0 is are all 0 on the zone I applied with XYplot, but it is not zero in the data file "Current4.dat". And they are not the same as the wall shear stress in Fluent. Anyway, I am not good at hacking. Any comment will be appreciated.

Best Regards, Mike



Thread *th;

FILE *fp;

cell_t c_Cell;

face_t f;

Thread *t_Cell;

int ID =3;

Domain *domain;

real Tauxy, Tauyx;

real Wall_shear;

real NV_VEC(A),NV_VEC(es),NV_VEC(dr0);

real ds,A_by_es;

domain = Get_Domain(1);

th = Lookup_Thread(domain,ID);

fp=fopen ("Current4.dat","w");

if(fp == NULL)

{ Message("\n Warning: unable to open %s for reading\n", "Current4.dat"); }

begin_f_loop(f, th) {


c_Cell = F_C0(f,th);

t_Cell = th->t0 ;

Tauxy = (F_U(f,t_Cell)-C_U(c_Cell,t_Cell))/dr0[1];

Tauyx = (F_V(f,t_Cell)-C_V(c_Cell,t_Cell))/dr0[0];

Wall_shear = C_MU_EFF(c_Cell,t_Cell)*(Tauxy+Tauyx);

F_UDMI(f,th,0) = Wall_shear;

fprintf(fp,"%f %f %f\n", Tauxy,Tauyx,Wall_shear);


}end_f_loop(f, th)

fclose (fp); }

Markus November 7, 2003 04:48

Re: About wall shear stress
hello Mike,

I'm not sure what's the problem with your F_UDMI but I suggest that the difference between your results and fluent is that for turbulent flows the wall shear stress is not given by the simple formula you used but by a wall function. Unfortunately I do not know the way this should be done. Markus

Mike November 8, 2003 01:46

Re: About wall shear stress

Thank you for your comment. I still don't know how the wall shear stress has been generated. BUt I found a variable named SV_Wall_Shear at storage.h file. It seems it is the variable for wall shear. Do you know how to access such kind of variable(C_STORAGE_R doesn't work!)?



Markus November 11, 2003 10:30

Re: About wall shear stress
Hi Mike

Wallshear is a vector with components x,y,z. These can be obtained with the macro

NV_V (wallshear, =, C_STORAGE_R_NV(f,t,SV_WALL_SHEAR));

have a nice day Markus

Satish November 17, 2003 14:08

Re: About wall shear stress

Can u explain NV_V (wallshear, =, C_STORAGE_R_NV(f,t,SV_WALL_SHEAR)) a little bit more.

Can we also set the wall shear stress using this, i need to write a UDF for setting the wall shear stress using DEFINE_ADJUST, so i need a macro for wall shear stress


Ajay Rao November 17, 2003 15:41

Re: About wall shear stress
Try using

fprintf(fp,"%2.20e %2.20e % 2.20e\n",Tauxy,Tauyx,Wall_shear);

instead of

fprintf(fp,"%f %f %f\n", Tauxy,Tauyx,Wall_shear); I suppose the wall_shear is a small number and hence just giving f would print out 0 instead of the actual value.

regards, Ajay

All times are GMT -4. The time now is 22:30.