An Efficient Numerical Method for Simulating Multiphase Flows with a General Equation of State