Cavitation can occur at the inlet of hydraulic pumps or in hydraulic valves; this phenomenon should be always avoided because it can generate abnormal wear and noise in fluid power components. Numerical modeling of the cavitation is widely used in research, and it allows the regions where it occurs more to be predicted. For this reason, two different approaches to the study of gas and vapor cavitation were presented in this paper. In particular, a model was developed using the computational fluid dynamics (CFD) method with particular attention to the dynamic modeling of both gaseous and vapor cavitation. A further lumped parameter model was made, where the fluid density varies as the pressure decreases due to the release of air and the formation of vapor. Furthermore, the lumped parameter model highlights the need to also know the speed of sound in the vena contracta, since it is essential for the correct calculation of the mass flow during vaporization. A test bench for the study of cavitation with an orifice was set up; cavitation was induced by increasing the speed of the fluid on the restricted section thanks to a pump located downstream of the orifice. The experimental data were compared with those predicted by CFD and lumped parameter models.