A coupled flow-transport-deformation model is developed to simulate underground coal gasification (UCG) though which coal is converted to useful gases in-situ without the need for mining. During UCG the carbon in a coal seam is burnt while high heat energy is released. As a result of burning, new cavities are created in the coal seam. These cavities will modify the permeability field dramatically. The modified permeability field will in turn affect the gasification. It is apparent that UCG is a coupled phenomenon involving hydrological, chemical, thermal and mechanical processes. In this study, UCG is simulated as a selective mining method through introducing a cavity evolution equation. The equation defines the selectivity as a function of porosity, and can be understood as the influence of the residual carbon on the gasification rate. When the porosity is equal to the original value (the initiation of gasifying), the gasification rate reaches its maximum; when the porosity is equal to the final value (the completion of gasifying), the gasification rate is reduced to zero. The introduction of this equation into classical flow and transport equations constrains the whole gasification process from initiation to completion. Numerical results of a typical five-spot gasification layout have confirmed the validity of this approach.