## Tips & Tricks: Estimating the First Cell Height for correct Y+

In previous posts we have stressed the importance of using an appropriate value in combination with a given turbulence modelling approach. Today we will help you calculate the correct first cell height () based on your desired value. This is an important first step as the global mesh resolution parameters will also be influenced by this near-wall mesh as well as the Reynolds number. Let's review the two main choices we have in choosing a near-wall modelling strategy: Resolving the Viscous Sublayer Involves the full resolution of the boundary layer and is required where wall-bounded effects are of high priority (adverse pressure gradients, aerodynamic drag, pressure drop, heat transfer, etc.) Wall adjacent grid height must be order Must use an appropriate low-Re number turbulence model (i.e. Shear Stress Transport) Adopting a Wall Function Grid Involves modelling the boundary layer using a log-law wall function. This approach is suitable for cases where wall-bounded effects are secondary, or the flow undergoes geometry-induced separation (such as many bluff bodies and in modern automotive vehicle design). Wall adjacent grid height should ideally reside in the log-law region where All turbulence models are applicable (e.g. Shear Stress Transport or k-epsilon with scalable wall functions) During the pre-processing stage, we need to estimate the first cell height ( ) so that our falls within the desired range. The computed flow-field will dictate the actual value which in reality will vary along the wall. In some cases, we may need to locally refine our mesh to achieve the desired value in all regions. So how to calculate the First Cell Height for a desired Y+ value? Firstly, we should calculate the Reynolds number for our model based on the characteristic scales of our geometry such that: , where and are the fluid density and viscosity respectively, is the freestream velocity, and is the characteristic length (e.g. pipe diameter, body length, etc.). The definition of the value is such that: The target value and fluid properties are known a priori, so we need to calculate the frictional velocity , which is defined as: The wall shear stress, can be calculated from skin friction coefficient, , such that: The ambiguity in calculating surrounds the value for . Empirical results have been used to provide an estimate to this value: Flow Type Empirical Estimate Internal Flows External Flows We can then input these known values into the above equations to estimate our value for . When considering simple flows and simple geometry, we might find this correlation is highly accurate. However, when considering complex geometry, refinement in the boundary layer may be required to ensure the desired value is achieved. In these cases, you can choose to re-mesh in ANSYS Meshing or use anisotropic mesh adaption (ie. adaption of local cells only in...

## Turbulence Part 4 - Reviewing how well you have resolved the Boundary Layer

In recent posts we have comprehensively discussed inflation meshing requirements for resolving or modeling wall-bounded flow effects due to the turbulent boundary layer. We have identified the y-plus value as the critical parameter for inflation meshing requirements, since it allows us to determine whether our first cell resides within the laminar sub-layer, or the logarithmic region. We can then select the most suitable turbulence model based on this value. Whilst this theoretical knowledge is important regarding composite regions of the turbulent boundary layer and how it relates to y-plus values, it is also useful to conduct a final check during post-processing to ensure we have an adequate number of prism layers to fully capture the turbulent boundary layer profile, based on the turbulence model used (or more precisely, whether we aim to resolve the boundary layer profile, or utilize a wall function approach). In certain cases, slightly larger y-plus values can be tolerated if the boundary layer resolution is sufficient. How can I check in CFD-Post that I have adequately resolved the boundary layer? For the majority of industrial cases, it is recommended to use the two-equation turbulence models, or models which utilize the turbulent viscosity concept and the turbulent viscosity ratio (i.e. the turbulent viscosity over the molecular viscosity). We can make use of this concept to visualize the composite regions of the turbulent boundary layer, and ultimately visualize how well we are resolving the boundary layer profile. Consider the conceptual case-study of the turbulent flow over an arbitrarily curved wall. Prism layers are used for inflation, and tetra elements in the free-stream. Once we have calculated the solution, within CFD-Post we can create an additional variable for the eddy viscosity ratio. Then by plotting this variable on a suitable plane, and superimposing our mesh in the near-wall region, we can visualize the boundary layer resolution. Figure 1 provides an example of a reasonable wall function mesh. There is a good cell transition from the prisms to the free stream tetra elements. The y-plus we have prescribed at the first cell indicates we are in the logarithmic composite region of the turbulent boundary region, which is the region largely dominated by inertial forces and thus we have high levels of turbulence. The turbulence gradually dissipates as we approach free stream conditions (where the levels of turbulence are governed by inlet conditions), which is expected. At this stage, we could even reduce the number of cells in the inflation layer as we are clearly capturing the logarithmic region layer before approaching the free stream. Correspondingly, we could aim to reduce the...

## Turbulence Part 3 - Selection of wall functions and Y+ to best capture the Turbulent Boundary Layer

