Assessing Mesh Resolution for Boundary Layer Accuracy
How does mesh cell size affect my flow simulation near an obstacle?
When simulating flow around and over solid obstacles like river beds, submerged obstacles, or duct walls, FLOW-3D calculates the near-wall velocity based on the flow being laminar or turbulent. From the near-wall velocity, other values, such as shear velocity, wall shear stress, and velocity farther from the wall are computed. The size of the mesh near obstacles is important in order to get physical results for these variables. This article describes a simplified way of assessing the best size for cells near the wall, and some ways to implement this in practice.
How should I set friction and roughness?
The friction coefficient (FRCOF globally, or OFRCOF for individual components) should be negative (the default value is -1) so the surface is treated as a no-slip surface. If the flow is laminar everywhere in the simulation, the surface roughness of the obstacle component (ROUGH) should be set to zero. If the flow is turbulent or transitional, ROUGH should be the effective grain size corresponding to uniformly spaced elements. This may be derived from empirical formulae (Manning's n or Strickler's k, for example) if elements are not uniformly sized or spaced. Having selected appropriate friction and roughness coefficients for our components, we turn to mesh resolution issues.
Mesh cell resolution in the boundary layer
The first cell adjacent to an obstacle surface is where the logarithmic or laminar wall velocity profile is applied. The cells along the surface are either normal to the surface, if the surface is on a gridline, or they contain the wall surface. If the flow is laminar, direct differentiation of the velocity profile will be performed, so the cell average will always be correct. In this case, the velocity profile is better resolved as the mesh is refined. The optimal cell size depends only on the required profile accuracy and the tolerated computational time, both of which increase as the cells get smaller.
Figure 1: Near-wall velocity profile regions for turbulent flow
If a turbulence model is active, the first cell near the obstacle always gets its velocity according to a logarithmic profile corresponding to the log-law region shown in Figure 1. The first cells along the wall should be sized so that they include the viscous sub-layer and end well within the log-law region of the boundary layer. If the first cell outer edge falls in the viscous sub-layer or extends into the outer or free-stream region, then the actual near-wall velocity and shear stress deviate from the log-law calculation (Figure 1). Finding the correct cell size is a matter of estimating the height of the boundary layer regions normal to the solid surface.A helpful value for this is the non-dimensional normal distance from the wall y+, sometimes referred to as the viscous length.
Finding an appropriate cell size
In the equations below (illustrated in Figure 1), uτ is the shear velocity, τw is the shear stress on the solid, y is the normal distance from the solid, ρf is the fluid density, and μf is the fluid dynamic (molecular) viscosity.
In order to estimate y+, the shear stress τw must be estimated manually, and the interested reader is referred to the hydraulics literature for help with this. In general, y+ (as a function of the cell size) should be greater than 30 (where the inner layer transitions smoothly into the log-law region) and less than a value that depends on the Reynolds number of the flow and the thickness of the boundary layer (generally 100 to 500 is a reasonable upper limit). When manual estimation of τw is impossible, multiple simulations can be used to iterate toward a ‘best fit’, where the observed value (shear stress or velocity) levels off as shown in Figure 2.
Figure 2: Accuracy of simulated average velocity as a function of the grid resolution.
Tips on implementing boundary-layer cell size
Implementation of a ‘best’ cell size is fairly simple. If the component surface is angled so that it matches the direction of the gridlines (as shown in Figure 2), then fixed points should be used at the surface itself and at the appropriate distance from the surface (so that the first cell distance y meets the y+ criteria just explained). If the obstacle surfaces are not parallel to the mesh gridlines, use nested mesh blocks so that the cells nearest the surfaces are of an appropriate size.
The approximations used to calculate parameters at solid surfaces assume that flow is fully developed, and caution should be exercised when interpreting the results for undeveloped flows.