fbpx

7.5 – Physical Dynamics – Volumetric Systems: Smoke

In this final part of the chapter, we will cover the dynamics of some volumetric systems such as smoke, fire, and fluids. Using the open source Mantaflow framework, Blender offers advanced physical simulation of these systems, which will take place exclusively within a limited cubic volume called the Domain. Although it is possible to assign any mesh the role of domain, Blender will still use a cube with a side equal to the largest dimension of the indicated mesh. The Domain is then divided into a discrete matrix of 3D Pixels that you can imagine as small cubes (called Voxels). A volumetric shader must be assigned to the domain using the excellent Principled Volume. Let’s start with a very simple example using a cube for the domain and a plane as the surface designated to emit smoke. Create a scene as in the following image, with the plane located inside the cube, a little above its base.

Assign physics to the Domain and the emitting plane by selecting Fluid for both in the Physics context of the properties. For the cube, set Domain in Type and Gas in Domain Type, leaving everything else set to default for now, except for the Resolution Divisions value which we will leave at 32 so that we can run some initial tests with a relatively simple system, as this parameter directly determines the level of discretization of the domain in a Voxel space, and therefore the overall precision of the simulation.

As with the systems studied in the previous paragraphs, it is possible to observe the progress of the simulation in pseudo real time simply with the space bar, but considering the complexity of volumetric systems it is convenient to precalculate the animation each time. So in the Cache panel, select Modular in the Type field and optionally change the number of frames in End (range 1-250 of the default Blender scene).

For the emitting plane, we have chosen Flow (flow – see image below) setting Inflow in the Flow Behavior field (we will see Outflow in action when dealing with liquid systems). Now start the animation (space bar) and the animation will be calculated frame by frame. At the end of the processing we can observe the result in the 3D View (in wireframe or solid mode) at the frame rate set for the animation.

The plane uniformly emits smoke that rises upwards creating vortices and a small mushroom, at least until it reaches the limit of the domain beyond which it cannot expand. At the moment, do not worry about the final rendering since the settings adopted are useful for verifying the main characteristics and behavior of these systems in real time. Despite the smoothing performed by the shader in the preview, it is possible to notice the division of the volume into a voxel matrix whose dimensions are highlighted by the small wire frame cube visible on one edge of the domain. The shading in real-time is the same for wireframe/solid modes but can be refined in the Viewport Display panel in the physics context relative to the domain. An important parameter for the emitting plane is Density (by default equal to 1), you can try to vary this density (up to zero) through keyframes and observe the realistic evolution of the smoke. With Initial Temperature (difference in temperature between the gaseous system and the environment) it is possible to increase or decrease the speed of emission of the smoke. In the smoke options of the domain you will find the vorticity parameter (0,0 – 4,0) useful for increasing the chaotic tendency of the smoke to create vortices (also depending on the emission speed, as mentioned linked to Initial Temperature). By trying to animate the plane during emission, you will observe that the evolution of the smoke is made more complex by the movement of the emitting surface. Of course, the movements of the plane can be regulated by keyframes, as well as the dynamics studied in the previous paragraphs and applicable to the surface.
Parts of the emitting mesh that are outside the domain will no longer emit smoke. You can enable emission from specific parts of a mesh defined by a vertex group, or by using any procedural texture, for example of the Distorted Noise type. In this case, it is necessary to activate the Texture panel in the Smoke Flow physics for the plane, and here choose the texture, the mapping projections, the Size and finally the Offset:

The texture will act as an intensity map and the areas mapped with the lighter colors will be those from which the greatest emission will take place. You can use a procedural texture defined in the appropriate context, icon .

To obtain a more accurate simulation of smoke emission, thereby increasing the time required to calculate the dynamics, simply return the Resolution Division parameter to 64 or even higher if your computer is well equipped. The number of 3D pixels will correspond to the value of the Resolution raised to the cube (which is why it is advisable not to exaggerate). At the end of the processing, choose one of the frames visible in the 3D View, and switch to rendering it only after appropriately setting the Principled Volume (which I remind you is assigned to the domain) and reducing (not too much) the Step Size value in the Volumes panel of the render context (we are talking about the Cycles engine). In the image (below) I have set up a very simple direct lighting and inserted the Monkey mesh to highlight the volumetric and semi-transparent nature of the Smoke system. But I did not limit myself to this, in fact I gave the Suzanne primitive the Fluid > Effector physics (default settings), so that the smoke in its evolution collided with the surface.

There is also the possibility of using an adaptive evolution of the domain, which will no longer remain fixed in limiting the emission of smoke, but will increase according to its extension. For this purpose, it is necessary to activate the Smoke>Adaptive Domain panel

In the final processing, a smaller, actual domain is created by Blender, which will expand to match the maximum dimensions of the original domain, further increased with the Add Resolution parameter (at the inevitable cost of increased processing weight). Clearly, any smoke emission (as well as steam) will not be able to create unlimited high columns, as after a certain time from the emission and reaching a certain height, the smoke will tend to disappear. The time is set in the Fluid > Dissolve panel. Increasing the value in Time, the smoke will disappear more quickly.

Now that we know how to create a realistic simulation of smoke, why not add some flames too? Let’s see how to proceed to set fire to the Suzanne mesh: insert it into the scene and apply the Subsurf modifier (rendering: 2) with smooth shading active. The domain will be a cube this time scaled in height along the y direction. Set everything as in the following images, possibly varying the parameters to decrease or increase precision and therefore the calculation time.

Domain Physics

I remind you that in the Cache panel I have set Modular in Type instead of Replay (default), so that the animation is calculated by clicking on Bake Data in the Fluid>Setting panel.

Suzanne Physics

Regarding rendering in Cycles (which also applies to eevee although with poor volumetric rendering quality), this time we will have to combine two volume shaders, that of the smoke with that of the flames, which by their nature will have to illuminate the surrounding environment. The excellent Principled Volume, which includes luminous emission, is still available to us. To correctly sum the two shaders, we will have to use the Attribute node (input family) as in the image:

In the two nodes we will have to correctly insert density and flame in the name field and connect everything as in the figure. The color ramp node can be configured according to the desired result. I chose a linear interpolation between 4 shades: black, orange, yellow and white, with increasing alpha transparency (black completely opaque, white transparent).

Next paragraph
Previous paragraph
Back to Index


Wishing you an enjoyable and productive study with Blender, I would like to remind you that you can support this project in two ways: by making a small donation through PayPal or by purchasing the professionally formatted and optimized for tablet viewing PDF version on Lulu.com  



>Purchase the ebook (PDF) on Lulu.com securely using PayPal and prepaid cards<