The reason linear quats foam is they are cationic surfactants. This is a class of synthetic detergents. Nature of the beast. Best advice is to not use them. They also can cause eye stinging. If you must use an algaecide use polyquat.