Multi-layer-fluid simulation [animation + tutorial]

Hello

I have created a short video of three fluids that seem to interact with each other. In fact it is a fake. Actually the Blender Elbeem fluid simulator is not able to simulate fluids with different densities. But it can be faked to a certain degree, so it will look like it would :wink:

The basic workflow is pretty straightforward:

  • Plan a fluid simulation, where fluids of different densities are involved.
  • Check the timing of the fluids.
  • Set up each fluid simulation individually in Blender and bake it.
  • Open a new file in blender and make a mesh object a Fluid domain.
  • Point its cache to the directories of the baked fluids.
  • Duplicate the fluid domain object and again adjust the cache directory
  • Adjust the timing with the Offset slider

Unfortunately this technique is limited to slow moving fluids that do not mix with each other.

I used this workflow also on this short video:

If you want to know how this can be done in detail, here is the tutorial for it. I will guide you through the workflow on setting up three high viscosity fluid simulations and put them together in a single scene in Blender.

Here you can get the source file.

Enjoy!

Very cool. I have always wanted to test this.
There is the problem that the second sim will only see one frame of the previous sim. But I believe this could be solved using shrink wrap and exporting its animation to use as a colider.
Of course, this would make everything much more complex. But considering how abandoned the fluid simulator is, you have to be familiar with complexity to do most things on it.

Amazing! Thanks you for sharing this for free. Folks on other 3D apps would have ask for hundreds of dollars for this.

@guismo
Thank you. Hopefully the surface generation for the SPH will be implemented in the near future. This would make things a lot easier and boost Blenders functionality . Then such simulations would be a breeze.

@georg
Thank you. You are welcome. :wink:

SPH is not a solution to everything. Some things are better with particles and other with grid based simulator.
Blender is lacking a lot in both. Of course it is great to have the little we do, but the SPH simulator, even with a mesher, can’t compare to realflow speed.

I can’t really imagine we will be able to do fluids with very high viscosity with the SPH simulator. High viscosity requires a huge number of iterations. And the current solver is already very slow with normal viscosity.

But it’s not like there is a solution for that. Fluid solvers requires a lot of time of very high specific talents. Even if we croudsource for that, would require a lot of constant money.

It’s really up to us to create workarounds and cheats. Or to pay thousands of dollars for tools.

So, congratulations on your solution. It is the kind of thing we need.

To be honest, I have not done much with the SPH yet, because of the missing mesh generation. The possibilities here are pretty limited for now. But I am confident, that all that stuff can be coded into Blender. There are a lot of highly talented coders out there, who are capable of coding ‘mesh and speed’. As far as I know there is already some code on the mesh generation for the SPH, but it seems to be on hold for some reason.
Since there are a lot of new things being implemented, it is question of priority I think.

Until then we have to make it a bit ‘realflowstyle’ :wink: