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

Replicating Scalable Wall Function with a UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 4, 2017, 02:30
Default Replicating Scalable Wall Function with a UDF
  #1
New Member
 
Yousef
Join Date: Dec 2015
Posts: 14
Rep Power: 10
yousefaz is on a distinguished road
Hi,

I am having trouble replicating the Scalable Wall Function in Fluent using a UDF.
The theory seems straightforward: basically the Standard Wall Function implemented a minimum limit on y* > 11.225. My starting point is the standard WF UDF provided in the Fluent UDF manual, which I have verified to be an accurate implementation of the SWF in Fluent code (for ks = 0).

The next step where I am having trouble is implementing the y* limiter to achieve the Scalable Wall Function. I am using an If condition to impose a lower limit of 11.225 on the terms F_STORAGE_R(f,t,SV_WALL_YPLUS) and yPlus (i.e. y*) as shown in the UDF below. The problem is that this does not seem sufficient to replicate the results from the Scalable WF in Fluent (more details below code).

Code:
#include "udf.h"

DEFINE_WALL_FUNCTIONS(scalable, f, t, c0, t0, wf_ret, yPlus, Emod)
{
real wf_value;

//Limiters for Scalable wall function
if(F_STORAGE_R(f,t,SV_WALL_YPLUS) < 11.225) F_STORAGE_R(f,t,SV_WALL_YPLUS) = 11.225;
if(yPlus < 11.225) yPlus = 11.225;

//standard wall function (Zero roughness)
switch (wf_ret)
{
case UPLUS_LAM:
wf_value = yPlus;
break;
case UPLUS_TRB:
wf_value = log(Emod*yPlus)/KAPPA;
break;
case DUPLUS_LAM:
wf_value = 1.0;
break;
case DUPLUS_TRB:
wf_value = 1./(KAPPA*yPlus);
break;
case D2UPLUS_TRB:
wf_value = -1./(KAPPA*yPlus*yPlus);
break;
default:
printf("Wall function return value unavailable\n");
}
return wf_value;
}
The UDF is tested with with a mesh of y+ well below 11.225. In the "Viscous Model" window in Fluent, the "UDF - y+" is set to 0 to prevent triggering the laminar equations (UPLUS_LAM and DUPLUS_LAM) in the UDF.

Comparing flow variables at the wall from the above UDF with the Scalable WF in Fluent, Ystar (y*) is identical for both cases. This is expected as it is manually limited to 11.225. However, Yplus (y+) is significantly lower in the UDF compared to scalable WF (approx 11.3).

The variation in y+ is very odd considering that the wall shear (tau-w) and consequently wall shear velocity (u-tau) are almost identical from the UDF and scalable WF. My understanding is that the wall functions first and foremost calculate the wall shear, and then based on the that the other flow variables are calculated.

Considering the equation y+ = (rho/mu)*u-tau*Yp, it seems the only way to account for the differences in y+ is by altering the first cell centroid height Yp?

Any thoughts or comments are greatly appreciated.

Thanks.
yousefaz 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
Enhanced Wall Treatment paduchev FLUENT 24 January 8, 2018 11:55
Running UDF with Supercomputer roi247 FLUENT 4 October 15, 2015 13:41
Scalable Wall Function junz FLUENT 0 April 18, 2015 21:32
Radiation interface hinca CFX 15 January 26, 2014 17:11
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42


All times are GMT -4. The time now is 10:34.