Thermodynamic description of the process of gas liberation from a coal bed