Method and appliance for purifying a flow rich in carbon dioxide