Skip to content

Best practices

This page gives general best practices for various CFD applications for which Ansys Fluent can be used.

  • Understand why is CFD needed in the first place? (What is the purpose of the simulation)
  • This can be best answered, if you want a design and optimization of the components involved. Does accuracy matter and if yes, how much?. Is it a safety analysis, in which case the accuracy should be highly regarded. Or you need to perform a virtual prototype?

Errors

  • Round-off errors is a computer's ability to work a certain numerical precision. The causes for machine round-off are usually high grid aspect ratios. Large differences in length scales, or large variable range.
  • Identifying round off errors is best done by comparing a solution that has been compared with single precision.
  • Iteration errors is the difference between converged solution and the solution at iteration n. These are best observed by plotting the value of quantities of interest as the solution iterates and selecting a tighter convergence criterion and continueing iterating and plotting.
  • This can be repeated until values of interests no longer change. And finally, report mass and energy fluxes to ensure these are being conserved.
  • Discretization errors is the difference between the solution on a given grid and exact solution on an infinitely fine grid.
  • Solution errors is the difference between converged solution on current grid and "exact" solution of model equations.
  • Model errors is the difference between exact solution of the model equations and reality (data or analytic solution).
  • Due to model errors, discrepancies between data and calculations can remain, even after all numerical errors have become insignificant.

Mesh

  • Chosing mesh strategy, should require answering the question, how accurate does one want it to be? How much effecient should it be and how easy is it to generate the same?
  • More specifically, what's the maximum skewness and aspect ratio that can be taken as appropriate, should there be low cell count for resolving overall flow features vs high cell count for greater details and the time available for the defined mesh settings.
  • The goal is to find the best compromise between accuracy, efficiency and easiness to generate the mesh, given the hardware capabilities at hand.
  • To capture flow physics, meshes should be able to capture boundary layers, heat transfer, wakes/shocks and flow gradients.
  • Recommended meshing guidielines for boundary layers include resolving both, veolocity and thermal boundary layers.
  • Mesh should having minimum 10-15 elements across boundary layer.
  • Mesh expansion ratio in the wall normal direction should be moderate < 1.2 .....1.3
  • y+ ~ 1 for heat transfer and transition modelling.

Capturing the boundary layer appropriately is key.

Types of mesh on which the quality depends.

Sudden changes in a mesh density should be avoided.

Quad/Hex aligned with flow are more accurate than tri with same interval size. Image shows contours of axial velocity magnitude for an inviscid co-flow jet.

For complex flows without dominant flow direction, Quad and Hex meshes lose their advantage. (Contours of temperature for inviscid flow.)

Turbulence

The following turbulence models is available within Ansys Fluent.

Three types of approaches to turbulent flow.

  • DNS (left in the image above) or Direct Numerical Simulation numerically solves teh full unsteady Navier-Stokes equation.
  • DNS also resolves the whole spectrum of scales.
  • Modelling of other terms in NS is not required.
  • Computationally expensive, neither practical for industrial applications.

  • LES (middle in the image above) or Large eddy simulation solves the filtered NS equations.

  • Some turbulence is directly resolved.
  • Less expensive than DNS but efforts and computatinoal resources needed are still too large for most practical applications.
  • RANS (right in the image above) or Reynolds Averaged Navier Stokes Simulation solves the time-averaged NS equations.
  • All turbulent flow is modelled.
  • For most problems, the time-averaged flwo are all that is needed.
  • Widely used industrial approach.

Increasing computatinal cost of each turbulent approach in Fluent.

  • For general approaches, Realizable \(k-\epsilon\) or SST \(k-\omega\) models are recommended choices for standard cases.
  • Where highly accurate resolution of boundary layers is critical, such as applications involving flow separation or finely resolved ehat transfer profiles, SST \(k-\omega\) is preferred.
  • If only a crude estimate of turbulence is required, the standard \(k-\epsilon\) model can be used.
  • This might occcur in problems where teh solution depends more strongly on other physical models or modelling assumptions than on the turbulence model.
  • The dimensional velocity profile as \(U/U_{\tau} = u_{\tau} = \sqrt{\frac{\tau_{wall}}{\rho}}\), defines the wall distance as \(y+ = \frac{y\cdot u_{\tau}}{\nu}\)

