Skip to content
Draft. This manual is new and still being checked against the software as it is verified. Some pages will change. If something here does not match what you see, the software is right — tell us and we will fix the page.

y+ and wall treatment

The height of the first cell against a wall decides which of two completely different near-wall strategies the turbulence model is using — and if it lands between them, neither one is valid. This is why the Boundary layers panel asks for a target y+ before it asks for anything else, and why the Models panel makes you choose a wall treatment rather than picking one silently.

It is the single most common way a CFD result is wrong while looking fine.


In the bulk of the flow, velocity changes over distances comparable to the size of the body. Against a wall it goes from freestream to zero over a distance measured in fractions of a millimetre, and the shape of that transition is not smooth: it has distinct regions with different physics governing each.

That thin region is where the useful numbers come from. The velocity gradient at the wall is the wall shear stress, which is skin friction drag and — more importantly — the thing that decides whether the boundary layer survives an adverse pressure gradient or separates. Get the near-wall treatment wrong and you do not get a slightly wrong friction drag; you get separation in the wrong place, and therefore the wrong pressure drag, the wrong lift and the wrong wake.


y+ is the distance from the wall to the centre of the first cell, made dimensionless with the local wall shear:

y+ = y · u_τ / ν where u_τ = √(τ_w / ρ)

It is not a mesh setting. It is a result — it depends on the flow, because u_τ depends on the wall shear stress the solution produces. You cannot set y+ directly. You set a first-cell height and find out afterwards what y+ you got.

Made dimensionless this way, the boundary layer has the same structure in every turbulent wall flow, which is why y+ ranges are quoted as universal numbers. The conventional divisions are:

Region Conventional range What is happening
Viscous sublayer y+ below about 5 Viscosity dominates; velocity is very nearly linear in y
Buffer layer roughly 5 to 30 Neither viscosity nor turbulence dominates; no simple law fits
Log layer from about 30 outwards Turbulent stresses dominate; velocity follows the log law

These are the standard published values, not settings in this software.


flowchart TD
W["First cell against the wall"]
W --> A["RESOLVE<br/>Put cells through the sublayer"]
W --> B["MODEL<br/>Bridge the wall with a function"]
A --> A1["First cell centre in the<br/>viscous sublayer, y+ of order 1"]
A1 --> A2["Solver integrates the equations<br/>all the way to the wall"]
A2 --> A3["Costs many thin cells<br/>and high aspect ratio"]
B --> B1["First cell centre in the<br/>log layer, y+ conventionally 30 to 300"]
B1 --> B2["Log law supplies the wall shear<br/>instead of resolving it"]
B2 --> B3["Cheap. Assumes the log law<br/>applies at that point"]
A3 --> X["The trap: the buffer layer.<br/>Too fine for a wall function,<br/>too coarse to resolve"]
B3 --> X

Put enough cells inside the boundary layer that the sublayer itself is resolved — conventionally a first-cell y+ of around 1, with enough cells stacked above it that the log layer is captured too. The solver then integrates the momentum equation right down to the wall and computes the shear from the resolved gradient.

This is the more accurate approach and it is what you want if separation, transition or heat transfer at the wall is the answer. It is expensive: the first cell is very thin, the stack above it needs many layers, and the resulting aspect ratios stiffen the linear system.

Not every turbulence model can do it. The model has to be formulated to integrate to the wall — k-omega and its descendants are, standard k-epsilon is not.

Put the first cell centre out in the log layer and let an algebraic wall function supply the shear stress from the log law, instead of resolving the profile. Conventionally that means a first-cell y+ between about 30 and 300.

Far cheaper — the boundary layer costs a handful of cells rather than dozens — and perfectly respectable for attached flow at high Reynolds number, which is most industrial internal flow. The assumption you are buying into is that the log law applies at that point, and the log law is derived for an attached, equilibrium boundary layer with no strong pressure gradient. Where the flow separates, reattaches, or is strongly accelerated, that assumption is exactly where it stops being true.

A first cell centre at y+ around 10 is the worst of both. It is too far from the wall for the solver to have resolved anything meaningful, and too close for the log law to apply. Classical wall functions applied there are being evaluated outside their range of validity, and the error does not announce itself.

