Contact problem for wavy surfaces in the presence of an incompressible liquid and a gas in interface gaps