Draft. This manual is new and still growing. If something here does not match what you see in the software, 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.
Why the wall is the difficult part
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.
What y+ measures
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.
The two strategies
Resolving
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.
Modelling with a wall function
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.
The buffer layer, which is neither
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.
How the application handles it
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.
On a laminar case the field is still there and still sizes the first layer, but the number means nothing to the solver — there are no wall functions to land in a regime of. The panel's hint says so, and tells you to size the layers against the flow feature you are resolving instead.
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.
Checking what you actually got
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 and states the band it is judging against. It has two bands and the product has three wall treatments: Wall functions is checked against 30 to 300, and everything else — a resolved treatment and Automatic blending alike — is checked against y+ below 5. A blended mesh sitting correctly in the log layer is therefore reported as a failure. Read that row against the treatment you actually chose rather than taking its verdict; on a blended case the 30-to-300 band is the one that applies.
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.
Interaction with the turbulence model
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.
Where you act on this
- How-to → Add boundary layers to a wall
- Reference → Boundary layers panel — target y+, layer count, expansion ratio, coverage
- Reference → Models panel — the wall treatment options and the field conditions each one selects
- Choosing a turbulence model
- Verification and validation — wall resolution as a verification check