Cg Cookie Education

SUBSCRIBE: RSS | E-Mail

Blender: Human Head Modeling Series
Blender Featured Video Education
Fire and Smoke in FumeFX

Fluid Dynamics with Limit Realflow

Hi my name is Alessandro Cangelosi, you may visit me also at my website at: http://www.alessandrocangelosi.com/

Step 01

Welcome back to our tutorials. While I’m working on more interesting, (we hope), educational stuffs for you, it’s time to start a new tutorial’s lineup. This week we’ll start understanding something about fluid dynamic in a mixed pipeline using Next Limit Realflow and Autodesk 3ds max. The tutorial can be accomplished with other 3D software and Realflow. This exercise will be not so complex but it will be a good point to start understanding fundamentals about fluids, dynamic, and special effects. So let’s start setting the 3ds max unit setup in centimeters.

Step 02

Create a Box primitive with Lenght = 25cm, Width = 25cm, Height = 15cm as in the figure,

Step 03

Now convert the box in an Editable Poly, select the upper face as in the figure and delete it, we’ll modify it to create a water container,

Step 04

Add a Shell modifier with the default parameters, now we have the 1st container,

Step 05

Make a copy of it, so we’ll have two containers as in the figure,

Step 06

Click on the Time Configuration icon, the panel will be opened and you’ll be able to set the time for the scene animation at PAL, and 501 total frames for the complete duration,

Step 07

Let’s start to create our test animation. We’d like to fill a container with some kind of fluid, and then use it to fill the other one, so go we need to have the “right” container still until we are at frame 40 as in the figure,

Step 08

Move it at frame 100 with the “Auto key” button active as in the figure,

Step 09

And the move it as in the figure at frame 200,

Step 10

Now rotate it as in the figure at frame 280,

Step 11

Now we are ready to export the animation in Realflow, (to do it you have to install it on your workstation, but the 3ds max Realflow plug-in also), before you start the export operation, please remove the Shell modifier from the animated container, because we need it with no volume to fill it in Realflow. Now click on the “SD File Export Settings”, so you can change the settings in the panel as in the figure, please set “Entire Scene”, Deformation = Autodetect, Active Time Segment, and set the file name as in the figure, it will create a scene file with .SD extension that will be readable in Realflow,

Step 12

Please run Reaflow 4. As soon as you launched RealFlow, please go in the menù File, then click on Preferences, and in the panel that will be opened, please set Axis setup = ZXY (3ds max, Maya). Go in the File menu, choose “Create a new project”, and choose the file name you want in the panel as in the figure,

Step 13

Now click on the “Add object” icon and choose “Import…” from the object list as in the figure, or click CTRL+I, when asked choose the .SD scene file saved before from 3ds max,

Step 14

As you can see you have the same scene we created in 3ds max, here inside Realflow, if you try to move the time slider, you’ll see the animation,

Step 15

The 1st thing we have to do,is to create the fluid inside the animated container, so please click on the “Add emitter” icon, and choose “Fill object”, it will fill a 3D mesh with fluids using various parameters,

Step 16

In the “Nodes” panel view, choose “Fill_Object01”, so all the emitter’ parameters will appear in the “Node Params” as in the figure, now click on the “Object” parameter inside che “Fill object” sub-panel, a little panel will appear as in the figure, choose the Box02, (the animated one), mesh,

Step 17

Now, in the “Particles” sub-panel, set Resolution = 0,01, (this parameter will controls the amount of particles used in the simulation, with higher value we’ll have more particles so a more stable and precise simulation, but it will be slower during the calculation), Max Particles = 150000, then in the “Fill Object” sub-panel set fil Z ratio = 0.6, it means we are filling the mesh by the Z axys at 60%, you can see the result in the figure,

Step 18

Now please click on the “Daemons” icon, and choose “Gravity”, so we’ll add a realistic gravity force, set as in the real world,

Step 19

Trying to make it faster for the test simulation, we’ll change the “Resolution” parameters at 0.004, so we’ll have less particles, but it will be faster to simulate and operate on,

Step 20

Now if you’d like to see what happens and if the scene is working, you can try to simulate the dynamic solution by pressing the “Simulate” button, as you can see in the figure the simulation seems very interesting at frame 157, if you want to stop the simulation you have to press the ESC key,

Step 21

Here you can see the simulation at frame 292, as you can see the fluid collides with the other container in a very realistic way,

Step 22

At the moment we have only the particle simulation, but in order to export and render the fluid mesh we have to create the 3D mesh starting from the simulated emitter, to do it you have to click on the “Add mesh” button, so you’ll see the “Mesh01” object in the Nodes panel, select it and you’ll see the mesh topology parameters in the Node Params panel as in the figure,

Step 23

Now click on the “persp” label on the Perspective viewport with the right mouse button, then select “Shading” and then “Smooth”,

Step 24

In the Mesh node params, set Polygon size = 0.3975, (this is the face size, with bigger size the mesh generation is faster but the precision is lower), then click with right mouse button over “Mesh01” object, and click on “Build” to generate the mesh at the selected frame, (we worked at frame 243),

Step 25

Now open the sub-object level of the Mesh01, and select “Fill_Object01”, in the Node Params, set Radius = 0.15, (this is the radius of the metaball applied at every single particle of the fluid, with lower value will have a more precise mesh but it will needs more particles),

Step 26

Go back at the Mesh01 parameters and set Polygon size = 0.15 to obtain a more precise mesh,

Step 27

Go back at the 1st frame as in the figure, and try to build the mesh to check it,

Step 28


Now move at frame 223, and set Filters method = Yes, in the “Filters” sub-panel, as in the figure, it will gives a more realistic appearance at the fluid mesh topology with a lower “ lobmesh” effect,

