Been getting stuck into learning Python coding for realflow and put together a simple script for foam. The script turns the water into foam based on velocity and then when it slows down or gets too old, the foam turns back into water. Still A LOT of work on the script and need way more particles but the challenge is really coming in how to shade and render the foam convincingly.
For this example i imported the foam particles as thinking particles in cinema 4d and added simple geometry to each one. Going to try one with a lot more particles and smaller geometry and a few other ways to render the foam convincingly.