From Professor Mahoney

From Professor Mahoney


Fluid dynamics

Tutorial by James Mahoney

Topics

  • Bifrost Fluids

  • Emitters

  • Solvers

  • Fields

  • Passive Colliders

  • Save Initial State

Exercise

Part A - Filling a Dish

  • Create a new empty scene and give it a good name, set your shelf to “FX”

  • Add a physical sky and bump up the intensity as usual

  • Make sure the playhead is at frame 1 and that right click on the timeline and make sure that the Playback Speed is set to one of the “Play Every Frame” options.

  • Create a polygonal dish ( I used a hemisphere with extruded faces and shaped with the object scale tool) Keep it simple.


From Professor Mahoney

From Professor Mahoney

  1. Select the sphere inside the dish and with it selected click on Bifrost Fluids>Liquid

  2. This sets up a fluid simulation and sets the selected object as the emitter (not too different than nParticles but there’s now a bifrostliquid simulator instead of a nucleus

  3. BifrostLiquid has a child node called “liquidShape1” select that and in the attributes you can increase the Particle Display>Point Size to about 3 or something so you can see it better

  4. Select the dish mesh object and then select the bifrostLiquid node

  5. Then make the dish a collider with Bifrost Fluids>Add>Collider

  6. In the bifrostLiquidProperties node you’ll find under Resolution the most important parameter which is “Master Voxel Size” make this small for a higher resolution simulation. (but it takes longer) 0.15 or 0.2 is a good compromise in most cases)

  7. Also important is under the bifrostEmitter node you’ll find “Continuous Emission” which converts the emitter to something more like a faucet - it just keeps generating more fluid

  8. Now hit play to run the simulation - you should see the blue particles fill the dish - if some spill out you can either raise the edges, lower the emitter or add a “Kill Plane” below the dish so that the simulation doesn’t continue to waste time on unnecessary particles

  9. Let the simulation run a while until the particles settle down a little.

Screen Shot 2019-02-02 at 10.27.40 AM.png
  • Hiding the dish and sphere and rendering should give you something like this.

  • Open up the Hypershade to find that Bifrost created a new aiStandardSurface material automatically. You can edit this to adjust the material (“Coat” color is a nice effect on this)

  • Select the bifrostLiquid node and find Bifrost Fluids > Set Initial State (you cannot change Master Voxel Size after doing this)

Part B - Making a Splash

  1. There are many things you can now do with this pool of water

  2. For one you can now animate this bowl and the fluids will respond somewhat like a normal fluid

  3. Open up the transform node for the bowl and right click on the translation and rotation inputs and select “Set Key”

  4. Then move down to about frame 15 (½ a second) and move and rotate the bowl (just a little is usually best) Set a keyframe as before

  5. Rewind the simulation and hit play.

Screen+Shot+2019-02-02+at+10.32.46+AM.jpg


  1. Alternatively, you can try dropping another collider into the pool to make a splash (this is a bit easier I think)

  2. Make a new sphere or box and position it above the fluid. Make it a collider just as the bowl

  3. Set a keyframe for its position on frame 1

  4. Then move the playhead to frame 15 and set a keyframe in the fluid and rewind the playhead and run it again.

  5. *note: you can right click on a key and choose delete. Also, dot and comma keys advance the playhead by keyframes and shift and click to select a range and then click and drag to move keys around.

  6. Have fun!

Screen Shot 2019-02-02 at 10.36.52 AM.png