Two- and three-dimensional simulation of a rising bubble and falling droplet using level set method