Using non-dimensional velocity and non-dimensional distance from the wall results in a predictable boundary layer profile for a wide range of flows.

  • For CFD, the most important are the viscous sublayer, immediately adjacent to the wall and log-layer, slightly further away from the wall.
  • Different turbulent models require different inputs depending on whether the simulation eneds to resolve teh viscous sublayer with the mesh.
  • Using wall functions to involve utilizing predictable dimensionless boundary layer profile shown on slides 9 & 10 to determine conditions at wall from conditions at the centroid of the wall adjacent mesh cell.
  • This means the cell should be located in the log-layer.
  • To locate the first cell in log-layer, it should typically have a y+ value such that \(30\leq y+ \leq 300\)
  • Generally speaking,

    • For very high Re, y+ can be higher if still in log layer (for instance a large ship \(Re~10^9\), values greater than 1000 are safe)
    • For very low, but still turbulent Re, the log layer may only extend to y+~ 300, in which case \(y+~30\) would be too coarse to allow a sufficient number of mesh cells across boundary layer.
    • To fully resolve boundary layer on important walls, try to have atleast 10 mesh cells across boundary layers.
  • Resolving viscous sublayer, first grid cell needs to be at \(y+~1\) and a prism layer mesh with growth rate no higher than ~ 1.2 should be used.

  • This causes the mesh count to increase significantly.
  • If the forces on heat trasnfer on wall are key to your simulation (aerodynamic drag, turbomachinery blade performacne, heat transfer) this is the approach you will take and the recommended turbulence model for most cases is SST \(k-\omega\).
  • Fewer nodes are needed normal to the wall when wall functions are used compared to resolving the viscous sub-layer with the mesh.

Red line indicates the first node wall distance reflected by y+ value.

Example \(y^+\) calculation

A sample \(y^+\) calculation is indicated for the following smooth plate flow as follows,

Flow over flat plate with air at 20m/s, at a given density and viscosity.

\[ Re = \frac{\rho V L}{\mu} = 1.4 \cdot 10^6 \\ \]

The target \(y^+\), after rearranging, is $$ y^+ = \frac{\rho U_{\tau} y } {\mu} $$ $$ y = \frac{y^+ \mu}{U_{\tau} \rho} $$

\(U_{\tau}\) is now requried which is obtained as, $$ U_{\tau} = \sqrt {\frac {\tau_{w}}{\rho}} $$

The wall shear stress or \(\tau_{w}\) can be found from the skin friction coefficient, \(C_f\) as, $$ \tau_w = \frac{1}{2} C_f \rho U_{\infty} ^2 $$

For a smooth plate as shown in the figure, skin friction is obtained as $$ C_f = 0.058 Re_{l} ^ {-0.2} $$

Re being known, will yield the \(C_f\) as follows, aiming for a \(y^+\) of 50, $$ C_f = 0.0034 $$ $$ \tau_w = \frac{1}{2} C_f \rho U_{\infty} ^2 = 0.83 (kg/ (ms^2)) $$ $$ U_{\tau} = \sqrt{\frac {\tau_{w}}{\rho}} = 0.82 m/s $$ $$ y = \frac{y^+ \mu}{U_{\tau} \rho} = 9 \cdot 10^{-4} m $$

Meaning, the very first cell next to the boundary should have the heigt of approximately 1mm. Aiming for a \(y^+\) of 1, 50 will be replaced with 1 in the above formula, giving $$ y=1.8 \cdot 10^{-5} $$

  • Wall functions however also have some limitations. In some situation, such as boudnary layer separation, the boundary layer profile is not logarathmic which means that wall functions, which are based on logarithmic velocity profile, do not correctly predict the boundary layer.

Lastly for for turbulent inlet conditions,

  • Normal turbulent intensities range from 1% to 5%.
  • Default turbulent intensity value 5% is sufficient for nominal turbulence through a circular inlet, and is good estimate in absense of experimental data.
  • For external flows, turbulent viscosity ratio of 1-10 is typically good.
  • For internal flows, turbulent viscosity ratio of 10-100 is typically good.
  • For fully developed pipe flow at Re=50000, the turbulent viscosity ratio is around 100.