Full Program »
Implementation of A Structured Gradient Reconstruction Method for Unstructured Meshes in OpenFOAM
This study presents a new gradient reconstruction method (the Structured Gradient method) for cell-centered unstructured meshes in OpenFOAM. Among the widely used gradient reconstruction methods, the stencil for gradient calculation usually contains the neighboring cells sharing faces or points, and the number of cells in stencil may vary cell-by-cell. Different from these methods, the Structured Gradient method selects stencil based on the characteristics of flowfields besides the geometry connections. Moreover, in the Structured Gradient method, the number of cells in stencil for each cell is a constant, making the computational workload to be balanced among cells. As for load balancing in parallel computing, the mesh partitioning algorithms or tools can only ensure an even distribution of cells among processors. In this way, the Structured Gradient method is also helpful to obtain a further load balancing of computational workload among processors. The Structured Gradient method imitates a structured-grid approach by reconstructing local directions for each cell. Particularly, local directions are calculated successively from boundary cells to internal ones based on the advancing-front way. In this way, the wall normal direction is able to be recognized. Considering that the gradients change dramatically along the wall norm directions, the Structured Gradient method selects stencil along them for gradient reconstructions of the cells near the wall boundary. A survey of gradient reconstruction approaches is conducted in OpenFOAM by adopting a 2D inviscid channel flow test case with 0.3 inflow Mach number and zero angle of attack. Five quadrilateral grids (from 512 to 131,072 cells) and five triangular ones (from 758 to 126,384 cells) with consecutive refinement are utilized for the comparisons of the convergence order of accuracy. The global L2 norms, as well as the wall L2 norms, of entropy errors are shown in Figure 1 and Figure 2 respectively. The Least Squares method (LSQR) does not converge in the medium and the very fine triangle grids due to its relatively poor stability. The Curvilinear gradient method (curvilinear) can converge in all of the grids but is able to obtain only 1st order of accuracy. As shown in the figure, the Structured gradient method (struLSQR) is able to achieve a comparable effect in accuracy and error magnitudes to that of the extended Least Squares method (exLSQR). In conclusion, the Structured Gradient method is able to obtain a 2nd order of accuracy and has an advantage in load balancing, and in parallel computing further.