Foam formation

Foam formation

I observed this foam formation at the bypass chamber from the inlet of our sewage treatment plant. What causes this type of foam formation and is it problematic?