Particle bubbles in fluid simulation

A thread about mpan3’s great rain simulation started a talk about making bubbles.

Making a single huge bubble turned out to be pretty easy.

Making lots o’ bubbles isn’t so easy. The idea I had (I’m sure someone else has thought of it, too) is simple, but depends on how high you can set the resolution of the fluid sim.

You need:

  • fluid sim domain
  • mesh inside domain set as fluid
  • sphere bubble parented to…
  • empty sitting in fluid set to emit particles (I set mine at 100) and with dupliverts on
  • empty and sphere set to fluid obstacle
  • bake the fluid sim for as many frames as you want with the resolution set as high as possible
  • after baking, move bubble and empty to another layer
  • assign material to baked fluid
  • render fluid animation with ‘bubble holes’

Below is the test .blend I setup (there’s also a “tank” on layer 11). I can’t set the resolution to higher than 200 and that doesn’t seem high enough to register the bubbles. At 200 it took my machine 20 minutes to bake the first 6 frames <sigh> I may try to let it bake overnight, but if someone wants to try it in the meantime, please go ahead.

I’m skipping work to teach myself fluid sims today! and for some other reasons, namely being I have nothing to do ( I do DVD authoring and motion graphics, it gets slow at the end of the summer).

Anyway DadCant, I couldn’t get the blend file - seems like your host is down. could you attach it to your thread directly? One idea I had was to take a particle system parented to a glass sphere much like your doing, and then just composite it in aftereffects against the water render without worrying about a realistic sim. the problem is it wouldn’t compute the ray-tracing with both together and might look really bad.

Then there are two other things - I was thinking about the bubble issue for 1, a beer glass I finished I wanted to fill with realistic beer - including tiny bubbles in the fluid (and foam? yeah right). I think this won’t be so hard to fake. and 2, a model of a hookah I wanted to animate. what about the turbulence when the bubbles break the surface of the water? This might be beyond current gen blender fluid but I guess we’ll find out!

I just double checked filefactory and it works fine with Firefox 1.5 and IE 6. Did you click ‘Continue with free download’?

As far as I know vBulletin doesn’t allow attaching .blend files, only image files.

My guess would be the tiny bubbles would have to be a texture or maybe a partcle system with a halo texture.

In the single bubble test, the bubble does create surface deformations. I’m hoping the multiple bubble test does, too.

well, array modifier worked fine for me to simulate multiple bubbles…
I can’t upload the vid…youtube doesn’t let me login.
sadly I set the water to be some kind of tank, so the bubbles do not flow into air…they stay within the water boundaries.

btw…I have some probs with the cvs 2.42 rc3 build, i can’t get yafray to work…I have to model the scene with 2.42 (because of the array modifier), bake the scene and then open it up with the 2.41 to render it

the rc3 build crashes every time i try to render with yafray

hey dadcan’tdraw, i was going to mention how to make relatively big bubbles but you beat me to it. now, generating lots of small bubbles using the same method is impractical as you already mentioned. I am playing around with particles and parented halos, will report back when i make some progress.

I just can’t get the fluid to acknowledge that the dupliverted sphere’s are there. Oddly, without dupliverts the fluid flows around the orginal bubble. As soon as I turn on dupliverts, the copies and the original are ignored! $%^$#%

In the file below I made the bubble really big and there are only 50 particles to which it is dupliverted (is that a word?) and it’s only 120 frames, but still no joy.

Chop Suey:

You need the official 2.42 and the new Yafray 0.0.9 to get Yafray to work. You need both.

I thought at first that you meant reall bubles in here… I would like to see an actual simulation using two fluids of different viscosities, one with the viscosity of water and another with the viscosity of air (zero), then see the two interact.

Tyn - it is my understanding you can’t have more than one set of fluid data per sim, meaning two different viscosities are impossible at the same time. good idea though - we could fake the water and make liquid “air” bubbles, if the set was underwater, but it poses problems if you wanted it for a scene where you were looking at a fish tank or blowing bubbles in a cup of water.

my question: is there any way to multithread fluid and physics baking? That would quadruple my render speeds and maybe we could figure it out. I have one of dadcant’s sims running around 250 res right now, to see if his way works. unfortunately 1) it crashes above 300 and 2) it’s only using one of my CPUs. If anyone else gets it lemme know! I was seeing some surface deforamtions but nothing in the mesh. of course I haven’t rendered it yet, so we’ll see…

EDIT: also - Are moving fluid deflectors supported? say you wanted a mix of soft body physics and fluids? and what about animating fluid properties - is it possible to change viscosity on the fly? probably not…

f/stop: Yes moving fluid obstacles do work - at least it did in the single bubble test. Is 300 a Blender limit, perhaps? If it were strictly a function of RAM, you should be able to bake at close to 8x the resolution I can - about 1200!

I’ll bet the trick is to convert the duplivert objects to “real” objects (meaning that dupliverts are really only virtual copies of original mesh).

If I remember right…i think it is the “Make Dupliverts Real” function.

I tried converting the dup spheres with Ctrl-Shift-A, but when I do they don’t move anymore.

if you do… you might be able to make a basic emitter esp. for bubbles or make a script to bake them.

one problem with using an emitter: in things like ginger ale or beer bubbles originate not just at the bottom but all the way through the liquid… a single emitter couldn’t do it (voxels anyone?)

hmm… what an idea… a voxel particle emittor… or maby an emitter parented to an emittor…

started a script… anyone got comments?=:

You could just use the entire mesh of the inside of the bottle as the particle emitter. Subdivide it a bunch of times and select random face emission. You just have to set it so that the bubbles go upwards.

Getting the bubbles to increase in speed as they go would be the challege. I still haven’t figured out how to get the velocity of particles to change over time. Come to think of it I’ve never tried IPOs… is there a setting for Particle velocity?

as far as i know there’s no way (unless you could somehow use softbodies or something that you can set a constant force) -that’s one of the reason’s I’m making that script.

just an idea, dunno how feasable this would be…but damping does reduce speed depending on how long it has been emitted right? So wouldn’t a negative value accellerate the particles?

I first looked at this thread looking for ways to make bubbles, but didn’t find what I want. However, I did find a nice way to create bubbles:
for each bubble, create a sphere as an outflow. then, after the bubles is created, scale the sphere down so it won’t ber calculated. hat would produce a bubble. such bubbles would also increase in size, change their shape etc. when rising.

To increase particle simulation speed (or slow it down) you can use the time IPO of the emitter object.

I hope I helped,


Very clever idea - and it works. I did a quick, 50 frame test of one rising outflow bubble and it makes an interesting effect. To make more bubbles and have them appear at different times you could position them below the domain then. It would be great to parent them to a particle generator, but I haven’t gotten that to work.

Here’s what an outflow bubble looks like:

I don’t quite get the steps - you just baked the fluid sim around the animation of an outflow sphere? how’d you get them cool ripples?

I don’t if it’s exactly what tmr232 described, but here’s what I did:

Set animation to 50 frames, scaled the default cube up 3x, copied it in place, scaled the copy .99x, put an icosphere in the lower right corner and scaled it so it’s 1 blender unit across.

Set a location key at frame 1 for the sphere, go to frame 50, raise sphere just above cubes and set another location key.

set the original cube as a domain, set the smaller copied cube as the fluid (Init Volume) and set the sphere as an outflow. I set the resolution to 64 and left everything else. Bake.

I moved the sphere to another layer, set the fluid to smooth and applied my favorite clear water texture. Voila! The cool ripples take care of themselves.