Creating particles inside the PhoenixFD liquid

I need sometimes to place a particle system inside the PhoenixFD liquid simulation. The PFlow operator creates the particles outside the surface (or onto surface). Particles are then penetrating through the liquid container walls. I also tried the TyFlow Birth Voxels and Birth flow, but could not set an operator for moving the particles with the liquid as desired. Has anyone succeeded?

The goal is to feed liquid with particles into container, where the particles are kept inside the liquid (some of them can be floating). They should also be following the liquid. So far I got best results by using the Multiscatter. However instead of moving, the particles are born frame by frame, which gives nice still renderings but those are flickering in animations.

Hey,

Here is a sample scene how you can create tyFlow particles and make them move with the Phoenix liquid particles. It is saved for Max 2019, let me know if you need it downsaved for an older version.
The particles are created via the Birth Fluid operator and then using the Fluid force operator you can make them move with the liquid.

Cheers!
tyFlow_flowing_with_liquid_3dsMax_2019.zip (71 KB)

Thanks Georgi,

My first tests with the actual PhoenixFD simulation looks promising. What I didn’t have in my earlier tests, is the Delete event. I wonder what is the purpose for that.

The Delete operator in this case will delete the tyflow particles that go outside of the grid.

Without the scene or a video it is difficult to say what is going on. Can you share the scene so that we can check it out?

I’m afraid I don’t have an idea what is causing this. Since this is tyFlow territory may be the guys over at the tyFlow facebook group or the tyFlow forums may help.

You can use the thresholds in the Birth fluid operator to spawn particles only at certain points. You can find more about them here - https://docs.tyflow.com/tyflow\_particles/operators/birth\_fluid/
Another option would be to use the Surface test and split the particles based on a certain property and delete some of them. You can find more about the Surface test here - https://docs.tyflow.com/tyflow\_particles/operators/surface\_test/

Dealing with solid and transparent liquids is quite tricky and won’t work well when using only the Grid Texture. Mapping the fog color for the refraction works only on the surface of the material and this won’t look great. What you can do instead is to separate the different liquids by the color of the particles and then create two separate meshes. Here is a video of how this works - https://www.youtube.com/watch?v=jfE66K-vqYE

Thanks again,

I have not yet have the possibility to test your interesting solution with my animation. It’s an answer for rendering issue and will be investigated later.

However I have a new issue. I also need to have a particle mattress in the surface of the simulated liquid. Once I got decent liquid simulation results I tried resimulation to create some foam to be used as an additional particle source. However resimulation crashes Max at the very first frame. I have searched for information on how to use resimulation to generate foam to an existing simulation. I think I got it right, Anyway, is there available any material or tutorials on how to do this correctly?

Hmm,

Can you try if the resimulation crashes with the latest Phoenix nightly build? If it still does, please send over the file and we will take a look. It shouldn’t crash Max not matter what.

As for the workflow - check this out - Phoenix for 3ds Max

Thanks,

I updated Phoenix to the latest nightly build, but it didn’t change. Max had crashed when I came back to see what’s going on. I don’t know - should I disable resimulation and run whole simulation again with foam enabled? It will take something between week or two, which I might not have. I don’t have permission to send any geometry.

Or should I change foam parameters in a way, it will generate foam next to nothing and then gradually increase the amount to see if it’s there.

Oh, okay. Yes, using a small amount foam will be a good test to check if the foam amount makes it crash.

Generally using the resimulation will be faster if the liquid calculation is taking a big portion of the simulation time. If it is not, using the regular sim shouldn’t be a lot slower compared to the resim.

Thanks,

It seems, reducing particles are helping. It seems to be really slow - like it’s creating whole simulation again. I thought it would be faster just to add foam particles into an existing simulation.

Yes, for some scenes where the liquid is simulation is not that slow, the resim won’t make much difference in the simulation time.

Uuuhhhhmmm, 21 days and 6 hours? The grid looks super low resolution and the particles are very few as well, so this sim should be almost realtime. How many frames will you simulate? Also, are you sure you can’t exclude some scene nodes from the interaction list? Could it be that tyFlow is slowing it down so much?

Actually, to keep things simple, I have created several scenes for this animation. I have the render scene, where’s the renderable CAD-model, Presimulated PhoenixFD grid anf tyflow cache object. Then I have PhoenixFD scene, where is my simulation dummy geometry, that I have modeler mostly from scratch for simulation only. Then I have tyFlow scene, where is the same Presimulated grid and some dummy collision geometry, I have created. So the PhoenixFD simulation scene don’t have any tyFlow things at all. Once I have decent PhoenixFD simulation, I create tyFlow particle cache in separate scene and then copy both (tyFlow and PhoenixFD) caches to file server where all of my bacburner rendering servers will find those during render time. To keep things simple, I have created several separate PhoenixFD scenes for each individual phenomena I want to show in my animation.

This way the liquid and and particles are always in sync. Then I have one dedicated workstation as a framestore and Premiere video editing so I can at any time render the animation to my video streaming account with the latest changes in animation, graphic elements and sound.

Edit: The simulation has total of 2000 frames.

Something is not right here. Even with relatively low foam particle amount, I get over 2 GB Aur files per frame instead of 30 MB (without particles). This might explain why it’s so slow.

Hmm, can you paste us the Cache File content info from your simulation rollout for one of the large frames?

I don’t have those frames anymore. I reduced the foam amount to 0,1 and increased the Birth Threshold to 100. Now it’s estimating the simulation time to be something like three days. The Aur file size seems to be now only 50 MB bigger/frame than earlier.

The resimulation process had crashed last night during Frame 615 of 2 000. On the evening I saw there was about 7 days left - even when relatively low foam amount is used.