← All tutorials

Fluid Simulations in Blender 2.9 with Mantaflow

Note (2026): This was made in Blender 2.9. Mantaflow is still Blender’s fluid engine in the 4.x releases and the workflow is the same, but a few labels have changed. For example, “Is Resumable” in the cache settings is now just “Resumable”.

Tutorial Files: fluid-simulations-in-blender-2.9.blend

Most fluid tutorials for Blender have you drop some liquid into a box. I wanted something a bit more fun, so this one has a shark.

The plan: pour liquid down one end of a water tunnel so it splashes over a shark, as if it’s swimming upstream. Along the way you’ll set up a fluid domain, add an inflow, get collisions working, turn the simulation into a mesh you can render, and finish with spray particles for extra detail.

This is an intermediate tutorial, so I’ll assume you’re comfortable finding your way around Blender. If you’re just starting out, have a look at my Blender beginner tutorials first and then come back.

The Scene (0:40)

The project file has two things in it: a low-poly shark model from Blend Swap by ryzer789 (thank you), and a long water tunnel for it to sit in. Download the file above if you want to follow along with exactly the same setup.

The starting scene in Blender: a low-poly shark inside a long dark water tunnel with strip lights along the floor

1. Create the Fluid Domain (1:39)

Every Mantaflow simulation needs a domain. Think of it as the aquarium: the space where liquid can exist and where Blender does all of its calculations. Nothing outside the domain gets simulated.

  1. Add a cube with Shift + A > Mesh > Cube.
  2. Scale it up (S) so it wraps around the entire water tunnel and the shark. G then Z moves it up, and S then X stretches it along the tunnel.
  3. Rename it Domain in the Outliner.
  4. In the Properties panel, open the Physics tab (the atom icon) and click Fluid.
  5. Set Type to Domain, then change Domain Type from Gas to Liquid.

There are three fluid types and you’ll use all of them in this tutorial. Domain is the container. Flow is either an inflow that pumps liquid in or an outflow that drains it. Effector is for collisions.

The moment you switch to Liquid, the domain turns into a solid box that hides your whole scene. That’s because Mantaflow turns the domain itself into the liquid mesh later on. Until then it’s just a box.

The fluid domain displayed as a solid grey box covering the water tunnel and shark

X-ray mode (Alt/Option + Z) helps a little in solid shading, but it doesn’t work in rendered view. A better fix is to go to Object Properties > Viewport Display and set Display As to Wire. The domain, and later the liquid mesh, will show as a wireframe in the viewport but still render normally.

The domain set to wireframe display, so the water tunnel and shark are visible inside the orange outline

2. Set Up the Domain Cache (4:07)

Mantaflow has a huge number of options. I’ll leave almost all of them on their defaults for now and go straight to the Cache section at the bottom of the domain’s physics settings.

  • Cache folder: where Blender writes the simulation to disk so you can preview it in the viewport.
  • Frame start and end: mine match the project, 1 to 225.
  • Type: I’m not a fan of Replay, which is meant to be more interactive but doesn’t work well in my experience. All bakes everything (simulation, mesh and particles) in one go. I prefer Modular, because it lets you re-run the fluid simulation, the mesh and the particles independently.

Leave Is Resumable off for now. You’ll need it later, and you’ll see why.

3. Add a Fluid Inflow (5:17)

Now you need somewhere for the liquid to come from.

  1. Add a UV sphere (Shift + A > Mesh > UV Sphere) and move it to one end of the tunnel, just above it.
  2. Make sure it sits inside the domain. Liquid generated outside the domain never reaches it and never gets calculated.
  3. Rename it Inflow, add Fluid physics and set Type to Flow.
  4. Set Flow Type to Liquid and Flow Behavior to Inflow.

A UV sphere placed above one end of the water tunnel, with Flow physics set to Liquid

If you leave Flow Behavior on Geometry, the sphere itself turns into liquid once and drops into the scene. Inflow gives you a continuous stream, which is what the shark needs.

