
[Sponsors] 
How to define Shear Stress at boundary using UDF 

LinkBack  Thread Tools  Search this Thread  Display Modes 
January 12, 2019, 10:38 
How to define Shear Stress at boundary using UDF

#1 
New Member
Join Date: Sep 2018
Posts: 13
Rep Power: 4 
Dear all, I am trying to simulate the neutral equilibrium atmospheric boundary layer using Fluent 16.0. When define the upper boundary of my model, the fluid has been considered either to be driven by tangential velocity or shear stress. For shear stress scheme, i have defined the upper boundary as symmetry. However, I am not sure how to define the shear stress using the UDF in Fluent. The equation of the shear stress are given as follows.
I really need your help. Best wishes! 

January 13, 2019, 21:14 

#2 
Senior Member
Alexander
Join Date: Apr 2013
Posts: 1,723
Rep Power: 28 
Check DEFINE_PROFILE macro in Ansys Fluent Customization manual
best regards 

January 14, 2019, 00:11 

#3 
New Member
Join Date: Sep 2018
Posts: 13
Rep Power: 4 
Hi AlexanderZ
Thanks for your reply Perhaps i did not illustrate my problem clearly. Now I am working on the simulation of the equilibrium atmospheric boundary layer using Fluent. A cuboid has been established as fluid region. For the upper boundary condition, the literature has shown that it should be driven by a constant shearing stress as shown in the aforementioned equation. I wanna prescribe an equivalent volume momentum source by creating a subdomain one cell thick at the top boundary to drive the flow. As far as i am concerned, since the shearing stress has the unit N/m2, while the volume momentum has the unit N/m3. Thus, if the constant shearing stress is divided by the cell height, it must be the wanted momentum source. With this consideration, the following code has been listed: DEFINE_SOURCE(xmom_source,c,t,dS,eqn) { real CeC[ND_ND]; real yC,source; real ymax=1.75; //the ycoordinate of the cellcentroid of the upper cell real height=0.1; //the height of the upper cell real rol=1.225; // the density of the air 1.225kg/m3 real tau; Domain *domain=Get_Domain(1); tau=rol*pow(ustar,2); thread_loop_c(t,domain) { begin_c_loop(c,t) { C_CENTROID(CeC,c,t); yC=CeC[1]; if (yC>=ymax) { source=tau/height; dS[eqn]=0.; return source; } } end_c_loop(c,t) } } Please tell me if my consideration is reasonable? Is there any other things i need to pay attention? Thank you for the help. Best regards! 

January 14, 2019, 00:43 

#4 
Senior Member
Lucky Tran
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 4,201
Rep Power: 51 
Is all this udf work necessary? You can apply a shear stress using a wall type boundary condition.


January 14, 2019, 01:47 

#5  
New Member
Join Date: Sep 2018
Posts: 13
Rep Power: 4 
Quote:
[1] Richards, P. J. , & Norris, S. E. . (2011). Appropriate boundary conditions for computational wind engineering models revisited. Journal of Wind Engineering & Industrial Aerodynamics, 99(4), 257266. [2]Blocken, B., Stathopoulos, T., & Carmeliet, J. (2007). CFD simulation of the atmospheric boundary layer: wall function problems. Atmospheric environment, 41(2), 238252. In the pioneers' works, they have suggested to consider the shear stress as an equivalent volume momentum source. Attached please find a illustration of the shear stress boundary condition. 

January 14, 2019, 10:16 

#6 
Senior Member
Lucky Tran
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 4,201
Rep Power: 51 
Applying the shear stress should be a piece of cake (it's a builtin option). What the wall BC does not do is the provide a sink for the dissipation / gradient of epsilon condition.
The equivalent momentum source you need to provide is the divergence of tau. So you are right that you need to divide by something. I'll have to check later if you did it correctly or not. 

January 16, 2019, 02:20 

#7 
New Member
Join Date: Sep 2018
Posts: 13
Rep Power: 4 
Thank you for your reply. The problem has been solved.
Best wishes! 

June 8, 2021, 13:00 

#8 
New Member
Goncalo
Join Date: Jun 2021
Posts: 1
Rep Power: 0 
How were you able to solve the problem?
Best regards. 

Tags 
define_source, fluent  udf 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Laminar Kinetic Energy Model (Walters 2008)  logoswort  Fluent UDF and Scheme Programming  2  May 19, 2017 19:41 
Error finding variable "THERMX"  sunilpatil  CFX  8  April 26, 2013 07:00 
UDF for wall slipping  HFLUENT  Fluent UDF and Scheme Programming  0  April 27, 2011 12:03 
Missing math.h header  Travis  FLUENT  4  January 15, 2009 11:48 
What is the detail definition of wall shear stress  zjm  FLUENT  0  January 2, 2002 07:43 