| In recent years,how to use the powerful parallel computing power of high performance heterogeneous architecture to accelerate open source CFD software including Open FOAM has become a hot topic of concern for many researchers.Currently,there are still some challenges for a parallel solution of a complete solver in Open FOAM on a CPU+GPU multi-heterogeneous platforms.On the one hand,with the development of high performance computing,the heterogeneous hardware and software ecology of CPU+GPU presents various development trends,which brings additional costs to the porting and adaptation of the same solver or algorithm on different heterogeneous platforms.On the other hand,the high-level,deep encapsulation of Open FOAM software limits its portability on heterogeneous platforms.Based on the above problems,focuses on the parallel algorithm and data access optimization method of ico Foam,a typical Open FOAM incompressible solver,for CPU+GPU heterogeneous computing platform.Through the expandability test of the Lid-driven Cavity Flow case,the acceleration effect of ico Foam solver on the main heterogeneous computing platform with different case sizes was explored.The main work is as follows:Firstly,in order to make the data structure more adaptable to the characteristics of heterogeneous architecture,proposed a data structure conversion method for the underlying core data of Open FOAM.At the same time,a conversion interface was designed to realize the conversion of underlying data,which improved the memory access performance and parallelism of unstructured grid data.Secondly,a parallel algorithm and data access optimization method for two main heterogeneous platforms(AMD and NVIDIA)were designed by combining Heterogeneous-compute Interface for Portability(HIP)for the calculation of velocity flux and assembly of linear equations in the solver;At the same time,aiming at the large scale sparse linear equations in the solver,an efficient LDU to CSR matrix format conversion algorithm is designed,and two linear solvers based on krylov subspace method are implemented in combination with advantage of HIP to fit multiple heterogeneous backends,on this basis,efficient parallel solutions of pressure and velocity equations are realized.In terms of GPU implementation,the storage property of data in Open FOAM unstructured mesh is fully considered,and a strategy of thread task allocation based on mesh cells and mesh surfaces is proposed.Finally,the CFD classic Lid-driven Cavity Flow(cavity)is taken,and the detailed numerical simulation experiments are carried out on two heterogeneous computing platforms of AMD gfx906 GPU and NVIDIA Tesla V100 GPU.On the one hand,by comparing the experimental results of the CPU and the GPU,the correctness and rationality of the proposed parallel algorithm based on the multi-heterogeneous computing platforms were verified;On the other hand,through the performance test,it is shown that a complete incompressible solver with different cells sizes can achieve significant parallel acceleration effect on two main heterogeneous platforms.The unified porting scheme proposed can greatly improve the computing efficiency of ico Foam solver on the heterogeneous computing platforms of AMD and NVIDIA,and the acceleration effect of ico Foam solver is about 20.5 and 38.4 times as fast as that of CPU on the million-level cells scale. |