Wall functions
Overview
Wall functions allow Reynolds-averaged simulations at high Reynolds number without resolving the thin viscous sub-layer adjacent to solid boundaries. Instead of placing many mesh layers in the region where molecular viscosity dominates, the first cell centre is located in the logarithmic layer and empirical law-of-the-wall relations supply the missing near-wall physics.
Wall functions are implemented as boundary conditions on turbulence fields
(nut, epsilon, omega, etc.) applied to wall patches. They work
together with a no-slip velocity condition on U and must be paired with a
mesh whose near-wall spacing satisfies the intended range - see
Mesh requirements.
Near-wall flow
At a solid wall the no-slip condition forces the mean velocity to zero, so flow near the surface is dominated by variation in the wall-normal direction. Away from corners and separation, the near-wall mean flow is well approximated as a one-dimensional boundary-layer profile: parallel velocity varies with distance from the wall, while gradients in the wall-parallel directions are small compared with .

DNS data from Lee and Moser 39
The profile divides naturally into regions:
| Region | Approximate | Character |
|---|---|---|
| Viscous sub-layer | ; molecular viscosity dominates | |
| Buffer layer | Transition between viscous and turbulent stress | |
| Log (inertial) layer |
Non-dimensional quantities are defined using the friction velocity :
where is the wall shear stress, is density, and is kinematic viscosity. In the log layer, turbulent stress dominates and the velocity profile follows the logarithmic law with von Kármán constant and roughness parameter (giving ).
Resolving this profile directly requires very fine near-wall meshing (). Wall functions avoid that cost by assuming the cell centre adjacent to the wall lies in the log layer and that the profile between the wall and that point follows the law of the wall.
Momentum transfer
For incompressible RAS with a linear eddy viscosity closure, the mean momentum equation uses an effective viscosity (see Linear eddy viscosity models). Near a wall, the wall-parallel shear stress is related to the velocity gradient in the wall-normal direction:
In the finite-volume discretisation, the velocity gradient between the wall (no-slip, ) and the centroid of the first interior cell (distance , velocity ) is approximated using an effective viscosity at the wall patch:
If the cell-centre velocity and distance are known, the law of the wall provides the correct for the corresponding . Combining the definitions above gives a closure for the turbulent viscosity at the wall patch:
and therefore
OpenFOAM momentum wall functions (nutUWallFunction, nutkWallFunction,
etc.) evaluate from the local flow and set on
the nut patch field accordingly. The velocity field retains
noSlip on
U; the wall function modifies only the turbulent viscosity used in the
wall-adjacent stress calculation, not the wall velocity itself.
Velocity-based and -based formulations
Two common routes to are available:
-
Velocity-based (
nutUWallFunction,nutUBlendedWallFunction, …): is computed from the magnitude of the tangential velocity at the first cell centre relative to the wall. -
-based (
nutkWallFunction,nutkRoughWallFunction): is estimated from the turbulent kinetic energy at the cell centre, , and hence .
Both approaches apply the same log-layer formula for in the inertial region:
In the viscous sub-layer limit (), the wall function reverts to (i.e. ).
Blending treatments
When the first cell centre falls in the buffer layer, neither the pure
viscous nor the pure log-layer estimate is accurate. OpenFOAM wall functions
support blending between the two predictions via the blending entry:
blending | Behaviour |
|---|---|
stepwise | Viscous below , log-layer above (high-Re default) |
max | |
binomial | Smooth blend; used by nutUBlendedWallFunction and recommended with omegaWallFunction for automatic wall treatment |
The blended friction-velocity form used by nutUBlendedWallFunction is:
with blending exponent by default 48.
Scalar wall functions
Turbulence model scalars require consistent wall treatment alongside
nut:
| Field | Typical wall BC | Role |
|---|---|---|
k | kqRWallFunction | Zero-gradient; not a wall function - assumes at the cell centre is representative in the log layer |
epsilon | epsilonWallFunction | Sets and turbulent production from |
omega | omegaWallFunction | Sets and ; use blending binomial with nutUBlendedWallFunction for full automatic wall treatment |
k (low-Re) | kLowReWallFunction | Analytic sub-layer profile when resolving |
kqRWallFunction is a wrapper around zero-gradient and does not impose a
value at the wall. In high-Re wall-function mode, turbulent kinetic energy
is not forced to zero on the patch; near-wall damping is handled through
.
High and low Reynolds number operation
High Reynolds number (wall-function mode) is intended for
on the first cell centre. The mesh skips the
viscous sub-layer; blending stepwise or lowReCorrection false on
epsilonWallFunction uses only the log-layer limit.
Low Reynolds number operation resolves the sub-layer (,
typically 10–20 wall-normal layers) and uses laminar viscosity near the
wall. Enable low-Re corrections (blending binomial, lowReCorrection true, or dedicated conditions such as nutLowReWallFunction and
kLowReWallFunction) when the first cell centre lies below the log layer.
Mismatch between the chosen wall treatment and the actual distribution
is a common source of inaccurate drag or heat-transfer predictions and should
be checked with a post-processing function object such as yPlus.
Usage
Wall functions are specified on wall patches in the field files. A typical
high-Re – setup:
// 0/U
fixedWalls
{
type noSlip;
}
// 0/nut
fixedWalls
{
type nutkWallFunction;
value uniform 0;
}
// 0/k
fixedWalls
{
type kqRWallFunction;
value uniform 0;
}
// 0/epsilon
fixedWalls
{
type epsilonWallFunction;
value uniform 0;
}
Shared coefficients (Cmu, kappa, E) can be set on any wall-function
patch; defaults are , , .
Model options
OpenFOAM includes several momentum wall-function variants. The following summarise the main RAS options documented in this section:
Additional conditions, including velocity-based, rough-wall, tabulated, and low-Re variants, are documented under Wall boundary conditions.
Further information
Source code:
Related: