Optimising foam control formulations can be difficult. Harsh conditions such as high temperatures and pressure, high salinity, changing pH, hard water and entrained oil can jeopardise foam stability in drilling, completion, stimulation and production operations.