First Cell Height to y+ Calculator

First Cell Height to y+ Calculator

You have already built the mesh. This says what y+ it actually reaches, whether that suits the near-wall model you intend to run, and — if you have landed in the buffer layer — exactly how much of the wall shear stress you are losing and which way to move.

First cell height to achieved y+

A meshed first cell height → the y+ it reaches, and a verdict against your model
This decides which skin-friction law is used and what the reference length means. External flow uses a LOCAL flat-plate correlation at the station you name, so the answer belongs to that station and not to the whole surface. Internal flow uses a fully developed pipe law, where the wall shear is the same at every station and the reference length is the hydraulic diameter Dh = 4A/P.
The velocity the boundary layer sees: the free-stream speed for external flow, the area-averaged bulk speed for internal flow. For internal flow do not use a centreline velocity — in turbulent pipe flow it is about 20 per cent higher than the bulk mean and the error goes straight into the wall shear.
Everything is converted to SI internally and every output below is given in both SI and Imperial, so nothing is left in the wrong system.
For external flow this is the distance from the leading edge to the station you want the answer at — plate length, chord, or the position along a hull. For internal flow it is the hydraulic diameter, not the pipe length. Getting this wrong is the single commonest way a y+ estimate ends up an order of magnitude out.
The unit for the reference length above.
Air densities come from the ideal-gas law at 101.325 kPa and air viscosities from Sutherland’s formula as the US Standard Atmosphere 1976 states it; water comes from the NIST Chemistry WebBook at 0.101325 MPa. Both are US Government or open sources, so the numbers are reproduced here rather than cited. For sea water, engine oil, a gas at pressure or anything compressible, choose Custom and enter your own pair.
Only used when the fluid above is Custom; otherwise this field shows the preset’s value. For a compressible run use the density at the edge of the boundary layer, not the stagnation density.
Dynamic viscosity, not kinematic. If your solver reports ν in m²/s, multiply by the density to get μ. Confusing the two multiplies or divides your viscosity by the density, so the damage depends entirely on the fluid: in water it is a factor of a thousand and the answer is obviously absurd, but in air it is a factor of only 1.2 and the two numbers look almost identical — 1.81×10−5 Pa·s against 1.51×10−5 m²/s — so the error passes unnoticed and quietly biases every cell height by 20 per cent. Check the units, not the magnitude.
The height of the wall-adjacent cell in the mesh you have — the first layer thickness a mesher reports, not the distance to the cell centre. If your mesher reports the total prism stack thickness instead, divide it out with the prism layer stack calculator first.
Mesh generators default to millimetres, solvers to metres. Mixing them is a factor of a thousand, which is the one error on this page that is obvious the moment you look at the answer.
This decides which verdict you get, because the two treatments want opposite things: a wall-resolved model needs the first cell INSIDE the viscous sublayer and a wall function needs it in the log layer. Neither can start in the buffer layer, which is why 5 < y+ < 30 fails on both settings.
All three are LOCAL correlations and the page never mixes a local one with a plate average. They agree to within half a per cent at Rex = 106 and disagree by 31 per cent at 108; because the first cell height goes as Cf−1/2, 31 per cent in Cf is 14 per cent in cell height. Ignored for internal flow, which uses Petukhov.
This single number decides BOTH the regime named below and which correlation is applied, so the label and the arithmetic can never disagree. On the page this replaces they did not: the text called the flow turbulent above Re = 4 × 106 while the correlation did not switch until 107. Ignored for internal flow, which switches at ReD = 2300.
A factor of exactly two, and the classic error on this calculation. A cell-centred code evaluates y+ at the middle of the wall-adjacent cell, so the CELL is twice as tall as the y+ distance. Ask for y+ = 1 at the centroid and you must build a 2 µm cell if the centroid is to sit at 1 µm.
12.19Example

A 1 m chord in air at 20 °C and 30 m/s with a first cell 0.3 mm tall, meshed for wall functions on a cell-centred solver

Advertisement

From a cell height to a y+, with the factor of two in the open

