A numerical study of steady and unsteady cavitation on a 2D hydrofoil