Modelling of gas separation in thermally-rearranged polymeric membranes