---
title: "How Does Phoenix's Simulation Work?"
canonical: "https://documentation.chaos.com/space/PHX4MAYA/125765048/How%20Does%20Phoenix's%20Simulation%20Work%3F"
format: markdown
---
# **How does Phoenix's fluid solver work?**

---

- Reads the scene nodes which interact with the simulator - obstacle geometries, emitters of fluid which can be either geometries or particles, forces, etc.
- Adjusts the simulation velocity during the **Conservation** phase.
- Transports the fluid along the velocity field during the **Advection** phase.

## **Particle vs. Grid-Based Simulation**

---

- In a particle simulation, particles move through space and each particle carries properties of the fluid (*particle channels*), such as Age, Size, Viscosity, RGB color. Particles interact with each other - attract and push each other apart, or exchange properties such as color and viscosity. Phoenix uses particles for simulations of liquid effects such as foam, splash or mist. The more particles there are in a simulation, and the more they need to interact with each other, the more time the simulation would take.
- In a grid simulation, the simulation container is divided into cells (voxels) that contain the fluid's *properties (grid channels)*. Examples of commonly used grid channels are Temperature and Velocity. The name *voxel* comes from an analogy with 2D images made of pixels, but in 3D space these have volume and are called voxels. The voxels are static pieces of space, and the fluid flows in and out of them, so with time the voxel's channels can change. Phoenix uses grid simulations for gaseous effects such as fire and smoke. Grid-based effects are contained within a rectangular grid, while particle-based effects have no such space constraint.

## **Fire/Smoke vs. Liquid Simulation**

---

- Fire and smoke - Gaseous effects like fire, smoke, and explosions. These simulations are grid-based. Such effects tend to be buoyant, meaning they are lighter than air and so tend to rise against gravity.
- Liquid - Pouring or flowing liquids, bodies of water such as lakes and oceans, and any simulation that requires foam or mist, such as beer, coffee, or even waterfalls. These simulations use both a grid and particles. Such effects tend to react to gravity by falling when not held in place by a container.

# **Simulation and Rendering**

---

## **Simulation Channel Setup**

---

- Temperature channel - Degree of heat; determines the brightness of the fire.
- Velocity channel - Speed and direction.
- Speed - Rate of motion not including direction.
- Fuel - Amount of fuel remaining (fuel is "consumed" by burning).
- Smoke - Buoyant gas resulting from fire or burning. This channel is usually desirable for fire simulations.
- UVW coordinates - A helper channel used for texture mapping or directly as an RBG value. It does not affect the simulation.
- Wavelet - Must be exported only when wavelet turbulence will be applied to the simulation on a second pass (resimulation).
- Particle ID - Identifies each particle, which is useful when particles need to be tracked from one frame to the next.
- Surface - Stores information used by rendering techniques such as solid rendering and displacement.

## > Macro (anchor)

**Activity During Simulation**

---

