y+ and First Cell Height Explained for CFD
A practical guide to understanding dimensionless wall distance (y+), its importance in turbulence modeling, and how to estimate your first cell height.
Generating an accurate mesh is one of the most critical and challenging aspects of Computational Fluid Dynamics (CFD). Near solid walls, velocity gradients are extremely steep, and capturing these gradients accurately depends entirely on the resolution of your inflation layers.
This guide explains the concept of dimensionless wall distance (), its role in boundary layer resolution, and how to estimate the first cell height required for your simulation.
What is ?
The dimensionless wall distance, , is a non-dimensional parameter used to describe how fine or coarse a mesh is relative to the viscous near-wall flow field.
Mathematically, it is defined as:
Where:
- is the physical distance to the wall (specifically, the distance to the centroid of the first cell).
- is the friction velocity.
- is the kinematic viscosity of the fluid.
The friction velocity is defined in terms of the wall shear stress () and the fluid density ():
Why Matters Near Walls
Fluid flow over a solid surface creates a boundary layer due to the no-slip condition at the wall. The velocity profile within this boundary layer is not linear; it is typically described by the Law of the Wall, which divides the boundary layer into three main regions:
- Viscous Sublayer (): The region closest to the wall where viscous forces dominate and the velocity profile is nearly linear.
- Buffer Layer (): A transitional region where both viscous and turbulent shear stresses are significant.
- Log-Law Region (): The outer region where turbulent forces dominate and the velocity profile follows a logarithmic function.
To accurately predict skin friction, heat transfer, and flow separation, the CFD solver needs to know which of these regions the first mesh cell falls into.
Wall Functions vs. Wall-Resolved Approaches
When setting up your simulation, you must choose how to treat the boundary layer based on your chosen turbulence model and available computational resources:
Wall-Resolved Approaches
- You aim to resolve the viscous sublayer directly.
- Requires placing the first cell deep within the viscous sublayer ().
- Necessary for complex flow phenomena like separation, reattachment, or accurate heat transfer predictions.
- Cost: Computationally expensive due to the massive number of thin cells required.
Wall Functions (High-Re Models)
- You use empirical formulas (wall functions) to model the flow in the near-wall region instead of resolving it.
- Requires placing the first cell in the log-law region ().
- Cost: Much more computationally efficient. Ideal for high Reynolds number flows where the viscous sublayer is incredibly thin.
Typical Target Ranges
Depending on your approach, there are typical target ranges for :
- : When resolving the viscous sublayer (e.g., using SST, Spalart-Allmaras).
- : When using wall functions (e.g., standard ).
Placing the first cell within the buffer layer () can cause significant errors in many standard turbulence models, as neither the linear viscous approximations nor the logarithmic turbulent approximations are accurate in this transitional region.
Note: These rules of thumb are not universal. Modern wall treatments (like Scalable or Enhanced Wall Treatments in commercial CFD software, or certain wall functions in open-source CFD software) can often handle values across the buffer layer smoothly, but avoiding the buffer region remains a safe engineering practice when unsure.
First Cell Height Estimation Workflow
Since depends on the wall shear stress (), which is an output of the simulation, you cannot know the exact before solving. However, you can estimate it using empirical correlations.
The typical workflow is an iterative process:
- Estimate: Use flat-plate boundary layer correlations to estimate the required first cell height () for your target .
- Mesh: Generate the mesh using this estimated first cell height.
- Solve: Run the CFD simulation to convergence.
- Check: Post-process the results to check the actual values on the walls.
- Remesh: If the actual values are outside the acceptable range for your turbulence model, adjust the first cell height and repeat the process.
Using the y+ and First Cell Height Calculator
To speed up the estimation step, you can use our y+ and First Cell Height Calculator. This tool uses empirical flat-plate correlations to provide an initial estimate for your mesh.
Flat-Plate Estimate Caveats
The calculator assumes flow over a flat plate. In real-world 3D geometries, flow accelerates over curved surfaces, impacts stagnation points, and separates. In these areas, the wall shear stress changes dramatically, meaning the actual will vary across the surface even if the first cell height is constant.
The calculator provides a starting point, not a guarantee.
Relationship with Reynolds Number
The boundary layer thickness and wall shear stress are heavily dependent on the Reynolds number. For the same geometry and target , a higher Reynolds number (faster flow or less viscous fluid) will result in a significantly thinner boundary layer and a much smaller required first cell height. You can verify your flow regime using our Reynolds Number Calculator.
Mesh Growth Rate and Boundary Layer Resolution
Placing the first cell correctly is only part of the challenge. The inflation layer must smoothly transition into the bulk tetrahedral or polyhedral mesh.
- A typical growth rate between adjacent layers is to .
- You generally need at least 10 to 15 layers to adequately capture the boundary layer profile before transitioning to the free-stream mesh.
Dimensional Consistency and Unit Handling
When estimating , it is critical to maintain dimensional consistency. Ensure that your reference velocity, density, dynamic viscosity (or kinematic viscosity), and characteristic length are all using the same system of units (e.g., SI units) to avoid order-of-magnitude errors in your mesh sizing.
Common Mistakes
- Treating estimates as ground truth: Never assume the estimated first cell height guarantees your target . Always verify post-solution.
- Ignoring the bulk flow: Focusing entirely on while neglecting the resolution of wakes, shear layers, or free-stream flow.
- Misapplying turbulence models: Using a low-Re model (requiring ) with a coarse wall mesh (), or using standard wall functions with an overly refined mesh ().
Conclusion
Understanding and first cell height is fundamental to generating reliable CFD meshes. By combining empirical estimates with diligent post-processing checks, you can ensure your turbulence models are operating within their valid ranges and delivering accurate results.
If you are simulating transient flow, the time step size is just as critical as the spatial mesh size. Learn more about it in our Courant Number Explained article.
Engineering Context & Constraints
Assumptions Made
- The article primarily assumes steady, attached, incompressible flow over smooth surfaces for basic estimations.
- Assumes the reader understands basic fluid mechanics (velocity, viscosity, density).
Limitations
- Estimations fail or are highly inaccurate in regions of massive flow separation, shock waves, or complex 3D stagnation points.
References & Bibliography
- NASA Glenn Research Center: Turbulence Modeling Resource
- H.K. Versteeg and W. Malalasekera, An Introduction to Computational Fluid Dynamics
Notice an error?
We strive for engineering accuracy. If you found a mistake, please let us know. See our correction policy.