4. Bake the Simulation (6:42)

Select the domain. Right under the liquid settings in its physics tab you’ll find Bake Data, which bakes the fluid simulation itself. At these low settings it races through.

Scrub through the timeline and you’ll see blue particles pouring out of the sphere. They fall straight through the water tunnel, collect at the bottom of the domain and drain away to one side. Not quite the plan.

5. Add Collisions (7:20)

The liquid ignores the tunnel because Blender doesn’t know it’s solid yet.

  1. Select the water tunnel, add Fluid physics and set Type to Effector. Collision is the default effector type, which is what you want.
  2. Select the domain and click Free Data. You can’t change most settings or re-bake while a bake exists.
  3. Click Bake Data again.

Now the water hits the tunnel, but it still pours through at the corners.

Blue fluid particles leaking through the corner of the water tunnel after the first collision bake

Two settings fix this, and both are about accuracy (8:23):

  • Sampling Substeps on the collision object. The fluid’s FLIP particles can move so fast between steps that they pass through a wall without the simulation noticing. More substeps means more accurate collision detection. I set the tunnel to 10 first and later 20.
  • Resolution Divisions on the domain. At the default of 32, the simulation space is so coarse that particles can step right over a thin wall. Doubling it to 64 helps a lot, but bakes get noticeably slower as this goes up. I ended up at 80 for this stage.

With both raised, the spillage is gone. Bake times depend on your computer and the level of detail, so from here on I speed the bakes up in the video.

6. Let Liquid Leave Through the Domain Walls (10:27)

Next problem: the water hits the far wall of the domain and flushes back underneath the tunnel. By default every wall of the domain is solid, so liquid stays trapped in the aquarium.

Fluid hitting the domain wall at the end of the tunnel and collecting underneath it

Free the data on the domain, find Border Collisions and untick every side. Particles that hit a wall now simply vanish. Because there’s a constant inflow anyway, that’s fine, and it also keeps the simulation fast. Let particles pile up in the domain and Blender has more and more to calculate.

I also moved the domain (G, X) so it ends right where the tunnel ends. Re-bake, rewind and press Space to play it back.

7. Give the Shark Collisions (11:49)

The shark still has no collision. Select it, add Fluid physics and set the type to Effector. Collision is again the default. The shark has finer detail than the tunnel, so I set its Sampling Substeps to 20.

Then free the domain data, raise Resolution Divisions to 100 and bake again. Feel free to go higher if you’re following along. Just be ready for it to take a while.

Blue fluid particles splashing against the front of the shark as they flow down the tunnel

This is where it starts to look good. You can see the water splashing on the shark’s face as it flows past.

8. Viscosity and Surface Tension (12:45)

Because the domain is set to Liquid, it uses a method called FLIP (fluid implicit particles). Those are all the particles you’ve been watching. There are plenty of settings here, like Sampling Randomness, that are worth playing with. Two in particular change the character of the liquid:

  • Viscosity adds thickness. By default the fluid behaves like water. For honey or chocolate sauce, turn this on, but keep Strength really low, around 0.05 or less. Otherwise you get a solid block of particles that won’t move. It also slows the simulation down dramatically, to something like a tenth of the speed.
  • Diffusion adds surface tension, how much the liquid holds together. Think jelly.

I turned both off again for this scene. Both make your computer work a lot harder.

9. Generate a Mesh From the Fluid (14:12)

Those particles won’t render. If you press F12 now, you’ll get a solid grey box where the domain is, because until there’s a mesh, the domain is just a box.

To turn the particles into something renderable, enable Mesh in the domain’s physics settings. Try to bake it and Blender tells you the cache isn’t resumable. That’s the setting from earlier: with a Modular cache you need Is Resumable enabled, or you can’t build a mesh from the finished simulation.

  1. Free the data.
  2. In the Cache section, keep Type on Modular and tick Is Resumable.
  3. Click Bake Data to re-bake the simulation. I also raised the resolution to 120 here.
  4. In the Mesh section, click Bake Mesh. That took about two to three minutes for me.

