### 6.3.6. CFD Simulation

This section provides recommendations concerning the optimal application of a CFD method, once the grids are available and the basic physical models have been defined.

#### 6.3.6.1. Target Variables

In order to monitor numerical errors, it is recommended that you define target variables. The convergence of the numerical scheme can then be checked more easily and without interpolation between different grids. You should select target variables that:

1. Are representative of the goals of the simulation.

2. Are sensitive to numerical treatment and resolution.

   This criteria should help to avoid the use of measures that are insensitive to the resolution, such as pressure-based variables in boundary layer simulations.

3. Can be computed with existing postprocessing tools.

4. Can be computed inside the solver and displayed during run time (optimal).

It is optimal if the variable can be computed during run time and displayed as part of the convergence history. This enables you to follow the development of the target variable during the iterative process.

#### 6.3.6.2. Minimizing Iteration Errors

A first indication of the convergence of the solution to steady-state is the reduction in the residuals. Experience shows, however, that different types of flows require different levels of residual reduction. For example, it is found regularly that swirling flows can exhibit significant changes even if the residuals are reduced by more than 5 - 6 orders of magnitude. Other flows are well converged with a reduction of only 3 - 4 orders.

In addition to the residual reduction, it is therefore required to monitor the solution during convergence and to plot the pre-defined target quantities of the simulation as a function of the residual (or the iteration number). A visual observation of the solution at different levels of convergence is recommended.

It is also recommended that you monitor the global balances of conserved variables, such as mass, momentum and energy, vs. the iteration number.

Convergence is therefore monitored and ensured by the following steps:

- Reduce residuals by a pre-specified level and provide residual plots.

- Plot evolution of r.m.s. and maximum residual with iteration number.

- Report global mass balance with iteration number.

- Plot target variables as a function of iteration number or residual level.

- Report target variables as a function of r.m.s. residual (table).

It is desirable to have the target variable written out at every timestep in order to display it during the simulation run.

Depending on the numerical scheme, the recommendations may also be relevant to the iterative convergence within the timestep loop for transient simulations.

#### 6.3.6.3. Minimizing Spatial Discretization Errors

Spatial discretization errors result from the numerical order of accuracy of the discretization scheme and from the grid spacing. It is well known that only second- and higher-order space discretization methods are able to produce high quality solutions on realistic grids. First-order methods should therefore be avoided for high quality CFD simulations.

As the order of the scheme is usually given (mostly second-order), spatial discretization errors can be influenced only by the provision of an optimal grid. It is important for the quality of the solution and the applicability of the error estimation procedures defined in Solution Error Estimation, that the coarse grid already resolves the main features of the flow. This requires that the grid points are concentrated in areas of large solution variation. For the reduction of spatial discretization errors, it is also important to provide a high-quality numerical grid.

For grid convergence tests, the simulations are carried out for a minimum of three grids. The target quantities will be given as a function of the grid density. In addition, an error estimate based on the definition given in Solution Error Estimation (Equation 6–25) will be carried out. It is also recommended that you compute the quantity given by Equation 6–27 to test the assumption of asymptotic convergence.

It is further recommended that the graphical comparison between the experiments and the simulations show the grid influence for some selected examples. The following information should be provided:

- Define target variable as given in Target Variables.

- Provide three (or more) grids using the same topology (or for unstructured meshes, a uniform refinement over all cells).

- Compute solution on these grids:

  - Ensure convergence of the target variable in the time- or iteration domain. See Iteration Errors and Minimizing Iteration Errors.

  - Compute target variables for these solutions.

- Compute and report error measure for target variable(s) based on Equation 6–25.

- Plot selected variables for the different grids in one picture.

- Check if the solution is in the asymptotic range using Equation 6–27.

#### 6.3.6.4. Minimizing Time Discretization Errors

In order to reduce time integration errors for unsteady-state simulations, it is recommended that you use at least a second-order-accurate time-discretization scheme. Usually, the relevant frequencies can be estimated beforehand and the timestep can be adjusted to provide at least 10 - 20 steps for each period of the highest relevant frequency. In case of unsteadiness due to a moving front, the timestep should be chosen as a fraction of:

| (6–28)

with the grid spacing and the front speed .

It should be noted that under strong grid and timestep refinement, sometimes flow features are resolved that are not relevant for the simulation. An example is the (undesirable) resolution of the vortex shedding at the trailing edge of an airfoil or a turbine blade in a RANS simulation for very fine grids and timesteps. Another example is the gradual switch to a DNS for the simulation of free surface flows with a Volume of Fluid (VOF) method (for example, drop formation, wave excitation for free surfaces, and so on). This is a difficult situation, as it usually means that no grid/timestep converged solution exists below the DNS range, which can usually not be achieved.

In principle, the time dependency of the solution can be treated as another dimension of the problem with the definitions in Solution Error Estimation. However, a four-dimensional grid study would be very demanding. It is therefore more practical to carry out the error estimation in the time domain separately from the space discretization. Under the assumption that a sufficiently fine space discretization is available, the error estimation in the time domain can be performed as a one-dimensional study.

Studies should be carried out with at least two and if possible three different timesteps for one given spatial resolution. Again, the error estimators given in Solution Error Estimation (Equation 6–25) can be used, if is replaced by the timestep. The following information should be provided:

- Unsteady target variables as a function of timestep (graphical representation)

- Error estimate based on Equation 6–25 for (time averaged) target variables

- Comparison with experimental data for different timesteps.

#### 6.3.6.5. Avoiding Round-Off Errors

Round-off errors are usually not a significant problem. They can occur for high-Reynolds number flows where the boundary layer resolution can lead to very small cells near the wall. The number of digits of a single precision simulation can be insufficient for such cases. The only way to avoid round-off errors with a given CFD code is the use of a double precision version. In case of an erratic behavior of the CFD method, the use of a double precision version is recommended.

Release 18.2 - © ANSYS, Inc. All rights reserved.