This is why a y+ that varies wildly over a body is a problem even if its mean looks acceptable: a stagnation region can sit at y+ near zero while the same mesh gives y+ in the hundreds further back.

Automatic blending — the third wall-treatment option — uses continuous wall functions that behave sensibly across the whole range rather than falling apart in the middle. It substantially reduces the penalty for a mesh that lands in the buffer layer or varies across the body, and it is the pragmatic choice for real geometry where a uniform y+ is unachievable. It does not make the buffer layer accurate; it makes it survivable.


You are asked for the target y+, not a first-cell height, because y+ is the thing you have an opinion about and metres is not.

From that target, plus the reference velocity, the reference length and the fluid’s kinematic viscosity, the Boundary layers panel works forwards through a flat-plate skin friction correlation to a first-layer height, and reports it back along with the Reynolds number, the total stack thickness and the surface cell size.

That estimate is a flat plate. It knows nothing about your stagnation point, your separation, or the acceleration around your leading edge. Treat the target y+ as a design intent — a statement of which regime you are aiming at — and not as a prediction of what you will achieve.

Three things the panel checks, and each is worth understanding rather than dismissing:

The stack must not be as thick as the surface cell. The layers grow geometrically by the expansion ratio (conventionally kept between about 1.1 and 1.3 — higher reaches the surface cell size in fewer layers but grows the aspect ratio). If the outermost layer is still much smaller than the cell it sits against, there is a jump in cell size at the top of the stack that degrades the gradient there. If the stack is thicker than the surface cell, the geometry is inconsistent.

Aspect ratio. A first cell that is very thin and comparatively wide has a high aspect ratio. It is usually tolerable inside a layer stack — the flow direction is along the cell, which is the benign orientation — but it makes the linear system harder, and it is worth watching if a run is converging poorly.

Layer coverage. The mesher does not always succeed in inserting the layers it was asked for; on concave corners and thin features it gives up locally. The panel reports the achieved percentage after meshing and warns below 70%. This matters more than it sounds: the y+ you asked for is only achieved where the layers were actually inserted. Somewhere below full coverage, the mesh is running one wall treatment on part of the body and another on the rest.

The target is intent; the achieved y+ is the result. Two places give you the answer after a run:

  • Add the y+ result-control item, which writes the field on every wall patch. You can then colour the surface by it in post-processing and see where it goes out of range rather than reading a single number.
  • The report’s verification checklist reports the achieved y+ range against the wall treatment you selected, and states which range it is judging against — wall functions are checked against the 30-to-300 band, a resolved treatment against a low-y+ band.

If the achieved range does not match the treatment you chose, the turbulence model has been used outside the regime it was configured for, and the run needs redoing rather than reinterpreting.


The wall treatment is not an independent setting. Choosing it selects a coherent set of boundary conditions across the turbulence fields — the eddy viscosity, k, omega or epsilon, and the thermal diffusivity — and different models expect different things:

  • k-epsilon and its variants are high-Reynolds-number formulations designed around wall functions. Resolving the sublayer with them requires a damped low-Re variant and is not the natural way to use them.
  • k-omega SST integrates cleanly to the wall and is at its best resolved, which is much of why it is preferred where separation matters. It tolerates wall functions.
  • Transition models — the Langtry-Menter k-omega SST LM among them — need the sublayer resolved, conventionally y+ of about 1, and a well-specified inlet turbulence state. Run on a wall-function mesh they cannot do the thing they were selected for.
  • Scale-resolving models (LES, DES) resolve the large eddies and need a fine mesh in all three directions in the region of interest, not just normal to the wall.

See Choosing a turbulence model for what those models are actually choosing between.

One further consequence worth knowing: OpenFOAM decides whether a wall function may be constructed from the mesh patch type, not from the field entry. A surface that is physically a wall but was declared as a plain patch will fail at start-up with an error naming a wall-function type and neither the patch nor the cause. The application sets the mesh patch type from the boundary condition to prevent this, but it is worth recognising if you import a mesh from elsewhere.