- [How Does Phoenix's Simulation Work?#Burning](https://docs-chaos.atlassian.net/wiki/spaces/PHX3MAYA4EDIT/pages/117295456)
- [How Does Phoenix's Simulation Work?#Cooling](https://docs-chaos.atlassian.net/wiki/spaces/PHX3MAYA4EDIT/pages/117295456)
- [Vorticity Confinement](https://docs-chaos.atlassian.net/wiki/spaces/PHX3MAYA4EDIT/pages/117295456)

###   
> Macro (anchor)

**Burning**

---

### > Macro (anchor)

**Cooling**

---

### > Macro (anchor)

**Vorticity Confinement**

---

## > Macro (anchor)

**Interaction with External Objects**

---

- [Rigid bodies (polygon geometry)](https://docs-chaos.atlassian.net/wiki/spaces/PHX3MAYA4EDIT/pages/117295456)
- [How Does Phoenix's Simulation Work?#Particles](https://docs-chaos.atlassian.net/wiki/spaces/PHX3MAYA4EDIT/pages/117295456)
- [Fields (Forces)](https://docs-chaos.atlassian.net/wiki/spaces/PHX3MAYA4EDIT/pages/117295456)

### > Macro (anchor)

**Rigid Bodies**

---

- When the body is not selected as source but interacts with the simulator, the cells inside the geometry are frozen and the velocity of the surface cells is determined by the movement of the body.
- When the body is selected as source, the cells inside are frozen and the surface cells are set with the parameters of the source. The velocity is calculated according the discharge and the body's movement.
- When the body is selected as source, but doesn't interact with the simulator; the fluid inside the geometry is directly affected according to the **Emit Mode** of the simulator.

### > Macro (anchor)

**Particles**

---

### > Macro (anchor)

**Fields**

---

- If the field is a Gravity field, the acceleration is calculated directly using the buoyancy of the fluid. If the buoyancy is negative, the fluid accelerates toward the gravity force, otherwise it accelerates away from the gravity force.
- If the field is not Gravity, the fluid is accelerated toward the force. The magnitude of the acceleration is determined by the inertia of the fluid and the magnitude of the force.

> Macro (ui-text-box)
> 
> Note: Maya fields are slower than the included standard gravity and turbulence. Only some of the forces can work in multi-threaded mode.

## **Fluid Buoyancy and Density**

---

In nature, buoyancy and density are strongly connected. However, for more flexibility, the Phoenix simulator considers them to be independent of each other.

### **Buoyancy**

---

In nature, the buoyancy is the difference between the local density and the environment density. This determines the local result from the forces applied over the whole fluid. In Phoenix, the buoyancy is determined by the temperature, the fuel and the smoke. The buoyancy is used when the embedded gravity is applied or when a Gravity field is used. The temperature determines the buoyancy just as with real gasses. The temperature above environment temperature means positive buoyancy, where the environment temperature is 300 Kelvins (23 degrees Celsius). The smoke and fuel determine the buoyancy using their coefficients of buoyancy as given in the simulator. The total buoyancy is the sum of these three parts.

### **Density**

---

In a fire/smoke simulation, the conservation process uses the density to determine how large the change in the velocity of each cell is going to be. If the **Uniform Density** option in the [Dynamics rollout](https://docs-chaos.atlassian.net/wiki/spaces/PHX4MAYA/pages/125735689) is disabled, Phoenix uses the temperature to determine the density; the higher the temperature, the lower the density is. Unlike the buoyancy, the density is not affected by the amount of smoke and fuel in the voxel.

### **Example: Uniform Density Parameter**

---

How does density affect the simulation from the non-physical point of view? In this example, we have two jets of gases: a cold one and a hot one. When directed into a collision course, the cold jet will prevail over the hot jet due to its higher density.


## **Adding Fine Details**

---

- Texture modulation - This is the common way used in the fluid systems to add fine details. In the [Fire](https://docs-chaos.atlassian.net/wiki/spaces/PHX4MAYA/pages/125996126), [Smoke Color](https://docs-chaos.atlassian.net/wiki/spaces/PHX4MAYA/pages/126060985) and [Smoke Opacity](https://docs-chaos.atlassian.net/wiki/spaces/PHX4MAYA/pages/125637963) rollouts is a parameter called **Modulate** near the texture slots for each render element. When enabled, the corresponding render element will be multiplied by the value of the texture map, except in the case when a texture is selected as the source channel.
- Displacement - This technique is more sophisticated than texture modulation and produces a significantly better result. The idea of displacement is similar to the usual geometry displacement, where the surface is displaced along its own normals at a distance determined by a texture map. The nearest point of the surface as specified by the Surface channel determines the direction for the displacement, using the following rule: all the points with a value above the given threshold will lie inside the surface, and all the points with a value below the threshold will lie outside the surface.

### **Surface Driven vs. Volumetric Displacement**

---

### **Example: Surface Driven vs Volumetric Displacement**

---

## **Fire Opacity Modes**

---

## **Foam and Splashes**

---

### > Macro (anchor)

**Rendering of Foam and Splashes**

---

### **Example: Rendering of Foam and Splashes**

---

## **Resimulation**

---


**Note:** Liquids do not currently support grid resimulation.

- Increase the resolution of an existing fire/smoke simulation, preserving its general flow.
- Add new channels/change source parameters of a fire/smoke simulation. Note that you may not get a physically accurate result. For example, with non-uniform conservation, the temperature affects the velocity.
- Increase/decrease the amount of drag particles, without doing a full simulation.
- Add foam and splashes, tweak parameters without fully simulating the liquid again.

## **Particle System Nodes**

---

### **Render Channels, Diagrams and Gradients**

---

- Determines which physical channel is used as the source.
- Samples the input data in the shaded point to determine the value of the source channel.
- Passes the value of the source channel through the palette to obtain the value of the render element.

### > Macro (anchor)

**Particle Export**

---

- Foam
- Splashes
- Mist
- Wetmap
- Drag

## **Notes**

---

- Phoenix usually registers itself as a global environment volumetric, where the global volumetric takes care to blend properly all Phoenix instances in the scene (simulators and foam/splashes). The exception is when **Render Mode** is set to **Volumetric Geometry** in the [Rendering rollout](https://docs-chaos.atlassian.net/wiki/spaces/PHX4MAYA/pages/126255727). For overlapping with other volumetrics, **Volumetric Geometry** mode is recommended.