y⁺ = y u*/ν  ·  y = Δy₁/2 (cell-centred) or Δy₁ (first node)  ·  u* = U√(Cf/2)  ·  u⁺ = y⁺ for y⁺ < 5  ·  u⁺ = (1/κ)ln y⁺ + B for y⁺ > 30
Δy₁
the first cell height you meshed — the input here. The first layer thickness a mesher reports, not the distance to the cell centre
y⁺
the answer: the wall distance of the evaluation point in wall units. This is a result on this page and an input on its inverse, and the two must never be confused
u*
friction velocity √(τ_w/ρ), from a LOCAL skin-friction correlation. It is what converts a length into a wall unit
κ, B
log-law constants, 0.41 and 5.0 here. Fluent uses κ = 0.4187 with E = 9.793, which is B = 5.45; the two sets move the linear/log crossing from 10.80 to 11.22, so treat the crossing as approximate
0.1δ⁺
the top of the log layer in wall units. The real upper bound on a wall-function y+, and often well below 300

Worked example

A 1 m chord in air at 20 °C and 30 m/s with a first cell 0.3 mm tall, meshed for wall functions on a cell-centred solver
The flow first, because y+ is a length divided by a length scale the flow owns. Air at 20 °C gives ν = 1.5060e-05 m²/s, so Rex = 30 × 1/ν = 1,992,004, turbulent
Local skin friction from the Schlichting log-law fit: Cf = 0.003328, so τw = 1.8032 Pa and u* = 1.2237 m/s. The viscous length scale ν/u* is 12.3066 μm, and that is the ruler y+ is measured with
Now the factor of two, and it goes the other way on this page. The cell is 0.3 mm tall, so on a cell-centred solver the y+ evaluation point is at its centroid, 0.15 mm from the wall. Use 0.3 mm here and you get twice the answer — on this mesh that is y+ = 24 instead of 12, which is still in the buffer layer, but at a different mesh it would be the difference between a pass and a fail
y+ = y u*/ν = 1.5×10−4 × 1.2237 / 1.5060e-05 = 12.19
And that is the answer this page exists for: 12.19 is in the buffer layer. Not marginally — squarely. The viscous law says u+ = 12.19 at this y+, the log law says 11.10, and Spalding's formula for the real profile says 9.23. Both laws are high, by 32 and 20 per cent
What that costs, in numbers rather than adjectives. Solve for the friction velocity a pure log-law wall function would infer from the same cell velocity and you get 74 per cent of the true wall shear stress; a pure viscous treatment gives 76 per cent. Call it a fifth to a quarter of your skin-friction drag, biased in one direction, with nothing in the residuals to tell you
Which way to move. The page gives both factors. Multiply the first cell height by 0.0820 and y+ lands at 1, which means a wall-resolved model and a first cell of 24.613 μm. Multiply it by 2.461 and y+ lands at 30, which means wall functions and a first cell of 0.738 mm. Either is defensible; where the mesh is now is not
One more check before you commit to wall functions. The log layer here ends at about 0.1δ, which is y+ = 164 — so the usable wall-function window at this station is roughly 30 to 164, not 30 to 300. And the same mesh reads y+ = 13.77 just downstream of transition and 8.15 at ten per cent of the chord, so the verdict is not uniform along the surface

What the buffer layer actually costs, computed rather than quoted

y+ at the first celltrue u+ (Spalding)viscous law u+ = y+log law u+τw a viscous treatment recoversτw a pure log-law wall function recovers
11.0001.0005.000100%14%
32.9843.0007.68099%25%
54.8665.0008.92597%39%
87.1738.00010.07290%58%
10.88.66610.80010.80480%70%
1510.12715.00011.60568%80%
2011.24620.00012.30756%86%
3012.63430.00013.29642%92%
5014.17950.00014.54228%96%
10016.077100.00016.23216%98%
30018.879300.00018.9126%100%
This is the table the 5 < y+ < 30 rule comes from, and it is worth reading rather than memorising. The true profile is Spalding’s single formula for the law of the wall with κ = 0.41 and B = 5.0. The last two columns are not the ratio of the u+ values: they are what you get by asking what friction velocity a solver would infer from the cell velocity using each law alone, and then squaring the ratio to get a wall shear stress — which is the quantity that becomes your drag. Read the two columns from opposite ends. The viscous law is excellent up to y+ = 5 (97 per cent) and collapses by 30 (42 per cent). The log law is hopeless at 5 (39 per cent) and respectable by 50 (96 per cent). They cross around y+ = 10.8, where BOTH are about 25 per cent above the true u+ and both recover only 70 to 80 per cent of the wall shear. There is no value of y+ between 5 and 30 at which either law is better than 90 per cent right. Real codes do better than a pure law — blended treatments, Menter’s automatic wall treatment, and scalable wall functions that clamp y* at 11.225 — but the ambiguity is in the data the first cell carries, not in the formula, so none of them removes it.

