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

How to define Shear Stress at boundary using UDF

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

Like Tree1Likes
  • 1 Post By xzdbjx

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 12, 2019, 10:38
Default How to define Shear Stress at boundary using UDF
  #1
New Member
 
Join Date: Sep 2018
Posts: 13
Rep Power: 5
xzdbjx is on a distinguished road
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!
Attached Images
File Type: png e.png (1,019 Bytes, 27 views)
xzdbjx is offline   Reply With Quote

Old   January 13, 2019, 21:14
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 1,786
Rep Power: 28
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Check DEFINE_PROFILE macro in Ansys Fluent Customization manual

best regards
AlexanderZ is offline   Reply With Quote

Old   January 14, 2019, 00:11
Default
  #3
New Member
 
Join Date: Sep 2018
Posts: 13
Rep Power: 5
xzdbjx is on a distinguished road
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 sub-domain 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 y-coordinate of the cell-centroid 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!
xzdbjx is offline   Reply With Quote

Old   January 14, 2019, 00:43
Default
  #4
Senior Member
 
Lucky Tran
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 4,388
Rep Power: 52
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Is all this udf work necessary? You can apply a shear stress using a wall type boundary condition.
LuckyTran is offline   Reply With Quote

Old   January 14, 2019, 01:47
Default
  #5
New Member
 
Join Date: Sep 2018
Posts: 13
Rep Power: 5
xzdbjx is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
Is all this udf work necessary? You can apply a shear stress using a wall type boundary condition.
Thank you for your reply. Some typical literature have been investigated such as:
[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), 257-266.
[2]Blocken, B., Stathopoulos, T., & Carmeliet, J. (2007). CFD simulation of the atmospheric boundary layer: wall function problems. Atmospheric environment, 41(2), 238-252.

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.
Attached Images
File Type: png 1.png (83.5 KB, 63 views)
xzdbjx is offline   Reply With Quote

Old   January 14, 2019, 10:16
Default
  #6
Senior Member
 
Lucky Tran
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 4,388
Rep Power: 52
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Applying the shear stress should be a piece of cake (it's a built-in 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.
LuckyTran is offline   Reply With Quote

Old   January 16, 2019, 02:20
Default
  #7
New Member
 
Join Date: Sep 2018
Posts: 13
Rep Power: 5
xzdbjx is on a distinguished road
Thank you for your reply. The problem has been solved.

Best wishes!
Attached Images
File Type: png ????_20190116151859.png (3.6 KB, 51 views)
eag.10 likes this.
xzdbjx is offline   Reply With Quote

Old   June 8, 2021, 13:00
Default
  #8
New Member
 
Goncalo
Join Date: Jun 2021
Posts: 1
Rep Power: 0
Gonliveira110 is on a distinguished road
How were you able to solve the problem?



Best regards.
Gonliveira110 is offline   Reply With Quote

Reply

Tags
define_source, fluent - udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
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


All times are GMT -4. The time now is 00:25.