Estimation of critical gas saturation during pressure depletion in virgin and waterflooded reservoirs