Gas expansion and heat transfer