Nucleation and flashing in nozzles—1. A distributed nucleation model