Physical and numerical investigation of cavitating flows around a pitching hydrofoil