How to Estimate y+ and First Cell Height for CFD
A practical guide to calculating the first cell height for boundary layer resolution.
How to Estimate y+ and First Cell Height for CFD
When setting up a Computational Fluid Dynamics (CFD) simulation, one of the most critical decisions you will make is how to mesh the boundary layer. The fluid behavior right next to the wall dictates the shear stress, heat transfer, and flow separation characteristics for the entire domain.
To capture these near-wall gradients accurately, you need to set an appropriate "first cell height" () for your inflation layers. This height is determined by a non-dimensional number known as (y-plus).
In this article, we'll explain the physics behind the Law of the Wall, why matters, and how to estimate your first cell height before you even open your meshing software.
What is y+?
In fluid mechanics, is the non-dimensional distance from the wall to the center of the first mesh cell. It is defined as:
Where:
- is the fluid density
- is the friction velocity
- is the absolute distance from the wall (the first cell height, )
- is the dynamic viscosity
Because velocity gradients near a wall are extremely steep, physical distance () isn't a good universal metric for mesh resolution. A cell height of 1mm might be perfectly fine for water flowing slowly in a large pipe, but it would be disastrously coarse for a supersonic jet wing. standardizes this distance across all flow regimes.
The Law of the Wall
To understand why we target specific values, we must look at the turbulent boundary layer velocity profile, commonly known as the Law of the Wall. The boundary layer is divided into three distinct regions:
- Viscous Sublayer (): Right next to the wall, viscous forces dominate over turbulent forces. The velocity profile is essentially linear.
- Buffer Layer (): This is a transition region where both viscous and turbulent shear stresses are significant. The physics here are complex and difficult for models to resolve accurately. This is the danger zone for meshing.
- Log-Law Region (): Further from the wall, turbulent forces dominate. The velocity profile follows a predictable logarithmic curve.
Turbulence Models and y+ Targets
Your choice of turbulence model dictates where your first cell must be located.
Resolving the Viscous Sublayer ()
If you are using a turbulence model designed to resolve the flow all the way to the wall (e.g., SST, Spalart-Allmaras), your first cell must be placed inside the viscous sublayer.
- Target:
- Use Case: Aerodynamics, flow separation, heat transfer, adverse pressure gradients.
- Trade-off: Requires a very fine mesh, increasing computational cost.
Using Wall Functions ()
If you are using a high-Reynolds number model (e.g., Standard ), the solver assumes it doesn't need to resolve the viscous sublayer. Instead, it uses empirical "wall functions" to bridge the gap between the wall and the log-law region. Therefore, your first cell must be placed in the log-law region.
- Target:
- Use Case: Internal pipe flows, HVAC, large architectural flows where resolving the sublayer is computationally prohibitive.
- Trade-off: Cannot accurately predict flow separation or complex heat transfer.
Crucially, you should never place your first cell in the buffer layer () unless you are using specialized -insensitive wall treatments.
If you are unsure which model to use, consult the CFD Simulation Setup Checklist.
How to Estimate the First Cell Height
To find the physical height () required for your target , we have to work backward from the bulk flow properties. This is typically done using flat-plate empirical correlations.
-
Calculate the Reynolds Number (): Determine the bulk flow characteristics using the characteristic length () and freestream velocity (). You can use our Reynolds Number Calculator for this.
-
Estimate Skin Friction Coefficient (): For a flat plate, empirical correlations provide an estimate. A common correlation for fully turbulent flow is:
-
Calculate Wall Shear Stress ():
-
Calculate Friction Velocity ():
-
Solve for (First Cell Height): Rearrange the definition:
Mesh Generation Planning (Prism Layers)
Once you have your first cell height (), you must configure the rest of your prism/inflation layers to capture the entire boundary layer smoothly.
1. Total Boundary Layer Thickness ()
You must ensure your prism layers cover the entire boundary layer. If the boundary layer extends into the tetrahedral/polyhedral core mesh, you will suffer severe numerical diffusion. Use flat-plate empirical correlations to estimate this total thickness.
2. Number of Layers and Growth Rate
To smoothly transition from the tiny first cell height to the larger cells in the core mesh, you need multiple layers that grow at a steady rate.
- Growth Rate: Typically 1.1 to 1.3. A growth rate of 1.2 means each layer is 20% taller than the previous one. Do not exceed 1.3, or the sudden volume change will cause large truncation errors.
- Number of Layers: Usually 15 to 30 layers for wall-resolved meshes (), and 5 to 10 layers for wall-function meshes (). Adjust this number until the total thickness of the layers matches your estimated boundary layer thickness .
Practical Application
Instead of doing this math by hand, you can use our built-in tools together to plan your entire boundary layer mesh:
- Find First Cell Height: Use the Y+ and First Cell Height Calculator based on your target .
- Find Total Thickness: Use the Boundary Layer Thickness Calculator to find .
- Configure Mesher: Enter the first cell height, a growth rate of ~1.2, and adjust the number of layers until the total thickness matches .
Post-Simulation Verification and Sanity Checks
It is critical to remember that the math above relies on flat-plate empirical correlations. Your actual geometry is likely not a flat plate. You will have stagnation points, flow separation, and varying pressure gradients.
Therefore, the calculated is strictly an initial estimate for your mesh generation.
1. Verify Convergence and Mesh Quality
Before trusting any near-wall results, ensure your simulation is fully converged. See CFD Convergence: Why Residuals Are Not Enough. Furthermore, check your mesh quality specifically near the walls. Highly skewed prism cells or sudden volume jumps between the last prism layer and the core mesh will ruin your boundary layer prediction regardless of your value.
2. Plot Actual Contours
Once your simulation has finished, you must plot the actual contours on your wall boundaries in your post-processor.
- If your target was (wall-resolved), but your plots show regions where , you must go back, reduce the first cell height in those specific areas, and run the simulation again.
- If you are using wall functions (), ensure your doesn't accidentally dip into the buffer layer () in low-velocity recirculation zones.
3. Grid Independence
Finally, a proper CFD workflow requires a grid convergence study to ensure your results are not mesh-dependent. You can quantify this using the Grid Convergence Index Calculator.
Disclaimer
These calculations use flat-plate empirical correlations. The actual y+ values in your simulation will vary depending on local flow conditions, separation, and geometry. Always plot and verify y+ values after your simulation has converged. Do not overclaim safety-critical accuracy based solely on these screening estimates.
Engineering Context & Constraints
Assumptions Made
- Flat plate boundary layer correlations used for estimation.
Limitations
- Calculated height is an initial estimate and must be verified post-simulation.
References & Bibliography
No external references are currently listed for this article.
Notice an error?
We strive for engineering accuracy. If you found a mistake, please let us know. See our correction policy.