The domain now takes the shape of the liquid mesh. I wish Blender kept a fixed wireframe domain and a separate liquid object, so you didn’t have to toggle display modes back and forth, but that’s how it works.

Render it with F12 and you’ll see the liquid flowing past the shark. You’ll also notice it’s quite blobby, with big drops.

A render of the first fluid mesh, which looks lumpy and blobby around the shark

10. Add More Detail to the Mesh (17:05)

Click Free Mesh and adjust two settings in the Mesh section:

  • Particle Radius controls how the FLIP particles are turned into the mesh. Smaller values give a finer mesh but make it more likely to tear.
  • Upres Factor multiplies the domain’s base resolution for the mesh only, adding detail. I set it to 3.

Leave the rest on their defaults for now. They’re worth reading up on, but there’s a lot of detail in there. Then click Bake Mesh and go and get a coffee or feed the cat. It took about six minutes on my machine.

A top-down view of the much more detailed orange wireframe fluid mesh flowing around the shark

There’s much more detail now, and you can keep raising it or combine it with viscosity and diffusion to get the look you want.

11. Render the Water (18:27)

The render still looks rough and solid. Three changes help:

  1. Right-click the mesh and choose Shade Smooth.
  2. Add a new material called water_mat and change Principled BSDF to Glass BSDF. Set the IOR to 1.33, the value for water.
  3. In the render settings, switch from Eevee to Cycles. Eevee doesn’t handle transparent, refractive materials like this well, at least in this version of Blender. I also set Device to GPU Compute.

A Cycles render of the glass water material flowing around the shark inside the tunnel

The lighting is quite strong in my scene, but you can see the tip of the shark’s face and its fin through the water.

12. Add Spray Particles (19:27)

The last step is particles for spray, foam or bubbles. With the domain selected, open the Particles section in its physics settings and tick Spray. Because the cache is Modular, you can bake particles on their own: click Bake Particles.

Spray now appears wherever the liquid is interacting forcefully with itself.

Blue spray particles appearing above the orange fluid mesh along the water tunnel

In the domain’s Particle properties you’ll find two particle systems. The first holds the liquid’s FLIP particles, which have already been turned into the mesh, so you can hide them in the viewport. The second is the spray.

The spray won’t show up in a render yet, because it’s set to render as Halo, which is invisible. Give each particle an object to render as instead (20:53):

  1. Add another UV sphere, and before doing anything else open the Adjust Last Operation panel and drop it to 8 segments and 4 rings. This sphere gets copied onto every spray particle, so a heavy one will bring Blender to a halt.
  2. Move it out of the way and rename it spray_particle.
  3. Select the domain, choose the spray particle system and, under Render, change Render As to Object.
  4. Set Instance Object to your spray particle sphere.
  5. Scale the particles down a little and add some Scale Randomness so they aren’t all identical.

A Cycles render of the shark with water and white spray particles splashing around it

Press F12 and the spray is in the render.

Where to Go Next

There’s a lot I haven’t covered: the many other Mantaflow settings that change how a fluid looks and behaves, rendering it properly in Cycles, and setting up materials for different kinds of liquid. Those are the natural next steps once you’ve got the basic pipeline working: domain, inflow, collisions, mesh, material, particles.

For a related simulation with the same domain-and-flow setup, see smoke simulations in Blender.

Thanks to Jimmy from Axe 2 Grind for the cameo. If you’re into guitar covers, look them up.

2 Comments

  • Larenju Rai

    Hello Sir,
    I am following your tutorials in YouTube. I recently watched Fluid Simulations in Blender 2.9 with Mantaflow. So I need the download files. Thank You very much for the tutorials.

    • Surfaced Studio

      Hi and thank you for the comment! The files can be downloaded from the link at the top of the post - just underneath the video there's a 'Tutorial Files' link you can use 😊