Similar Items: On a Numerical Method for Solving the Problem of Water Displacement by Gas