In recent posts in our series of Turbulence Modelling posts, we have covered boundary layer theory and touched on some useful meshing and post-processing guidelines to check you are appropriately resolving the boundary layer profile. Today we will consider three critical questions that are often asked by CFD engineers when developing or refining a CFD simulation: - Am I using the correct turbulence model for the type of results I am looking for? - Do I have an appropriate Y+ value and a sufficient number of inflation layers? - Am I using the right wall function for my problem? This topic is so important because we know that in turbulent flows the velocity fluctuations within the turbulent boundary layer can be a significant percentage of the mean flow velocity, so it is critical that we capture these effects with accuracy. A Reynolds averaging approach using turbulence models will provides us with an estimate of the increased levels of stress within the boundary layer, termed the Reynolds stresses. In order to appreciate the use of wall functions and the influence of walls on the turbulent flowfield, we should first gain familiarity with the composite regions of the turbulent boundary layer: In the laminar sub-layer region (Y+ < 5) inertial forces are less domineering and the flow exhibits laminar characteristics, which is why this is known as the low-Re region. Low-Re turbulent models (e.g. the SST model) aim to resolve this area and therefore require an appropriate mesh resolution to do this with accuracy. This is most critical for flows with a changing pressure gradient where we expect to see separation, as observed below. In the law of the wall region, inertial forces strongly dominate over viscous forces and we have a high presence of turbulent stresses (this is known as the high-Re composite region). If using a low-Re model, the whole turbulent boundary layer will be resolved including the log-law region. However, it possible to use semi-empirical expressions known as wall functions to bridge the viscosity-affected region between the wall and the fully-turbulent region. The main benefit of this wall function approach lies in the significant reduction in mesh resolution and thus reduction in simulation time. However, the shortcoming lies in numerical results deteriorating under subsequent refinement of the grid in wall normal direction (thus reducing the Y+ value into the buffer layer zone). Continued reduction of Y+ to below 15 can gradually result in unbounded errors in wall shear stress and wall heat transfer (due to the damping functions inherent within the wall...

## Tips & Tricks: Turbulence Part 2 - Wall Functions and Y+ requirements

Previously we have discussed the importance of an inflation layer mesh and how to implement one easily in ANSYS Meshing. We also touched upon the concept of mesh y+ values and how we can estimate them during the inflation meshing process. In other posts, we also discuss the different turbulence models and eddy simulation methods available to ANSYS CFD users. In today's post, we'll talk in more detail about y+ values apply to the most commonly used turbulence models. From our earlier discussions, we now understand that the placement of the first node in our near-wall inflation mesh is very important. The y+ value is a non-dimensional distance (based on local cell fluid velocity) from the wall to the first mesh node, as you can see in the image below. To use a wall function approach for a particular turbulence model with confidence, we need to ensure that our y+ values are within a certain range. Looking at the image above, we need to be careful to ensure that our y+ values are not so large that the first node falls outside the boundary layer region. If this happens, then the Wall Functions used by our turbulence model may incorrectly calculate the flow properties at this first calculation point which will introduce errors into our pressure drop and velocity results. The upper range of applicability will vary depending on the flow physics and the extent of the boundary layer profile. For instance, flows with very high Reynolds numbers (typically aircraft, ships, etc) will experience a logarithmic boundary layer that extends to several thousand y+ units, whereas low Reynolds number flows such as turbine blades may have an upper limit as little as 100 y+ units. In practice, this means that the use of wall functions for these class of flows should be avoided as their use will limit the overall number of mesh nodes that can be sensibly placed within the boundary layer. In general, it is recommended that you endeavour to place sufficient inflation layer cells within the boundary layer, rather than simply focusing on achieving any particular y+ value. This will be covered in detail in a future post In addition to the concern about having a mesh with y+ values that are too large, you need to be aware that if the y+ value is too low then the first calculation point will be placed in the viscous sublayer (logarithmic) flow region and the Wall Functions will also be outside their validity (below about y+ < 11). You can imagine that this would become an issue if a mesh intended to be used with wall functions is then refined near the wall. Fortunately, the use of...

## Tips & Tricks: Convergence and Mesh Independence Study

The previous posts have discussed the meshing requirements that we need to pay attention to for a valid result. It is important to remember that your solution is the numerical solution to the problem that you posed by defining your mesh and boundary conditions. The more accurate your mesh and boundary conditions, the more accurate your "converged" solution will be. CONVERGENCE Convergence is something that all CFD Engineers talk about, but we must remember that the way we generally define convergence (by looking at Residual values) is only a small part of ensuring that we have a valid solution. For a Steady State simulation we need to ensure that the solution satisfies the following three conditions: - Residual RMS Error values have reduced to an acceptable value (typically 10-4 or 10-5) - Monitor points for our values of interest have reached a steady solution - The domain has imbalances of less than 1%. RMS Residual Error Values Our values of interest are essentially the main outputs from our simulation, so pressure drop, forces, mass flow etc. We need to make sure that these have converged to a steady value otherwise if we let the simulation run for an additional 50 iterations then you would have a different result. Ensuring that these values have reached a steady solution means that you are basing your decisions on a single repeatable value. Example of Monitoring a Value of Interest As a rule, we must ensure that prior to starting a simulation we clearly define what our values of interest are, and we make sure that we monitor these to ensure that they reach a steady state. As previously highlighted, we also need to make sure that the Residual RMS Error values are to at least 10-4. Finally, we need to ensure that the overall imbalance in the domain is less than 1% for all variables. Imbalances in the Domain MESH INDEPENDENCE STUDY The approach outlined above results in a single solution for the given mesh that we have used. Although we are happy that this has "converged" based on RMS Error values, monitor points and imbalances, we need to make sure that the solution is also independent of the mesh resolution. Not checking this is a common cause of erroneous results in CFD, and this process should at least be carried out once for each type of problem that you deal with so that the next time a similar problem arises, you can apply the same mesh sizing. In this way you will have more confidence in your results. The way we...