A numerical method for dense gas flows