# Different materials for each fluid inflow?

How to assign a different color / material to each inflow object in one simulation (bake)?

In the following example we tried to mix two inflows and experience the mixing between the two fluids. However, as bake starts there is only one domain object as fluid (object!) which does not respect color / material assigned to inflow objects!

Unfortunately, I don't know of any way to do this with the main fluid simulator, however it is possible with blender's SPH fluid simulator.

Note that there is currently no way to convert fluid particles into a mesh from blender. There are some python scripts that do this, but these are mostly pretty slow. There are also a few patches, but it seems development on these has been dropped for the most part.

Some advantages of the SPH fluid simulator:

• No domain bounds

• Supports inter-fluid interactions

• Supports force fields

To mix to different colored fluids:

1. Create two emitter planes (ShiftA> Mesh > Plane):

2. Add two separate particle systems to the planes in Properties > Particles:

3. Increase the Life time of the particles in Particles > Emission to be at least equal to the scene end frame:

4. Set the particle physics to Fluid in Particles > Physics:

5. Add an object to represent the fluid particles. It should be very low-poly, a 1 division icosphere works well (ShiftA> Mesh > Icosphere). Note that you will need one for each color:

6. Set the Shading to Smooth on the icospheres and move them to another layer (M)

7. Set the particle type to Object in Particles > Render and select an icosphere in Dupli Object:

8. In Particles > Physics > Fluid interaction press the + button to add an particle system interaction and select the other emitter plane as the particle system object:

9. With both planes setup this way, add another object (e.g. a floor plane) and make it a collision object in Properties > Physics:

10. Create separate materials for each of the icospheres.

11. Set the Size (in Particles > Physics) and Number (in Particles > Emission) for each particle system. Larger particles = lower resolution, smaller = higher resolution. Adjust these settings so as to make the particles appear as a fluid without making the simulation too heavy.

12. You may also want to set the cache step to 1 in Particles > Cache for each particle system to ensure accurate caching.

Result:

• We accepted this even though SPH simulation is not even close to the blender built-in fluid simulation result (our target). Regardless of the size of particles (even very small) it is too far from what we expected. We searched extensively and watched videos (youtube) but haven't found any promising solution considered this as a limit of technology or a work under progress. – Developer Dec 21 '13 at 3:48
• Ideally there would be a way to mesh the particles together into one solid mesh (you can kind of do this with meta balls, but it is very slow and still doesn't look the greatest). There are some patches and python addons to do this, but unfortunately it doesn't seem like this will be officially in blender for a while.. – gandalf3 Apr 11 '14 at 19:05
• The first link is 404 – MicroMachine Aug 31 '16 at 14:18
• Wiki link is a 404. – Scott Milner Jan 4 '18 at 19:24

Basically a scene similar to the one gandalf created.

But 4000 particles of size 0.1

set to Halo

and Fluid properties: Stiffness 0

Leave the impression that the fluids mix:

You can just use 2 complete fluid systems. You cannot bake with multiple domains, but you CAN play back more than one. Create the first sim and bake it to a directory. Now disable the Domain and create your second sim and bake to a new directory. Now enable the first domain and ensure it points to the correct bake directory. Both sims will play back and you can put whatever material you want on each. I have had as many as 5 sims running at once and each started at a different time. All in one scene.

• But AFAIK they can't mix, like the OP seems to want. – gandalf3 Oct 28 '14 at 6:01