A cavitation model for computations of unsteady cavitating flows