Modeling Gas Production from Shales and Coal-Beds