Step 29


Now we are very near to launch the final mesh generation, but we have to make it faster, so set Polygon size = 0.3 and click on the “Build mesh” button or press CTRL+SHIFT+M, it will generate the mesh for the entire simulated frames,


Step 30

Now you can go back in 3ds max, in our old scene, with the RF Mesh Loader, please load the .BIN generated mesh, to find these files you can use the export panel in RealFlow,using the menu Export—Export Central, the file usually are in the Document and settings folder inside a sub-folder, but you can reach it with no problems, as you can see in the figure, now we have the simulated fluid mesh inside 3ds max,

Step 31

Let’s start creating some basic shader to render it, in the Material Editor create a Arch&Design shader for mental ray, set it with the Ceramic Tiles preset, (remember to set Mental Ray as standard rendering engine), and apply it to the container not animated,

Step 32

Go in the Diffuse map and open the “Advanced controls” of the Tiles map, change the Texture color in a similar way as proposed in the figure,

Step 33

Now please create a new Arch&Design shader, set it as “Glossy plastic” preset, set the diffuse color as proposed in the figure, and set Glossy samples = 16, apply it to the animated container,

Step 34

Now add a Spot light source as in the figure, and set Shadows = On, with Ray traced shadows, leave all the other parameters set to default values,

Step 35

Add a Skylight and leave all the parameters as default,

Step 36

Select the imported fluid mesh, and add a Turbosmooth modifier to it to make it more precise, in the Material Editor create a Raytrace shader, change the diffuse color as in the figure, Specular Level = 130, Glossiness = 38, and apply it to the fluid mesh,

Step 37

In the rendering settings panel
activate the Final Gather with the Draft preset, and try to make a
test render, you should obtain something similar to the figure,

Step 38

Create a camera similar to the figure point of view and try to render it at various frame to check the animation,

Step 39

Trying to simulate a simple water shader, make a new Raytrace shader in the Material Editor, set Transparency = 90, Specular level = 70 and Glossiness = 50, Reflect = Fresnel, try to make a render, you should obtain something similar to the figure,

Step 40

Let’s try to simulate a different liquid shader, select the “water” shader and change the Specular color as in the figure, Specular level = 40, then in the “Extended Parameters” panl, activate “Fog” and set End = 5 and the fog color as in the figure, if you’ll try to render it, you should obtain something similar to the figure, a strange red fluid with color changing by density,

Step 41

An other test frame, now you are ready to render the entire simulation. This tutorial is only the beginning of our fluid dynamic series, in the next one we’ll discuss more complex features that can be found inside RealFlow, exploring bubbles, sea surfaces, foam, spray, gas etc etc.

(Usaged of source files requires Realflow)

12 Responses to “Fluid Dynamics with Limit Realflow”

  1. Alex GenoveseNo Gravatar Says:

    Another solid tutorial! Thank you =)

  2. Geronimo 3DNo Gravatar Says:

    This tutorial maybe aimed at beginners, but is impossible to follow because the great number of error’s. First off, the writer is referencing the figures all the time, but the screenshots are to small to read, leaving the user guessing at certain parameters which however are very important to succesfully complete this animation.
    Secondly the writer has made some changes inside RealFlow to suit his personal needs but forgets to tell us. For instance the Y axis is (per default) UP in realflow, not Z. One needs to change this otherwise the cube will be filled in the wrong direction, perpendicular to the gravity (haha).
    Also, one needs to activate Fill Volume in step 17 otherwise you cannot specifiy any fill rate.

    This tutorial has great potential, but at this stage can only be followed by somebody that has knowledge of realflow and that’s not really what it’s intended for.

  3. Wes BurkeNo Gravatar Says:

    @Geronimo

    Thank you for the extra set of eyes on this. We have inserted the text to remind users to correct the Z-axis upon opening Real Flow.

    Working on the rest to provide clearing renders and thank you for the feedback.

    Cheers,

    W

  4. DougNo Gravatar Says:

    This tutorial would be awesome if we could zoom into the pictures. As they are currently, they border on useless. I appreciate your hard work, this slight change would take it to the next level.

    Best,

    Doug

  5. Wes BurkeNo Gravatar Says:

    @Doug,

    Thanks for the comments and I agree with you. I am working with Alessandro to see if we can get some zoomed in screen shots of the values he has set for this tutorial

    Cheers,

    W

  6. MIGUELNo Gravatar Says:

    VERY GOOD TUTORIAL.

    -THANK YOU-

  7. NareshNo Gravatar Says:

    very nice tutorial

    can u send me more tutorials

  8. AdELNo Gravatar Says:

    hi, thnks for tutorial. but i have a problem with WXPORTING, (Step 11),
    I really need to explain… :(

  9. PeterNo Gravatar Says:

    I am facing a problem when I try to render the sequence in Mental Ray.. After the first two frames the liquid mesh does not update its shape in the render.. However I don’t see a problem when I create a preview of the animation or render using the basic scanline renderer.. Also I dont have a problem when i scrub to a particular frame and render the single frame using Mental ray..

    Am I missing some setting??

  10. BorjaNo Gravatar Says:

    if you right click on the fotos and save them you can then zoom in a bit more

  11. chitwan chadhaNo Gravatar Says:

    hi i have one problem when i render real flow mesh loader
    in 3ds max with mental ray in single frame it render good
    but in sequens file mesh didnot render

    Please can u tell me why it happened
    thanks
    chitwan chadha

  12. Adnan IBNo Gravatar Says:

    hi i have one problem when i render real flow mesh loader
    in 3ds max with mental ray in single frame it render good
    but in sequens file mesh didnot render

    Please can u tell me why it happened
    thanks
    Adanan IB