The cavitating flow simulation is of practical importance for many engineering systems, such as pump, turbine, nozzle, injector, etc. In the present work, a solver for two-phase flows has been developed and applied to simulate the cavitating flows past hydrofoils. The governing equation is the two-phase Navier-Stokes equation, comprised of the continuity equation of liquid and vapor phase. The momentum and energy equation is in the mixture phase. The solver employs an implicit, dual time, preconditioned algorithm using finite difference scheme in curvilinear coordinates. An experimental data and other numerical data were compared with the present results to validate the present solver. It is concluded that the present numerical code has successfully accounted for two-phase Navier-Stokes model of cavitation flow.