Simulation of a miscible carbon dioxide flood using a trapped oil function