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? Thanks. Mike 
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 
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 followup 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? Regards, Mike 
Re: About wall shear stress
Hi Mike Yes, C_U(c,ct) is the xvelocity 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

Re: About wall shear stress
HiMarkus. Glad to see your response. I wrote the following code.I am confused when I saw the udm0 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 DEFINE_ON_DEMAND(on_demand_WallShear) { 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) { BOUNDARY_FACE_GEOMETRY(f,th,A,ds,es,A_by_es,dr0); 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); fprintf(fp,"\n"); }end_f_loop(f, th) fclose (fp); } 
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 
Re: About wall shear stress
Hi,Markus.
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!)? Cheers. Mike 
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 
Re: About wall shear stress
Hi
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 Thanks 
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 02:42. 