# About the wall shear stress

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

April 10, 2015, 08:51
#1
New Member

Dering Lee
Join Date: Apr 2015
Posts: 5
Rep Power: 11
Hello, everyone.

Now, I met a problem about the wall shear stress calculation in Fluent.

I want to obtain the wall shear stress by using UDF. For the purpose of test,
I choose a simple planar. As shown in the attached figure.

Obviously, the wall shear stress at the lower wall can be calculated by

The UDF is shown below.
Code:
#include"udf.h"
DEFINE_EXECUTE_AT_END(test)
{
face_t f;
real area[ND_ND];
real fp;
cell_t c;
real mu,du;
Domain *domain= Get_Domain (1);
tf1 = Lookup_Thread (domain,6); /*6 represents the lower wall*/
#if !RP_HOST
fp=0.0;
begin_f_loop(f,tf1)
{
F_AREA(area,f,tf1);
c=F_C0(f,tf1);
mu=C_MU_T(c,tf2);
du=C_DUDY(c,tf2);
fp+=mu*du*area[1];
}
end_f_loop(f,tf1)
fp=PRF_GRSUM1(fp);
#endif
node_to_host_real_1(fp);
#if RP_HOST
Message("Fvis:%f\n",fp); /*the viscous force*/
#endif
}
But the result is not the same with that shown by the command line /report/forces/wall-forces in Fluent GUI.
The relative error can be about 10%.
The - turbulence model is used, the fluid is treated as the ideal gas.

How the Fluent calculate the wall shear stress exactly?
Anyway to solve the viscous force by using UDF?

Anyone would like to help me?

Thank you!

DeringLee
Attached Images
 01.jpg (24.8 KB, 32 views)

 April 10, 2015, 19:56 #2 Senior Member   Join Date: Mar 2015 Posts: 892 Rep Power: 18 From your code, I assume you're running in parallel mode. From the perspective of a boundary wall such as you have there: each process has a section of faces allocated to look after, plus a set of exterior faces which lie on the partition interface. These exterior faces are the same faces as the neighboring partition and therefore sums would be over counted (I assume your wall shear stress is greater than Fluent's calculation). Try using an if statement to restrict your calculations to the principal compute nodes, for example: Code: #include"udf.h" DEFINE_EXECUTE_AT_END(test) { face_t f; real area[ND_ND]; real fp; cell_t c; real mu,du; Domain *domain= Get_Domain (1); Thread *tf1,*tf2; tf1 = Lookup_Thread (domain,6); /*6 represents the lower wall*/ #if !RP_HOST fp=0.0; begin_f_loop(f,tf1) if PRINCIPAL_FACE_P(f,tf) // this face is on the principal compute node { F_AREA(area,f,tf1); c=F_C0(f,tf1); tf2=F_C0_THREAD(f,tf1); mu=C_MU_T(c,tf2); du=C_DUDY(c,tf2); fp+=mu*du*area[1]; } end_f_loop(f,tf1) fp=PRF_GRSUM1(fp); #endif node_to_host_real_1(fp); #if RP_HOST Message("Fvis:%f\n",fp); /*the viscous force*/ #endif }

 April 11, 2015, 00:03 #3 New Member   Dering Lee Join Date: Apr 2015 Posts: 5 Rep Power: 11 Dear e, thanks for your reply. But, it seems that the problem you mentioned is not exactly the answer. For serial solution, the viscous forces are still not the same with each other. Besides, the viscosity (include and ), velocity gradient and the face area can also be exported in Fluent GUI. The results obtained by this parameters are the same with that solved by UDF, but not that by /report/forces/wall-forces. So, I wonder how Fluent calculates the wall shear stress exactly? Thank you! Dering Lee

 April 11, 2015, 02:43 #4 Senior Member   Join Date: Mar 2015 Posts: 892 Rep Power: 18 What precise values are you calculating with the UDF and what are the values found from Fluent? How well resolved is your boundary layer? C_DUDY is evaluated at the cell (not at the wall) and therefore there's an approximation you've made (accuracy would be a function of y+). Have a read of this thread where they discuss this issue and provide a solution.

 April 11, 2015, 04:10 #5 New Member   Dering Lee Join Date: Apr 2015 Posts: 5 Rep Power: 11 Thank you 'e' ! I think the information you mentioned is very useful! Regards! Dering Lee