The verdict table: what each y+ band means for each near-wall treatment

y+ at the first cellWall-resolved / low-Re modelWall functionsWhat to do
below 0.3correct, but paying for cells you do not needbadly wrong — the log law recovers well under half the wall shear hererelax the first layer, or keep it and use a low-Re model
0.3 to 1the targetwrong — the log law does not hold herekeep it and run a low-Re model
1 to 5good; heat transfer and transition want the finer endwrong, unless the code uses a scalable wall functionkeep it and run a low-Re model
5 to 30biased low, by 3 to 58 per centbiased low, by 8 to 61 per centMOVE. Refine to y+ = 1 or coarsen to y+ = 30. Do not compromise
30 to 300wrong — the sublayer is not resolvedthe target, provided 300 is below 0.1δ in wall unitskeep it and run wall functions
above 300wrongwrong — the first cell is outside the inner layerrefine, and check the first cell against δ as well as against y+
The percentages in the 5-to-30 row are read off the table above: at y+ = 5 a viscous treatment loses 3 per cent and a log-law wall function loses 61 per cent; at y+ = 30 the viscous treatment loses 58 per cent and the wall function 8 per cent. Note the shape of the middle row — whichever treatment you choose, somewhere in the buffer layer it is losing a fifth to a third of the wall shear, and the best case anywhere in that band is about 80 per cent. That is why the advice is to move rather than to choose. The right-hand column is the whole page in one word: at a first cell that is already fine, the cheapest fix is usually to change the MODEL rather than the mesh, and this is the calculator that tells you which.

Why the buffer layer is the mistake worth catching, and what it costs in wall shear stress

This is the page you want after the mesh exists. Its inverse turns a target y+ into a cell height; this one takes the cell height you actually meshed and says what y+ it reaches and whether that suits the model you are about to run. The two questions look symmetric and are not: the inverse is a design question with a free choice of target, and this one is a verdict on a mesh that already costs money. The verdict is what the page is for, so it is stated in bands rather than left to the reader.

The buffer layer is not a grey area, it is a hole. The near-wall profile has a linear region where u+ = y+, a logarithmic region where u+ = (1/κ)ln y+ + B, and between them a band, roughly 5 < y+ < 30, described by neither. Every wall treatment in every solver is built on one of those two laws or on a blend of them, so a first cell in the buffer layer forces the code to answer a question the physics has not given it. The size of the error is computable and it is on this page: a pure log-law wall function recovers 39 per cent of the true wall shear at y+ = 5, 71 per cent at y+ = 11 and 86 per cent at y+ = 20. A pure viscous treatment goes the other way — 97 per cent at y+ = 5, 80 per cent at y+ = 11, 42 per cent at y+ = 30. Nowhere in the band is either law better than about 90 per cent right.

The crossing point is the trap inside the trap. The two laws are equal at y+ = 10.8 for κ = 0.41 and B = 5.0, and it is tempting to read that as a safe middle. It is the opposite: at the crossing they agree with each other and are both about 25 per cent above the true profile. Agreement between two wrong models is not evidence. This is also why the exact edges of the forbidden band are soft — with Fluent’s constants the crossing moves to 11.22 — and why the sensible advice is to stay well clear rather than to tune up against 5 or 30.

What the error looks like in a run. It does not look like anything. Residuals converge, the mass balance closes, no warning is printed, and the flow field is plausible. What is wrong is the wall shear stress, and everything derived from it: skin-friction drag, the split between pressure and friction drag, wall heat transfer, and the near-wall production of turbulence that then feeds the rest of the domain. A biased, quiet, 20-per-cent error in skin friction is the single commonest reason a clean CFD result disagrees with a measurement, and it survives every mesh-independence study that refines the mesh everywhere EXCEPT the wall-normal direction — because refining the core while holding the first layer leaves y+ exactly where it was.

