27 March 2011

Fluid Explosion Buoyancy

So explosions are fun. And it's something that everyone wants to start doing right when they start maya fluids. So let me share a tip that I've been using.

One of the most difficult things about fluids is getting them to move quickly. Explosions have a strong force and movement for about 1-3 frames and then act like a normal mass of heat and smoke. The problem with fluids is that if you apply say a strong radial field or volume axis field with turbulence and away from center force. The fluid destabilizes and the simulation breaks. Or it's nearly impossible to slow the fluids back down to normal speeds. The former being the bigger issue. Granted, I'm also using maya 2009 and don't benefit from the improvements for 2011, like gradient force, auto resize, general stability improvements.

So here's some of my tricks: I tend to not use fields with fluids. The use of a field usually produces unnatural movement. And as you know a strong force will break the fluid entirely. I find much of the first 3-5 frames are working on shaping the explosion. That could mean placing a cluster of fluid emitters to create interesting shapes. Keying the scale of the fluid emitters. Start small, then in one frame go really big then cut it back down to size over the next couple frames. Use emission turbulence.

So that will get you the basic shape of the fluid but the more important part is timing. There are two things I use to accomplish that. The 1st is fluid simulation scale. I usually write and expression but you can also keyframe it. I usually smoothstep  the fluid sim scale from a high value (like 5 or 6) to a lower value (like 2 or 1.5) during the 1st 5-6 frames. This causes the blast to react very fast and then slow out rather naturally. It's like using damp but better. The next big trick is buoyancy. I usually control how my explosions rise with heat. So my density values are used to determine how long my smoke will last and my heat values determine how long my blast will last and how far and quickly the smoke plume will rise. You can set your density buoyancy to something rather small. Like 0.1 or even -0.1. Then set your heat buoyancy to something high, like 10 or 20, with a dissipation to match, like 3-5. You heat buoyancy controls hot fast the explosion will rise, and the dissipation will control how far the explosion will rise.

So go ahead and try it out. I hope these tips can help you get a handle on how to control your fluids.