Diverged simulation? How to find high residual cells! Together with a best practice check list!
All CFD engineers will unfortunately experience diverged simulations, so what to do to correct the simulation and obtain the desired results? With Simcenter STAR-CCM+ there are several checks you can do to find the issue with your simulation, where in this blog post I will show you one of them more thoroughly.
Below follows a check list with nine useful steps when trying to correct the issue with the diverged simulation.
|Check list item||Tips of what to check|
|1. Check Geometry||Dimensions (m or mm?), look for small gaps, run Surface diagnostics in Surface repair|
|2. Mesh||Face validity > 0.9, Volume change > 1e-3, remove invalid cells|
|3. Initial conditions||Double check initial conditions|
|4. Boundary conditions||Are you using the correct BC? Are all BC correct?|
|5. Wall Y+||Low Re -> y+ ~ 1, wall-functions -> y+ ~ 30|
|6. Physics||Does the simulation models describe the physics in a correct way?|
|7. Solvers||Check Under relaxation factors (URF) and Courant number (CFL)|
|8. Extra Post-processing||Look for high gradients, where are the high residual cells located?|
|9. Ask for help||An extra pair of eyes are always useful, do not hesitate to contact us at Volupe!|
Often the geometry is provided to the CFD engineer, and therefore the first thing to do after extracting the fluid domain is to discretize the domain, by creating a mesh. Both the quality and level of resolution of the mesh are crucial to capture the physics in the simulation. If one of them is not done correctly, there is a possibility of divergence. It can therefore be very useful to look at the cells where the residuals are high, to find problematic areas, so these cells can be remeshed with higher quality or finer resolution. But, how to we find the cells with high residuals?
To be able to visualize the cells with high residuals you must enable the option Temporary storage retained for the solver. After the setting is in use, you must run at least one iteration to store the values. This is because by default, this information is not stored. If your simulation has already diverged, restart the simulation with Temporary storage retained enabled, and stop the simulation when the simulation is close to divergence.
As an example, I have created a simulation of flow through a ring (from left to right), see below. The mesh is very coarse in the wake region, which will make the simulation unstable.
Visualization using a scalar scene will provide an indication of the range of values there is for the Turbulent kinetic energy residual in the domain. Other residuals which can be of interest to look at are Specific and Turbulent dissipation rate residuals, depending on your selection of turbulence model.
By creating a threshold with the settings in the picture below, you can highlight the cells with high residuals in the scalar scene by simply clicking on the threshold.
Thank you for reading this blog post, hopefully this information will be useful for you and that you will have less problems with diverged simulations from now on. Feel free to contact us at firstname.lastname@example.org if you have any questions or if you still have diverged simulations and would like an extra pair of eyes.
NOTE: The intension of the blog post is to provide tips regarding solving issue with diverging simulation (the simulation in the example did not have any divergence problem though) and how to find cells with high residuals, not showing the best mesh to simulate the physical behaviour.