Fill out the form to download

Required field
Required field
Not a valid email address
Required field

Documentation

How to Tell When and Where the Simulation Starts Diverging?

In this article, we will present a feature available in SimScale that shows when and where divergence occurs within a simulation.

Approach

Computational Fluid Dynamics (CFD) simulations are highly iterative processes. In successful runs, the results converge to a final, stable solution. However, for several reasons, the solution may also diverge. When this happens, parameters within the domain can reach unphysical levels.

To help users identify and troubleshoot divergence in their simulations, SimScale has a divergence monitor. The following parameters are tracked: velocity, pressure, density, and temperature. Whenever a parameter reaches unphysical levels in the domain, the simulation automatically stops with an error message:

divergence monitor in simscale
Figure 1: Error message reporting divergence in the simulation run.

The error message specifies which parameter diverged and also the exact location in the model. This information is valuable, and can be a starting point for the troubleshooting process.

Troubleshooting

To gain more insight into the causes of divergence, the following basic steps are useful:

  1. Create a ‘probe point‘ result control and input the coordinates displayed in the error message. In doing so, you will see exactly where the divergence occurred;
  2. If the point is close to one of the boundaries, double-check all boundary conditions, making sure they are correct;
  3. If the point is located inside the domain, inspect the mesh around the area. The ‘mesh quality‘ visualization feature is very useful in this step. Even just a few bad quality cells can create instabilities in the simulation, ultimately leading to divergence.

Divergence Example

To illustrate the procedure, let’s go through an example. This case is an external compressible flow simulation around a wing. The monitor reports a divergence for the pressure field at a specific point within the domain:

wing simulation divergence for pressure field
Figure 2: With these coordinates, one can create a point in the domain for more insight into the divergence error.

By creating a probe point and specifying the coordinates above, we can see that the divergence started on the tip of the wing:

wing simulation point where divergence starts
Figure 3: Using a probe point to pinpoint where the divergence starts.

Upon clicking on ‘mesh quality‘, the post-processing environment opens. A very useful filter to spot bad cells is isovolumes. By selecting a quality parameter and changing the minimum and maximum iso values, the bad cells are easily located:

isovolume filter to spot bad mesh cells
Figure 4: Using the isovolumes filter. Cells with the highest volume ratio are highlighted in the viewer.

The mesh contains cells with up to 158 volume ratio, which is too high (recommended value \( \ll \) 100). Furthermore, the location is the same as reported in the error message. In this case, the mesh requires improvement to run the simulation.

Note

If none of the above suggestions solved your problem, then please post the issue on our forum or contact us.

Last updated: October 24th, 2020

Contents
Data Privacy