Wetting phenomena and foam drainage on complex substrates