Top 5 Do's and Don’ts for CFD
1. Do use inflation layers
The velocity and often temperature gradients normal to a wall is typically much larger than the gradients parallel to the wall. The inflation layer control is designed to create thin elements that can capture the normal gradient with minimal elements; use inflation layers to correctly capture the velocity and temperature gradients near no-slip walls.
Figure 1 shows the difference in predicted for flow across a flat plate with and without the inflation layers.
2. Do not forget about the reference pressure
Don’t forget about the reference pressure (or the operating pressure in Fluent.) The pressure used by the solver is not the absolute pressure:
For example, consider a model when one of the boundary conditions has an absolute pressure value 1 atmosphere; the value used at the boundary condition (P_bc) will vary depending on the reference pressure in the model:
If the reference pressure is set to 1 atmosphere, the pressure used by the solver at the boundary is 0 atmospheres. In this case the pressure used at the boundary is the same as the gauge pressure:
If the reference pressure is set to 0 atmospheres, the pressure used by the solver at the boundary is 1 atmosphere. In this case the pressure used at the boundary is the absolute pressure:
The reference pressure can be any value, for example for a ½ atmosphere reference pressure, the boundary pressure would be a ½ atmosphere:
Pbc=1/2 [atm]+1/2 [atm]
A good rule is to check the absolute pressure in the solution to make sure you that have set the pressure correctly.
3. Do check your global imbalances
Residuals are not a direct measure of solution accuracy; they are a measure of the numerical imbalance of the partial differential equations (PDEs). Remember to check the global imbalances of the PDEs as another measure of convergence, particularly for thermal models. In CFX the imbalances are found near the bottom of the out file.
Tip: In CFX you can require the equations to balance as part of the convergence test using the conservation target option under the Solver Control. You can also plot the imbalances by creating a new monitor plot in the solver manager and then select the imbalances to monitor.
4. Do use monitor points
Monitor points that capture the key metrics of the model are the best measure of convergence. For example if you have created a model to predict the drag force around a body, you should create a monitor plot of the drag force and watch how it converges.
5. Do watch how the steady state model solves
Watching how the steady state model develops is a good way to understand how the solver is converging and can give good insight about convergence difficulties.
Tip: Backups can be used for this purpose in CFX and Fluent. In CFX make sure you to turn off the “delete backup files” under the I/O Controls in the Expert Parameters if you want to keep all the backup files created during a run. In Fluent, you can create backups by selecting the Auto Save option from the File menu. You can also directly plot the results during a solve.