---
title: "How Does Phoenix's Simulation Work?"
canonical: "https://documentation.chaos.com/space/PHX4MAX/125310793/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 and 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**

---

# **How to Set up a Simple Simulation**

---

- Create a **simulator**.
- Create a geometry object and place it inside the simulator.
- Create a **source** helper.
- Select the geometry in the object list of the source helper.

# **Simulation**

---

- Speed
- Fuel
- Smoke
- RGB
- Wavelet
- Particle ID
- Particle Age
- Particle Size** **

# > Macro (anchor)

**The Simulation Workflow**

---

- Interact with external objects.
- Move the fluid with respect to the velocity (Advection).
- Change the velocity due to the internal collisions in the fluid (Conservation). Conservation is the same process which makes the liquid in a syringe's needle to move forward when the plunger is pressed.

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

## > Macro (anchor)

**Burning Simulation**

---

## > Macro (anchor)

 **Vorticity Confinement**

---

## > Macro (anchor)

 **Interaction with External Objects**

---

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

### > 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)

 **Forces**

---

- If the force is a Gravity force, 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 force is not Gravity, the fluid is accelerated toward the force. The magnitude of the acceleration is determined by the magnitude of the force.

**Note**: Max forces are slower than the included standard gravity and turbulence. Only some of the forces can work in multi-threaded mode.


# **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.

# **Rendering**

---

## **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.

## **Smoke Opacity vs. Fully Visible Shading**

---

## > Macro (anchor)

 **The Surface Channel**

---

## > Macro (anchor)

 **Geometry Mode**

---

### **Volumetric Geometry Mode**

---

### **Volumetric Heat Haze Mode**

---

### > Macro (anchor)

** Mesh Mode**

---

## **Adding Fine Details**

---

### **Texture Modulation**

---

### > Macro (anchor)

 **Displacement**

---

---

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

---

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

---

# **Foam and Splashes**

---

## > Macro (anchor)

 **Particles of the Phoenix Simulator**

---

- Foam
- Splashes
- Mist
- Drag

## > Macro (anchor)

 **Rendering of Foam and Splashes**

---

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

---