Numerical simulation and optimization of CO2 enhanced gas recovery in homogeneous and vertical heterogeneous reservoir models