# How to simulate a gas?

I am totally new to blender and 3d rendering.

What I want to create is something similar the water filling an object except in reverse. Meaning, I want it to simulate natural gas fumes that rise and fill up pockets above and then spill out of that and continue to rise. This would be a constant flow. I looked at the smoke effect, but I didn't see where you can adjust the opacity or color of the smoke to make it adjust to look more fume like. I thought if you could reverse the gravity of liquid and make it flow upwards, I could possibly adjust the material to look more like fumes.

Here is the scenario - There are CNG (compressed natural gas) gas pumps. If there are leaks, these fumes (unlike regular petroleum fumes which sink) rise and can collect in certain pockets within the dispenser and just like a glass filling up, if you continue to pour (or gas continues to leak) it spills over. This is the effect I would like to try and create.

Is there some sort of tutorial that I can look at that will help guide me in the right direction?

• First, methane is the only "natural gas" would rise as you describe. All other natural gas molecules are heavier than air, and would sink like regular petroleum fumes. What you want to do can be done, but it's not a first or second project level endeavor. Since you're totally new to Blender I'd suggest reviewing my answer in <blender.stackexchange.com/questions/10495/…> in order to acquire the skills to achieve what you want. – brasshat Jun 12 '14 at 20:28

I think you are best off smoke simulation. The fluid simulator is better for liquid simulations, as you get a mesh as a result. The smoke simulator is better for gas/smoke simulations, as you get voxel data with density information (you get heat and velocity information too, but most importantly you get density).

To make a smoke simulation:

# Setup

1. Create an object to emit the smoke (e.g. a plane):

2. Select the emitter/plane and press Space, then type in quick smoke. This will setup a domain object and some materials automatically.

If you want to do this manually instead:

1. Add a domain object (usually a cube) and scale it so that it contains the area in which you want the smoke to go. Note that the bigger it is, the more resources are required to compute the simulation.

2. With the domain object selected, enable smoke physics in Properties > Physics, and set the type to Domain. You might also want to enable Adaptive domain, which skips calculating areas which don't have any smoke.

3. Add a new material, set the type to volume, and set the density to 0:

4. Add a new texture, set the type to Voxel data, and select your domain object:

At the bottom of the texture settings, in the Influence panel, enable Density:

5. With your emitter selected, enable smoke in Properties > Physics and set the type to Flow:

That's it as far as quick smoke can do things, so the rest is manual:

3. Select the object you want to collide with the smoke and enable smoke physics in Properties > Physics, and set the type to Collision.

4. Press AltA to play the animation (and simulate the smoke):

These are just the absolute basics, there are many more settings for the materials and simulation. I recommend you look around for some tutorials on smoke simulation. Here's a list of some good resources.

Besides quick smoke I added a hemi-sphere as obstacle with this settings:

A tutorial with more detailed information you find here:

Working with Obstacles and Smoke Simulations in Blender

Firstly as far as gravity goes you have full control within blender. By default gravity is set as -9.81 on the Z-axis (settings are in the scene properties), if you change that to 9.81 then simulations will begin to flow in the opposite direction. You can even set it as 9.8 in both X and Y and have simulations flow at 45 degrees. You can also rotate and position your camera so that simulations appear to move any way you wish.

Using a smoke sim can give you a nice visible result to give an artistic representation to clearly show the flow of fumes for demonstration purposes. For a more realistic visual result I think a heat distortion effect would be closer to reality.

BlenderCookie recently had a tutorial on heat distortion. The basics of a heat distortion effect is to use a particle system to generate a mask that you use to displace the image in the compositor.

• I like the idea of the heat distortion. This would make it more like real life. The only issue is that the duration isn't long enough, meaning it dissipates too soon. Which setting would I use to lengthen the "emission" so that it can collect? – Troy Jul 1 '14 at 19:52
• The "emission" of the particles? In the particle properties under emission you have start end and lifetime, that is the frame number that particles start emitting, end emitting and how long they exist. – sambler Jul 2 '14 at 16:57