Oil refining creates oily wastewater. Gas is added, forming bubbles that rise and collect oil droplets. The gas and oil rise to the surface, where the oil can be separated and recovered.