Wall-function validity is not a separate question, so it is not a separate page. Whether a wall function is valid is exactly the question of where the first cell sits, and the answer has three parts, all of them here. The lower bound: y+ above 30, or above about 11 if the code uses a scalable wall function that clamps y* at 11.225. The upper bound: NOT 300, but 0.1δ expressed in wall units, which this page computes — at low Reynolds number it can be well under 100, and on a small slow geometry there is effectively no log layer to sit in. And the third part, which is the one people miss: the first cell must also be small compared with the boundary layer, because a cell spanning a tenth of δ contains the whole inner layer and resolves none of it, whatever its y+ happens to be.

And y+ is not one number. It varies along every surface, because the wall shear does. A mesh at y+ = 40 at the trailing edge is well above that near the leading edge, and the worst station on a naturally transitioning surface is just downstream of transition, where the skin friction peaks. This page reports what the same mesh reads at that station and at ten per cent of the reference length, which is a real check rather than a restatement of the input. A correlation still cannot see a stagnation point, a separation line, a strong pressure gradient or a curved wall, and any of those will move y+ further than the differences between the correlations offered here — so once the run exists, look at the y+ field the solver reports, and look at the maximum and minimum over each wall rather than the area average.

Advertisement

Frequently asked questions

I have landed at y+ = 12. How bad is that, in numbers?

Bad enough to explain a 20 per cent error in skin-friction drag. At y+ = 12 the true u+ is 9.16, the viscous law says 12 and the log law says 11.06, so the two laws are 31 and 21 per cent high. Turning that into wall shear: a pure log-law wall function recovers 73 per cent of the true τ_w and a pure viscous treatment 76 per cent. The error is a bias, not scatter, so it does not average out over a surface and it does not shrink as the run converges. A blended or automatic wall treatment will do better than either pure law, but it cannot manufacture information the first cell does not carry.

My solver reports a different y+ from this page. Which is wrong?

Probably neither, and the size of the difference tells you which explanation applies. A factor of almost exactly two is the cell-centroid convention — check the select on this page against what your solver reports. A difference of 5 to 15 per cent is the skin-friction correlation, which is a flat-plate or fully developed-pipe fit and knows nothing about your geometry. A difference of a factor of two or more, in the other direction, usually means the real flow has a stagnation point, a separation, a strong pressure gradient or wall curvature at the place you are looking — and then the solver is right and the correlation is not. This page is for sizing and for sanity-checking a mesh before you run it; the solver’s own y+ field is the authority afterwards.

Is y+ = 300 really the upper limit for wall functions?

No. 300 is a rule of thumb that assumes a wide log layer, and the log layer only extends to about 0.1δ. This page computes 0.1δ in wall units and shows it, and at modest Reynolds numbers it comes out below 300 — sometimes far below. A 50 mm duct at 1 m/s of water has almost no log layer at all, so there is no y+ at which a wall function is comfortable and a wall-resolved mesh is the only honest choice. The companion check is the first cell height as a fraction of δ: above about ten per cent, the cell is too big regardless of y+.

Can I fix a buffer-layer mesh by changing the turbulence model?

Sometimes, and it is often the cheaper fix. If y+ is at the low end — say 5 to 8 — you already have a nearly wall-resolved mesh, and switching from wall functions to a low-Re formulation recovers most of the accuracy for free; the viscous law is only 3 per cent off at y+ = 5. If y+ is at the high end, 20 to 30, switching to wall functions does the same thing from the other side. What does not work is staying in the middle and hoping the model sorts it out. Codes with automatic or blended wall treatment — Menter’s formulation in CFX and Fluent, and the scalable wall functions that clamp y* at 11.225 — make the failure graceful rather than absent.

Why does refining my mesh not change y+?

Because y+ depends only on the wall-normal size of the first cell and on the wall shear stress. Refining in the streamwise or spanwise direction, or in the core, does not touch it. This is why a mesh-independence study can look convincing and leave a 20 per cent bias in the drag: every mesh in the family has the same first layer, so every mesh in the family has the same y+ and the same wall-treatment error, and the answers agree with each other beautifully. A wall-normal refinement study — halving the first layer thickness and re-running — is a different and more revealing test.

Does this work for internal flow, and what about the entry length?

Yes, and internal flow is the easier case because fully developed flow has the same wall shear at every station, so there is no y+ variation along the duct. Enter the hydraulic diameter D_h = 4A/P as the reference length. The caveat is the entry region: the flow is not fully developed for roughly 10 to 60 diameters, the wall shear there is higher than the developed value, and so is y+ — so if your domain is short, this page under-reports y+ near the inlet. The other caveat is roughness: these are smooth-wall correlations, and a rough duct has a higher wall shear and a higher y+ than reported here.

