websights

Fill out the form to download

Required field
Required field
Not a valid email address
Required field
Required field
  • Set up your own cloud-native simulation in minutes.

  • 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:

    Figure 1: An example error message reporting divergence in the simulation run

    The error message above specifies which parameter diverged – the location within the CAD model where it happened may or may not be displayed. Depending on whether the location is displayed, there are two workflows possible to spot the problematic portions of the domain, and this is what we’re going to turn to next.

    Troubleshooting

    1. When Coordinates are Specified

    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.
    4. If you do have bad cells, make sure to inspect the CAD model around the problematic region. Look for minute faces, very detailed topology, and small gaps. These can sometimes cause poor mesh quality.

    Troubleshooting Example 1

    To illustrate the procedure, let’s go through an example. This case is an internal Convective Heat Flux analysis of an Office Room. The monitor reports a divergence for the velocity field at a specific point within the domain:

    Figure 2: With these coordinates, one can create a probe 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 near the window:

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

    2. When Coordinates are not Specified

    If no point coordinates are available, you should follow these steps for the troubleshooting:

    1. Go to the Solution Fields for the failed run.
    2. In the post-processor, create an Iso Volume filter for the variable of interest.
    3. The upper limit can correspond to the highest value in the legend, while the lower limit can be adjusted downward from a high value until cell concentrations become visible.
    4. Inspect the mesh quality as explained in the previous example.

    Troubleshooting Example 2

    Using the same example as before, we can follow the outlined steps to identify the source of the divergence. The Iso Volume filter reveals that the velocity field diverges precisely at the previously inspected location:

    Figure 4: Using the Iso Volumes filter to pinpoint where the divergence starts.

    Mesh Quality Inspection

    Upon clicking on ‘Mesh quality’, the post-processing environment opens. A very useful filter to spot bad cells is Iso Volume, the same one used for spotting the divergence when no point coordinates are displayed in the error message. By selecting a quality parameter and changing the minimum and maximum iso values, the bad cells are easily located:

    Using the iso volumes filter to spot the divergence location
    Figure 5: Using the Iso Volume filter. Cells with the highest non-orthogonality are highlighted in the viewer.

    The mesh contains cells with up to 85.65 Non-orthogonality, which is too high (the recommended value is \( \ll \) 88). Furthermore, the location is the same as reported in the error message. In this case, two main workflows are possible:

    In this case, zooming into the problematic region, we can spot a small face that seems to be causing the issue:

    High non-orthogonality meeting room example mesh quality viewer
    Figure 6: Cells with high non-orthogonality located near a small face within the domain

    We could, for instance, remove it using a Delete face Heal operation in CAD Edit on the original part (before generating the flow region).

    Note

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

    Last updated: December 4th, 2024

    Contents