The invention provides an OpenFOAM
simulation method based on GPU acceleration,
electronic equipment and a readable medium, and relates to the technical field of computational fluid dynamics. The OpenFOAM
simulation method comprises the steps that OpenFOAM grid information is read, an LDU matrix is generated, and a special function is written to convert the LDU matrix into an ELLPACK-R format; performing dynamic grid division on the initial grid according to the calculation load of each GPU, performing compression
processing on the matrix and vector data in the ELLPACK-R format, and transmitting the compressed data from the CPU memory to the corresponding GPU memory; writing an optimized
CUDA kernel function, and executing matrix vector multiplication in an ELLPACK-R format on a GPU (
Graphics Processing Unit); a PCG
solver is initialized on the GPU, the matrix in the ELLPACK-R format is preprocessed through an AMG-ILU self-adaptive
preprocessor, and then iterative calculation of the PCG
solver is executed; decompressing an iterative calculation result, transmitting the decompressed iterative calculation result back to a CPU memory, and converting a decompressed solution vector into an LDU matrix format which can be identified by OpenFOAM; and operating OpenFOAM
simulation, and dynamically adjusting a dynamic grid division strategy and parameters of a PCG
solver according to a simulation result.