in science what is the similarities between sand and foam?