Wall Functions
Wall Functions: Theoretical Foundations
Overview
Professor, I often hear people say "make sure y+ is above 30" when talking about wall functions. Why is such a condition necessary in the first place?
The turbulent boundary layer near a wall has a distinct structure consisting of the viscous sublayer, buffer layer, and log-law layer. Wall functions are a technique that utilizes the velocity profile of this log-law layer to compute with coarse cells near the wall. Since it avoids directly resolving the viscous sublayer, it can significantly reduce the number of mesh cells.
So you're skipping the viscous sublayer?
To be precise, it's not "skipping" but approximating the velocity, temperature, and turbulence quantities near the wall using semi-empirical functions. That's the essence of wall functions.
Wall Boundary Layer Structure
First, please explain the structure of the boundary layer.
There are three regions in order of proximity to the wall.
| Region | $y^+$ Range | Dominant Effect | Velocity Profile |
|---|---|---|---|
| Viscous Sublayer | $y^+ < 5$ | Molecular viscosity dominates | $u^+ = y^+$ (linear) |
| Buffer Layer | $5 < y^+ < 30$ | Viscosity and turbulence coexist | Transition region (no explicit formula) |
| Log-law Layer | $30 < y^+ < 300$ | Turbulent stress dominates | $u^+ = \frac{1}{\kappa}\ln(y^+) + B$ |
The definitions of the dimensionless quantities are as follows.
$u_\tau$ is the friction velocity, $\tau_w$ is the wall shear stress, and $\nu$ is the kinematic viscosity.
Log-law (Law of the Wall)
Please explain the log-law formula in detail.
The velocity profile in the log-law layer is expressed by the following equation.
Here, $\kappa \approx 0.41$ (von Karman constant) and $E \approx 9.793$ (integration constant for smooth walls). Rewriting this gives,
What about for rough walls?
For rough surfaces, the constants are modified according to the roughness height $k_s$.
Here, $k_s^+ = k_s u_\tau / \nu$ is the roughness Reynolds number. If $k_s^+ < 2.25$, it's classified as hydraulically smooth; if $k_s^+ > 90$, it's fully rough.
Types of Wall Functions
Are there different types of wall functions?
They can be broadly categorized into three types.
| Wall Function Type | Characteristics | $y^+$ Requirement |
|---|---|---|
| Standard Wall Function | Strictly applies the log-law. Launder-Spalding (1974) | $30 < y^+ < 300$ |
| Scalable Wall Function | Switches to the viscous sublayer formula when $y^+ < 11.225$ | No restriction (internally corrected) |
| Enhanced Wall Treatment | Blends Low-Re damping with wall functions | $y^+ \approx 1$ is ideal |
The Standard Wall Function is the most classical and assumes the $y^+$ of the first cell falls within the 30 to 300 range. Accuracy degrades significantly outside this range.
I see, that's why they say "make sure $y^+$ is above 30." Conversely, for low Reynolds number models, $y^+ \approx 1$ is required.
The Discovery of the Log-law – Prandtl and His Students' Meticulous Experiments
The discovery of the "logarithmic law (log-law)," which forms the basis of wall functions, originated from the meticulous turbulent pipe flow experiments conducted by Ludwig Prandtl and his students in the early 20th century. The fact that the velocity profile in the turbulent region away from the wall follows a logarithmic function was empirically found from data analysis at the time, with theoretical derivation coming later. That this log-law is used daily as the foundation for wall functions in millions of CFD calculations today is a testament to the remarkable longevity of experimental data from 100 years ago.
Computational Methods for Wall Functions
Numerical Implementation of Wall Functions
How are wall functions specifically implemented inside the solver?
Wall functions are implemented as wall boundary conditions. They calculate wall shear stress, heat flux, and turbulence quantities from the values at the center (centroid) of the cell adjacent to the wall. In FVM (Finite Volume Method) based CFD solvers, wall functions are interposed in the calculation of wall fluxes.
Momentum Wall Function
How is the wall function for the velocity field calculated?
The relationship between the velocity at the wall-adjacent cell center $U_P$ and the wall shear stress $\tau_w$ is back-calculated from the log-law.
Solving this for $\tau_w$ gives,
However, since $u_\tau = \sqrt{\tau_w/\rho}$, $\tau_w$ is implicitly included. In implementation, iterative methods like Newton's method or simple substitution are used, or a method defining an equivalent eddy viscosity is employed.
k and epsilon Wall Boundary Conditions
What boundary conditions are applied to the turbulence quantities $k$ and $\varepsilon$?
$k$ and $\varepsilon$ at the wall-adjacent cell are set as follows.
Here, $C_\mu = 0.09$. $\varepsilon$ is often directly assigned (fixed value) as the cell center value. For $k$, some solvers solve the transport equation up to the wall-adjacent cell, while others fix it using the above formula.
So the handling differs by solver.
Exactly. In Ansys Fluent, $k$ is solved via the transport equation while modifying the production term at the wall with a wall function, and $\varepsilon$ is forced to the value from the above formula at the wall-adjacent cell. OpenFOAM's epsilonWallFunction has a similar implementation.
Temperature Wall Function
Is there also a thermal wall function?
Of course. There is also a wall function for the temperature field, similar to the log-law. The form using Jayatilleke's (1969) P-function is standard.
Here, $\text{Pr}_t \approx 0.85$ (turbulent Prandtl number) and $\text{Pr}$ is the molecular Prandtl number. For air ($\text{Pr} \approx 0.71$), the P-function correction is small, but for high Prandtl number fluids like oil ($\text{Pr} > 100$), it has a significant effect.
y+ Pre-estimation
Is there a way to estimate $y^+$ before creating the mesh?
Using empirical formulas for flat-plate boundary layers is the standard approach for estimation.
So from the target $y^+$ and representative Reynolds number, you can back-calculate the first layer thickness $y$. This allows you to set up the inflation layer.
The True Value of y+ Calculation Tools – The Culture of "Pre-estimation"
Nowadays, if you search for "y+ calculator," countless online tools appear, but these only became widespread after the 2010s. Before that, CFD engineers used boundary layer analytical solutions (like the Blasius equation) in hand calculations or spreadsheets to estimate the first layer thickness. The culture was not "create a mesh, run a calculation, and then check y+," but rather "calculate y+ and then design the mesh."