Apologize I don't have anything handy at the moment. The test I did is at work .
The setup is quite simple though. I don't have any complicated graph Just few nodes because Pop Grains alone itself does the trick. I made a small geometry patch on the ground plane. Then used pointsFromVolume & Added another AttrWrangle node for randomizing pscale & mass.
f@pscale = chramp("pscale", rand(i@ptnum)) * 0.015;
f@mass = f@pscale / 0.55;
These points were fed to Pop Network as First Source Input. Now inside the Pop you put a Pop Grain Node. The settings for PopGrain to imitate Foam behaviour are :
Particle Separation : 0.05
Constraint Iterations : 60
Behaviour
Friction :
With Colliders : 0.2
With Particles : 0.1
Accurate Friction Checked
Static Threshold : 0.5
Scale Kinetic : 4.5
Internal Collision :
Weight : 1
Stiffness : 1
Enable Mass Shocking Scale = Local
Shock Scaling Power = 100 & Shock Axis : 0 1 0
Clumping :
Weight : 2
Stiffness : 0.5
Explicit Constraints :
Weight : 0
Stiffness : 100
Target Pins :
Weight : 1
Stiffness : 0.5
SOLVER SETTINGS :
Max Neighbors : 35
Neighbor Query Scale : 2.75
Max Accelaration : 5
Velcoity belnd : 5
Over Rlaxation : 2 & Open CL is checked ON
Just by these settings it should give you the foam behaviour & clumpiness. Add the ground as static collider.
I also Added a bit of Gravity : -9.80665 * 0.3 & Pop Wind :
// Pass Through
wind = wind;
airresist = smooth(0, 1, fit(v@P.y, .02, .22, 0, 1));
Amplitude : 0.25 , Swirl Size : 0.5 , Pulse Length : 20..
Just by these few nodes..you might get the foam behaviour. Reference :