To improve the simulation accuracy of hydrofoil unsteady cavitation, a user-defined density function is used to correct a variety of turbulence models and combined with a hydrofoil with an angle of attack of 8° for numerical simulation of unsteady cavitation. This study aims to find the optimal turbulence model and apply it to other hydrofoil types to verify its applicability. The results show that the corrected RNG k-ε turbulence model and SST k-ω turbulence model can better fit the experimental results in terms of cavitation morphology and cavitation shedding frequency. The frequency error of cavitation detachment for the corrected SST k-ω turbulence model is just 0.3% compared to the experimental results, and it shows an improvement of approximately 67% over the uncorrected SST k-ω turbulence model. The corrected SST k-ω turbulence model can more accurately capture the shedding cavitation due to the re-entrant jet, better capture the generation of the attached cavitation edge of the U-shape, the shedding of large-scale cavities, and the collapse of the shedding cavitation downstream. Furthermore, the optimal turbulence model has a good applicability in different dimensions and on different hydrofoil types.