Use a de-foamer to dissipate the foam. You will get the pool clean in an hour. Keep in mind that this chemical will treat only the foam, not the cause, so use it only in urgent situations. If the foam returns after using the de-foamer, spend your time finding the reason.