Two Different Emiters In One Container?

I'm fairly new to fluids, but i know the buttons (so to speak...). I need to get two fluids with different attributes (buoyancy, diffusion, color)To interact with each other. Now there seams to be no way to get two different emitters in one container, so how do i do it? Is there any way to make fluids from separate containers interact?

Thank you.

Inside an expression you can access the velocity vectors from a fluid using get/setFluidAttr calls. It is relatively simple if the two fluids are the same resolution to transfer velocity from one fluid to the other.(if not you may need to use fluidVoxelInfo to get voxel coordinate locations). The simplest is to do getFluidAttr on the velocity and the set the velocity on the second fluid using setFluidAttr with the -add flag. If you did this both ways it would likely blow up over time, although you could scale down the velocity added each step instead of adding the full velocity. Perhaps better might be to blend a bit of velocity from one fluid into the other, for example:

vector $newVelocity = $myVelocity * .9 + $otherVelocity *.1; // (all vector types)

The numbers above would need to sum to 1, in this simple blending calculation.

Alternately you can try to have multiple fluids in a single container by emitting different color, density, temperature from different emitters.( with dynamic color and temperature grids) If you use temperature instead of density buoyancy then the hotter parts will be more buoyant. The fuel emission and grid can also be used to control shading. Temperature tubulence will also tend to make the hotter parts diffuse more as well, although in a more turbulent fashion than diffusion.

Duncan

Just a couple of additional points. In general it is best to try to handle it all in one fluid( if you want interaction ) by using grids such as temperature, color or fuel as ways of pushing dynamic and shading properties through the volume. Another technique is to use one fluid as a field (or force) on the other. (Just toggle a fluid on the field list of the other in the dynamic relationship editor) However one can't apply each as a force on the other or it will blow up.

Duncan

THX ALOT!

I started playing with fuel and temperature and found a solution to other problem i was having, while i fixed this one by using lots of turbulence in two different containers. That creates th illusion of mixing.

Now yet another question: is there any way to key Use Emission?
Or if not, how to achieve this result: emitter emits particles until it reaches a certain frame and then stops emitting but already emitted fluids don't disappear.

As mentioned on the other post.. keyframe the density emission on the fluid emitter node. If you are using temperature you can also keyframe the heat emission. Note that it is not emitting particles, but emitting density into the fluid volume. Density in the fluid is maintained on a grid... there are no particles( the dots in wireframe draw mode are simply a technique to display density ).

Dundcan