Modeling the Displacement of Gases in Coal Beds