CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

About the wall shear stress

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2015, 09:51
Question About the wall shear stress
  #1
New Member
 
Dering Lee
Join Date: Apr 2015
Posts: 5
Rep Power: 11
TurbineLee is on a distinguished road
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

\tau=  \mu \frac{\partial u}{\partial y}
F_{vis}=  \sum \left[ \mu(i) \frac{\partial u(i)}{\partial y} \times area(i) \right]

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);
	Thread *tf1,*tf2;
	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);
			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
}
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 k-\varepsilon 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
File Type: jpg 01.jpg (24.8 KB, 33 views)
TurbineLee is offline   Reply With Quote

Old   April 10, 2015, 20:56
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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
}
`e` is offline   Reply With Quote

Old   April 11, 2015, 01:03
Red face
  #3
New Member
 
Dering Lee
Join Date: Apr 2015
Posts: 5
Rep Power: 11
TurbineLee is on a distinguished road
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 \mu(include \mu_t and \mu_{eff}), velocity gradient \frac{\partial u}{\partial y} 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
TurbineLee is offline   Reply With Quote

Old   April 11, 2015, 03:43
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
`e` is offline   Reply With Quote

Old   April 11, 2015, 05:10
Smile
  #5
New Member
 
Dering Lee
Join Date: Apr 2015
Posts: 5
Rep Power: 11
TurbineLee is on a distinguished road
Thank you 'e' !
I think the information you mentioned is very useful!

Regards!

Dering Lee
TurbineLee is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Natural convection in a closed domain STILL NEEDING help! Yr0gErG FLUENT 4 December 2, 2019 01:04
Wall shear stress GamFlu Main CFD Forum 0 June 11, 2011 05:33
Wall Shear Stress GamFlu FLUENT 0 June 11, 2011 04:52
relationship between wall shear stress and TKE winter FLUENT 0 December 11, 2007 18:11
Re: About wall shear stress Mike FLUENT 9 November 17, 2003 15:41


All times are GMT -4. The time now is 13:38.