Related calculators

References

  1. D. B. Spalding (1961), A single formula for the law of the wall, Journal of Applied Mechanics 28(3), 455. The source of the true near-wall profile used to build the buffer-layer table on this page: y⁺ = u⁺ + e−κB[eκu⁺ − 1 − κu⁺ − (κu⁺)²/2 − (κu⁺)³/6]. It is explicit in u⁺ and implicit in y⁺, so it cannot be evaluated in this site’s expression language, which is numeric and non-iterative by design. The table was therefore computed offline, by inverting Spalding numerically at each y⁺, and printed rather than made a live output. Recorded here so the limitation is visible instead of looking like an omission.
  2. H. M. Nagib, K. A. Chauhan and P. A. Monkewitz (2007), Approach to an asymptotic state for zero pressure gradient turbulent boundary layers, Phil. Trans. R. Soc. A 365, 755. The Coles–Fernholz relation Cf = 2[(1/κ)ln Reθ + C]−2 with κ = 0.384 and C = 4.127, used as the independent check on the skin-friction correlations offered here rather than as one of them. The comparison was made in Reθ space, not Rex space, because the Rex mapping depends on the virtual origin and so cannot separate a bad correlation from a bad starting assumption.
  3. H. Schlichting and K. Gersten, Boundary-Layer Theory. Cited by number for the local log-law skin-friction fit Cf = (2 log10Rex − 0.65)−2.3, valid to Rex = 109, and for the classical log-law constants. Nothing is reproduced from its tables.
  4. F. M. White, Fluid Mechanics. Cited by number for Cf = 0.027 Rex−1/7 and δ/x = 0.16 Rex−1/7. Verified by the identity a one-seventh profile must satisfy, θ = 7δ/72 and Cf = 2 dθ/dx, which reproduces 0.0267 — White’s 0.027 to two figures.
  5. B. S. Petukhov (1970), Heat transfer and friction in turbulent pipe flow with variable physical properties, Advances in Heat Transfer vol. 6, 503. The explicit smooth-pipe friction factor f = (0.790 ln Re − 1.64)−2 for 3000 ≤ Re ≤ 5 × 106, checked here against the implicit Prandtl–von Kármán law solved numerically: within 0.7 per cent from Re = 3 × 104 to 5 × 106.
  6. ANSYS Fluent Theory Guide, Wall functions and Scalable wall functions. Cited by number for the standard constants κ = 0.4187 and E = 9.793, for the y* = 11.225 crossing that scalable wall functions use as a floor, and for the existence of the enhanced and blended treatments this page keeps naming. The crossing was recomputed rather than taken on trust: y⁺ = (1/κ)ln(E y⁺) with those constants gives 11.2247, and with the textbook κ = 0.41, B = 5.0 it gives 10.805, so the edge of the forbidden band is constant-dependent to about 4 per cent.
  7. NIST Chemistry WebBook, Thermophysical Properties of Fluid Systems, isobaric table for water at 0.101325 MPa. A US Government work, so the water presets are reproduced here. The retrieved table was checked against three values that must hold — 999.84 kg/m³ at 0 °C, the density maximum near 4 °C, and 1.002 mPa·s at 20 °C — before any of it was used, because a shifted column in a retrieved table is the failure this project has caught most often.
  8. US Standard Atmosphere 1976 (NOAA / NASA / USAF). A US Government work, and the source for Sutherland’s formula with β = 1.458×10−6 and S = 110.4 K from which the air presets are computed. The verifying identity is the sea-level value: 1.7894×10−5 Pa·s with ρ = 1.2250 kg/m³ gives ν = 1.4607×10−5 m²/s, the published figure to five digits.
  9. NASA Turbulence Modeling Resource, 2D zero pressure gradient flat plate verification case (NASA Langley Research Center). A US Government work and the right place to check a solver’s own skin friction and y+ behaviour against grid-converged CFD, which is a stronger test of a mesh than any correlation on this page.

Setup guidance, not validation. Correlations have ranges of validity and cell-count estimates are order-of-magnitude. A converged simulation is not a correct one. Full disclaimer at calcengines.com/disclaimer/