Understanding the y+ calculator — concept and principle
In computational fluid dynamics (CFD), the height of the first mesh cell next to a wall decides whether the solver can resolve the thin viscous layer of the boundary layer. This calculator estimates that first cell height for a target y+ before you build the mesh, using a flat-plate turbulent skin-friction correlation.
How it is calculated
Re = ρ U L ÷ μ
Cf = 0.026 × Re^(−1/7)
τw = ½ × Cf × ρ × U²
uτ = √(τw ÷ ρ)
Δy = y+ × μ ÷ (ρ × uτ)
- U free-stream velocity (m/s), L reference length (m), ρ density (kg/m³), μ dynamic viscosity (Pa·s).
- The viscous length μ ÷ (ρ uτ) is shown in µm; a regime check flags Re below 5 × 10⁵.
The principle
Near a wall, velocity drops to zero, and in a very thin layer viscosity dominates. Turbulence scientists describe this region in "wall units": distances scaled by the viscous length ν ÷ uτ, where the friction velocity uτ comes from the wall shear stress. y+ is the wall distance measured in these units. Different turbulence models need different y+ for the first cell: wall-resolved approaches typically aim for y+ around 1, while wall functions expect the first cell further out in the log layer. Because shear stress is unknown before the simulation, an empirical flat-plate formula supplies a first guess.
Worked example
Default inputs: U = 20 m/s, L = 1 m, ρ = 1.225 kg/m³, μ = 1.81 × 10⁻⁵ Pa·s, target y+ = 1.
- Re = 1.225 × 20 × 1 ÷ 0.0000181 = 1,353,591.
- Cf = 0.026 × 1,353,591^(−1/7) = 0.00346.
- τw = 0.5 × 0.00346 × 1.225 × 20² = 0.8476 Pa.
- uτ = √(0.8476 ÷ 1.225) = 0.8318 m/s.
- Δy = 1 × 0.0000181 ÷ (1.225 × 0.8318) = 0.00001776 m = 0.01776 mm; viscous length = 17.76 µm.
- Re ≥ 5 × 10⁵, so the regime check reads Turbulent.
| Free-stream velocity U (m/s) | First cell height Δy (mm) |
|---|---|
| 5 | 0.06435 |
| 10 | 0.03381 |
| 15 | 0.0232 |
| 20 | 0.01776 |
| 25 | 0.01444 |
| 30 | 0.01219 |
| 40 | 0.009332 |
How to read the result
Use Δy as the first layer thickness, then grow layers outward with a modest growth ratio until the boundary layer is covered. After the first solution, plot the actual y+ on the walls; it varies along the surface, peaking near leading edges and dropping near separation. If it misses the target, adjust the mesh and rerun.
Common mistakes
- Using a length that does not match the flow, such as a whole vehicle length for a small local feature.
- Mixing kinematic and dynamic viscosity.
- Targeting y+ = 1 with a wall-function model, or y+ = 50 with a low-Re model.
- Assuming the estimate holds in separated or strongly accelerated flow.
Frequently asked questions
What y+ should I aim for?
It depends on the turbulence model; wall-resolved models typically need y+ near 1, wall functions much higher values.
Why does y+ change along the wall?
Wall shear stress varies with local flow speed and pressure gradient.
What viscosity should I use for air?
About 1.81 × 10⁻⁵ Pa·s near 15–20 °C; it rises with temperature.
Does a smaller first cell always help?
Not necessarily; it increases cell count and can hurt convergence if far smaller than needed.
Sources: Standard boundary-layer relations: wall units y+ = ρuτy/μ and flat-plate turbulent skin-friction correlation Cf ≈ 0.026 Re^(−1/7)