A probabilistic model for the permeation of gases through microporous membranes