y+ calculator: first cell height and inflation layers
Type the velocity, a length, the fluid and the y+ you want. You get the Reynolds number, the skin friction, the friction velocity, the distance of the first cell centre from the wall and the first layer height to type into the mesher, plus the boundary-layer thickness and how many inflation layers cover it. Free, no sign-up, runs in your browser.
It works the other way too: give it the first layer you meshed and it tells you the y+ you will get, and draws how y+ changes along the wall. It opens on the Ahmed body challenge of Skill-Lync's Ansys Fluent course; the third tab checks the numbers in your report.
Prandtl-Schlichting · 1/7 power law · Spalding 1961 · Ansys Fluent guide · checked in OpenFOAM v2412 · Updated 20 Nov 2026
Fluent's default air is 1.225 kg/m³ and 1.7894 × 10⁻⁵ Pa·s, the values the challenge asks for. Fluent and OpenFOAM are cell-centred: y+ is read at the centre of the wall cell, half a layer from the wall.
Type the first layer height from your inflation settings. The chart shows the y+ that layer gives along a flat plate of length L; a real body reads higher at the nose.
Set the case above to what you simulated (velocity, length, fluid, the y+ you aimed for, layers and growth ratio), then type the numbers from your report.
y+ of this first layer along a flat plate (turbulent from the leading edge). Shaded: the viscous sublayer, buffer and log-law bands.
- y+ 1 puts the first cell centre in the viscous sublayer: what a model that resolves the sublayer wants (k-ω SST, Spalart-Allmaras, Fluent's enhanced wall treatment): Fluent's guide asks for y+ on the order of 1, acceptable up to 4 to 5.
- Cell-centred solver (Fluent, OpenFOAM, STAR-CCM+): y+ is taken at the first cell centre, 0.01419 mm from the wall, so the first layer you type into the mesher is twice that, 0.02839 mm.
- 28 layers at growth 1.2 cover the boundary layer (δ ≈ 21.7 mm at x = L). Your 20 layers reach 5.3 mm, 24% of δ; the last one is 0.907 mm.
- This is the flat-plate value at x = L, where the wall shear is lowest. Upstream, and on a body's nose where the flow speeds up, τw is higher and so is y+ for the same first layer: check the y+ contour after the first run.
What is y+?
y+ is the distance from a wall in units of the viscous length ν/uτ. It tells you which part of the boundary layer a point sits in, so in CFD it is quoted for the first cell off the wall:
Close to a smooth wall, every turbulent boundary layer looks the same in these units. Below y+ ≈ 5 the flow is a thin viscous sublayer where u+ = y+; above about 30 the velocity follows the log law; in between is the buffer layer where neither holds. Spalding (1961) wrote one formula that covers all three, drawn here with κ = 0.41 and B = 5.2:
A turbulence model either resolves the sublayer, which needs the first cell centre down at y+ ≈ 1, or it bridges the inner layers with a wall function that assumes the first centre is in the log layer, y+ above 30. A first cell in the buffer layer suits neither.
How to calculate the first cell height, step by step
The wall shear stress isn't known before the run, so take it from a flat-plate correlation at the length of the body. For the Ahmed body challenge (U = 25 m/s, L = 1.044 m, Fluent's default air):
| Step | Schlichting | 0.026 Re−1/7 |
|---|---|---|
| ReL | 17,86,772 | |
| Cf | 0.00339 | 0.00333 |
| τw | 1.297 Pa | 1.273 Pa |
| uτ | 1.029 m/s | 1.019 m/s |
| y for y+ = 1 | 0.01419 mm | 0.01433 mm |
| y for y+ = 100 | 1.419 mm | 1.433 mm |
| First layer for y+ = 100 (cell-centred) | 2.839 mm | 2.866 mm |
The first is the Prandtl-Schlichting formula, valid up to Re 10⁹; 0.026 Re−1/7 is the one most Ahmed body reports use (White's book gives 0.027); the third is the 1/7-power-law fit. The two in the table differ by 1.9% in Cf and, because y goes as 1/√Cf, by 1.0% in the wall distance; the 1/7 power law 0.0592 Re−1/5 lands almost on 0.026 Re−1/7 here. Any of them is fine for setting a mesh. Faster flow means a thinner layer: the same body at 40 m/s needs 0.00922 mm for y+ = 1, at 60 m/s 0.00635 mm.
Why your y+ comes out half: the first layer is twice y
The y in the y+ formula is the distance of the point where y+ is evaluated. Fluent and OpenFOAM are cell-centred finite-volume codes and evaluate it at the centre of the wall-adjacent cell, which on a prism or hex layer is half the layer height from the wall:
Skill-Lync read all 684 distinct public Ahmed body reports on 20 Nov 2026. 354 mention y+; 77 derive a first-layer height from the formula above, and only 2 of them double it before typing it into the mesher. The rest enter y itself as the "first layer thickness", so the run's y+ comes out at about half the target: 50 for an aim of 100, or 15, inside the buffer layer, for an aim of 30.
To check it, Skill-Lync ran a 2D flat plate the length of the Ahmed body in OpenFOAM v2412 (simpleFoam, 25 m/s, Fluent's default air, first layer from 0.026 Re−1/7 at x = L):
| Model, target | First layer | y+ at x = L | τw (Pa) |
|---|---|---|---|
| k-ε, wall functions, y+ 100 | 2.866 mm (2y) | 99.0 | 1.26 |
| k-ε, wall functions, y+ 100 | 1.433 mm (y) | 49.4 | 1.24 |
| k-ω SST, y+ 1 | 0.0287 mm (2y) | 0.95 | 1.15 |
| k-ω SST, y+ 1 | 0.0143 mm (y) | 0.48 | 1.18 |
| 0.026 Re−1/7, flat plate | 1.27 |
13,600 to 35,700 cells; the k-ε runs met their residual targets in about 218 iterations, the SST run was stopped at 6,000 with residuals flat below 10⁻⁵. Cases and scripts: Skill-Lync's research notes for this page.
Doubling the layer gives the target to within 1.0%; the undoubled layer gives half of it, 0.498 times. The k-ε wall shear came out -1.2% from the correlation. The SST run's came out -9.7% from it, so its y+ landed at 0.95 instead of 1: y+ goes with √τw, so a 10% error in the wall shear moves it by 5%. Halving the SST first layer halved y+ again (0.506 times) and moved its wall shear by only 2.5%: with the sublayer resolved, the answer barely depends on the first cell.
Which y+ for which turbulence model?
| Near-wall approach | Typical models | First-cell y+ |
|---|---|---|
| Resolve the viscous sublayer | k-ω SST, Spalart-Allmaras, k-ε with Fluent's enhanced wall treatment | ≈ 1 (≤ 4–5) |
| Wall functions | standard k-ε, realizable k-ε with standard or non-equilibrium wall functions | 30–300 |
| Avoid | any | 5–30 |
The figures are Ansys Fluent's: its User's Guide asks for a wall-adjacent y+ "on the order of" 1 for enhanced wall treatment (4 to 5 is acceptable) and 30 to 300 for wall functions, closer to 30 being the most desirable; its Theory Guide says the upper limit depends strongly on the Reynolds number, from as little as 100 to several thousand. Whatever the limit, the first cell has to stay well inside the boundary layer. On the Ahmed body at 25 m/s the flat-plate boundary layer is about 21.7 mm thick at the tail, so y+ = 300 puts the first cell centre 4.26 mm up, a fifth of the way through it.
For the challenge, 48 reports quote the 30 to 300 range and most run k-ε with standard wall functions, which is consistent. What breaks it is refining the mesh for a grid-independence study without changing the inflation: the first layer shrinks into the buffer layer and the drag moves for reasons that have nothing to do with the grid. Hold the first layer fixed while refining the rest, or change the wall treatment with it.
Inflation layers: total thickness and how many to use
Inflation (prism) layers grow geometrically from the first one. N layers of first height Δy₁ and growth ratio r stack up to a total T, the last one is Δy₁ rN−1, and Nδ layers are enough to reach the boundary-layer thickness δ:
A common slip is to write the total as Δy₁ × 1.2N−1: that is the last layer, not the stack. Five layers from 2.839 mm at r = 1.2 make 21.1 mm; the last one is 5.89 mm. Typed as a total thickness, 5.89 mm makes Ansys Meshing squeeze every layer by 3.59 times, first layer included. For y+ = 1 at 25 m/s it takes 28 layers at 1.2 to reach the 21.7 mm boundary layer; for y+ = 100, 6.
The calculator flags a stack that covers only a small part of δ and a last layer much smaller than the core cells next to it: a sudden jump in cell size there costs more accuracy than a few extra layers.
y+ is not one number on a real body
The estimate is the flat-plate value at x = L, where the boundary layer is thickest and the wall shear lowest. Upstream, τw is higher and so is y+ for the same first layer. In the OpenFOAM SST run the layer sized for y+ = 1 at the tail read 1.20 at x = 0.05 m, 1.06 at 0.25 m and 0.95 at the end; the k-ε run read 106 at 0.25 m against 99 at the end, and less near the leading edge where its boundary layer was still developing. On the Ahmed body, the rounded nose and the edges of the slant accelerate the flow and read well above the flat-plate value; the separated wake behind the base reads near zero.
So use the calculator to set the first mesh, run it, plot y+ on the walls in Fluent (Contours, Turbulence, Wall Yplus) or with OpenFOAM's yPlus function object, and adjust where it matters: the slant and the roof edge, where the drag is decided.
What this calculator does not cover
- Pressure gradients and curvature. The flat-plate correlations assume zero pressure gradient; a nose, a slant or a separated region changes τw locally.
- Rough walls and compressible flow. The correlations are for smooth walls at low Mach number; heated or high-speed gas changes ρ and μ near the wall.
- Transition. The external estimate assumes a turbulent boundary layer from the leading edge (laminar below Re 5 × 10⁵). A transition model needs y+ ≈ 1 and a finer streamwise mesh.
- Heat transfer. The thermal sublayer sets its own first-cell requirement for wall heat flux; y+ ≈ 1 is the usual choice.
Setting the near-wall mesh, choosing the wall treatment and proving the result does not depend on the mesh are what separate a CFD run from a CFD answer. The Ahmed body is the external-aerodynamics project of Skill-Lync's Ansys Fluent course.
Frequently asked questions
How do you calculate the first cell height for a given y+?
Work out the Reynolds number on the body length, a skin-friction coefficient from a flat-plate correlation, the wall shear τw = Cf·½ρU², the friction velocity uτ = √(τw/ρ), and then y = y+·μ/(ρ uτ). For the Ahmed body at 25 m/s in Fluent's default air (Re 17,86,772) that is 0.0142 mm for y+ = 1 with Schlichting's correlation. In Fluent or OpenFOAM, y is the distance of the first cell centre from the wall, so the first layer is twice that, 0.0284 mm.
Why is my y+ half of what I calculated?
Because Fluent and OpenFOAM evaluate y+ at the centre of the wall cell, which sits at half the first-layer height. If you type the y from the y+ formula in as the first layer thickness, the centre ends up at y/2 and so does y+. Skill-Lync ran it in OpenFOAM v2412 on a 1.044 m flat plate at 25 m/s: the first layer worked out for y+ = 100 and doubled gave y+ 99.0 at the end of the plate; the same number typed in undoubled gave 49.4. Only 2 of the 77 Ahmed body reports that derive a first-layer height double it.
What y+ should I use for k-epsilon and k-omega SST?
With standard (or non-equilibrium) wall functions, which is what standard k-ε uses by default, put the first cell centre in the log layer, y+ above 30; the upper end depends on the Reynolds number, 300 is the usual working figure. To resolve the viscous sublayer, as k-ω SST, Spalart-Allmaras or Fluent's enhanced wall treatment can, aim for y+ around 1. Keep out of the buffer layer, 5 to 30, where neither law holds.
How do I calculate the total thickness of inflation layers?
Inflation layers grow geometrically, so N layers with first height Δy₁ and growth ratio r add up to T = Δy₁(rᴺ − 1)/(r − 1). Δy₁·r^(N−1) is the height of the last layer, not the total. Five layers of 2.866 mm growing at 1.2 make 21.3 mm, not 5.94 mm. Enough layers to cover the boundary layer, so that the last one blends into the core cells, is the usual aim.
Which skin friction formula should I use for y+?
Any of the flat-plate correlations is fine for a first estimate: at the Ahmed body's Re of 1.79 million, Schlichting's [2 log₁₀(Re) − 0.65]^−2.3 gives Cf = 0.00339 and 0.026 Re^−1/7 gives 0.00333, 1.9% apart, and y+ moves with the square root of Cf, so the first-layer heights differ by 1.0%. The real body's wall shear varies far more than that from nose to tail, so check the y+ contour after the first run.
Does y+ change along the body?
Yes. The estimate uses the flat-plate wall shear at x = L, where it is lowest. Nearer the leading edge the boundary layer is thinner, τw is higher and so is y+ for the same first layer: in Skill-Lync's OpenFOAM k-ω SST run the y+ designed as 1 at the end of the plate was 1.13 at x = 0.1 m and 0.95 at x = L. On a bluff body, the nose and the edges where the flow speeds up read higher still, and separated regions read near zero.
Related on Skill-Lync
- Ahmed body calculator: frontal area, Fluent reference values and a check of your drag coefficient
- CFD near-wall treatment and y+ estimation
- Flow over an Ahmed body using open-source software
- Student project: Week 3, external flow over an Ahmed body
- Pipe flow calculator
- Flow over a cylinder calculator
- Mesh quality calculator
- CFD courses compared
- All free engineering tools
Sources
- Prandtl-Schlichting skin-friction formula, Cf = [2 log₁₀(Rex) − 0.65]−2.3, valid for Re ≤ 10⁹; 1/7-power-law flat plate, δ = 0.37 x Rex−1/5 for Re 5 × 10⁵ to 10⁷: F. Stern, ME:5160 lecture notes on boundary layers (University of Iowa). F. M. White's turbulent flat plate, cf ≈ 0.027 Rex−1/7, as restated in Purdue and Iowa course notes.
- Cf,x = 0.0592 Rex−1/5 (turbulent, 1/7 power law; some notes round it to 0.058 or 0.059) and the laminar (Blasius) flat plate, δ ≈ 5.0 x/√Rex, Cf,x = 0.664/√Rex: F. P. Incropera, D. P. DeWitt et al., Fundamentals of Heat and Mass Transfer, 7th ed., Ch. 7 (Eqs. 7.19, 7.20).
- D. B. Spalding, "A single formula for the law of the wall", Journal of Applied Mechanics 28 (1961) 455-458, in the form with the fourth-order term as written by B. J. Cantwell, J. Fluid Mech. (2022), Eq. 2.5; viscous sublayer (y+ < 5), buffer layer (5 to 30) and log law (y+ > 30, y/δ < 0.3) with κ = 0.41, B = 5.2 as in S. B. Pope, Turbulent Flows (Cambridge, 2000), via course notes.
- Ansys Fluent Theory Guide (2025 R2, §4.18.2): yP is the "distance from the centroid of the wall-adjacent cell to the wall"; upper limit of the log-law region depends strongly on the Reynolds number. Fluent 12.0 User's Guide §12.3.1: wall functions 30 < y+ < 300, y+ ≈ 30 most desirable, avoid the buffer layer; enhanced wall treatment y+ on the order of 1, y+ < 4 to 5 acceptable; §8.3.2 and §8.4.1, default air 1.225 kg/m³ and 1.7894 × 10⁻⁵ kg/m·s.
- Ansys Meshing inflation: First Layer Height is the full height of the first layer, Growth Rate = h(n+1)/h(n), last layer H = h·g^(n−1); the total of N layers is the sum of that geometric series.
- OpenFOAM v2412 source, yPlus function object: y+ = d·√(νeff|∂U/∂n|)/ν with d from nearWallDist, the wall-adjacent cell centre's distance to the wall; on wall-function patches the wall function's own y+ (Cμ1/4 y √k/ν).
- S. R. Ahmed, G. Ramm, G. Faltin, SAE 840300 (1984): body 1,044 × 389 × 288 mm, tested at 60 m/s (ReL = 4.29 × 10⁶); H. Lienhart, S. Becker, SAE 2003-01-0656 (2003): 40 m/s. Both as summarised in the ERCOFTAC classic database.
- OpenFOAM v2412 (opencfd/openfoam-run:2412), run by Skill-Lync on 20 Nov 2026: simpleFoam, 2D zero-pressure-gradient flat plate 1.044 m long, kEpsilon with nutkWallFunction and kOmegaSST with nutLowReWallFunction, the yPlus and wallShearStress function objects.
- Skill-Lync, all 684 distinct public Ahmed body reports (839 pages), read 20 Nov 2026: velocities, y+ targets, first-layer heights, inflation settings.
- Skill-Lync, scripts/verify/yplus.py: re-implements every formula (Colebrook by bisection, the inflation series by summation, the inverse by bisection, Spalding inverted and checked against both limits) and checks the OpenFOAM results; the page checks itself against it at build time.