HySPH - Snap Foam Particles

In simulations without an ocean statistical spectrum applied this tool does not have to be used.

 

“Snap Foam Particles” is used to reposition the particles to make them sit on top of a → Hybrido mesh's ocean statistical spectrum waves. The tool requires an existing simulation of a secondary foam-type emitter ("Foam", "Splash & Foam", "Bubbles & Foam", "Waterline", "Wet & Foam"). Additionally, a Hybrido mesh must be present.




Here is how to use this tool:

  • Select one → Hybrido mesh node, and all the foam-type emitters you want to process.
  • Click on the icon in the “Hybrido” shelf.
  • The tool will create an appropriate number of emitter nodes with a “Snapped” suffix, e.g. “HY_Foam01_Snapped”.
  • You will recognize that the new emitters have different settings than their parent nodes, but as they are only used to collect the displaced particles, it does not make any difference.

The tool will process the particles and align them with the mesh's geometry – they are snapped to the mesh's surface. This process can be monitored in the → “Messages” window:

Executed "Snap Foam Particles Tool" for frame 32 in 0 hour(s), 0 minute(s) and 0.0640 second(s).

 

If you are not happy with the results, for example when you changed the ocean statistical spectrum, and want to repeat this process then the already existing “_Snapped” nodes will be reused, but their data will be overwritten. The original simulation files will be kept though.

Using "Snap Foam Particles" with RealFlow's Command Line Version

With a few preparations this tool can be used with the Command Line version and RealFlow Nodes. Create an empty text file and enter the following lines of Python code:

scene.load(path_to_project_file/project.flw)

scene.reset()

scene.command(457431864)

scene.save(path_to_project_file/project.flw)

 

Save the file and assign a name, e.g. foam_snapping.rfs. To use the script with the command line version, open a terminal application (Command Prompt, Terminal, Bash, etc.) and type in:

realflow -nogui -script path_to_scrip_file/foam_snapping.rfs

 

With a RealFlow Node it is very similar:

realflownode -script path_to_scrip_file/foam_snapping.rfs