CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

Replicating Scalable Wall Function with a UDF

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

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

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

#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)
wf_value = yPlus;
wf_value = log(Emod*yPlus)/KAPPA;
wf_value = 1.0;
wf_value = 1./(KAPPA*yPlus);
wf_value = -1./(KAPPA*yPlus*yPlus);
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.

yousefaz is offline   Reply With Quote


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
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 02:54.