Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page contains information on how Phoenix simulations work internally. Steps for setting up a simulation can be found on the Getting Started with Chaos Phoenix page.

How does Phoenix's fluid solver work?

...

Phoenix's fluid simulation calculates how a fluid would evolve during a period of time. While you might be familiar with the term fluid as meaning "liquid", in physics the term fluid refers to both liquids and gases. When this documentation refers to a fluid, it means liquid or fire/smoke. The simulation runs in sequential steps, and at each step the fluid is calculated a little further in time ahead of the previous step. This way each new step depends on the previous step, and a new step cannot start before the last one has already finished. This is one of the biggest differences between distributed rendering and distributed simulations - e.g. if you want to simulate 100 frames, you can not run frames 1-50 on one machine and frames 51-100 on another machine simultaneously.

...

While the simulation runs, it's in the background, and the user interface of 3ds Max remains active. You can change many simulation parameters (except for a few initial core parameters) during the simulation and see how they affect it. Rendering is also enabled during simulation, so you don't have to wait until the end of the simulation to render images and see how the simulation looks and fits into the scene.

 

Particle vs. Grid-Based Simulation

...

There are two main approaches used in simulation systems:

...

A third hybrid method between particle and grid simulations are the FLIP simulations, which Phoenix uses for liquids. FLIP simulations take the best from both worlds and produce much realistic liquid effects quickly. FLIP liquid simulations were first added in Phoenix 3.0. Before that, liquid were simulated using the grid solver. In Phoenix 3, you can still open and simulate older scenes saved from Phoenix 2 using the old grid liquid solver. Note that Phoenix uses pure particle simulation for the secondary particle systems such as Foam, Splash, WetMap and Mist as these are simpler and don't suffer from issues that liquids in pure particle or grid simulations have, such as having to maintain volume and not collapse on themselves if put in a large container.

 

Fire/Smoke vs. Liquid Simulation

...

Simulations performed by Phoenix can be roughly divided into two major categories:

...

These categories are for convenience only, and are not rigid. Once you've created a few basic simulations and have become more familiar with Phoenix FD, you will have a better grasp of how the tools work, and when creating an effect that is not strictly fire or liquid you'll know how to represent it most efficiently. For example, sparks or thin smoke might seem to fall into the "fire" category, but in practice these effects might be better served by particles and thus could use some of the tools designed for liquids.

 

Simulation and Rendering

...

The results from Phoenix simulations are saved to cache files. After that, Phoenix can read this cache data for quick viewport preview, or for rendering. Fire/smoke simulations usually produce grid voxels and can additionally produce particles that accompany and enrich the fire/smoke effect. Liquid simulations mainly produce particles and Phoenix can also automatically convert them to voxels when saving cache files during simulation.

...

Rendering reads the data from the cache files and converts the physical data such as Smoke, Tеmperature, Velocity, etc. into render data such as color and opacity. Note that the render settings can not be kept into the data cache files because they are different for each different renderer.

 

Simulation Channel Setup

...

Each simulation requires a simulator node to be present. This box-shaped container represents the grid in the scene, and the simulation takes place inside it. This object's parameters hold all the information about the simulation such as cache content, shading, and physical position in addition to parameters needed to run the simulation such as the start frame and steps per frame.

...

An additional benefit of using channels is that you can perform a resimulation with all the channel data from the previously created simulation. 

 

 

Anchor
The Simulation Workflow
The Simulation Workflow
Activity During Simulation

...

Fancy Bullets
typecircle

 


Anchor
Burning
Burning
Burning

...

Fancy Bullets
typecircle
  • 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.
UI Text Box
typenote

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

 

Section
Column
width10%

 

Column
width40%

 

Uniform Density - On

 

Column
width40%

 

Uniform Density - Off 

Column
width10%

 

 

 

Adding Fine Details

...

There are two direct methods that can be used to add fine details in the shading. In order to enhance the realism of the movement of small details in the fluid, V-Ray comes with a Particle Texture called Particle Texture | PhoenixFDParticleTexture. When used in combination with a particle system driven by a Phoenix Simulator, the particle texture is capable of properly animating the small details along the fluid surface.

...

Displacement in Phoenix works by shifting the point of sampling with an offset, the direction of which is determined by the gradient of the effects channel while the distance is determined by the brightness of a given map. There are two different modes used to sample the aforementioned map, switched by a checkbox in the rendering rollout. If the checkbox is NOT checked, the map is sampled at the point of shading, and we call this "volumetric displacement". If the checkbox is checked, the coordinates are first projected over the surface as determined by the effects channel. The point of projection is then used as map coordinates. We call this "surface driven displacement." Surface driven displacement is slower and requires some initial calculations, but it keeps the topology of the iso-surfacesisosurfaces. Volumetric displacement is faster, but tends to produce island-like formations if the displacement value is too big. Beside performance, volumetric displacement has one more important advantage: it does not require the distinct surface of the effects channel. Therefore, it will work fine in scenes where surface-driven displacement produces flickering. 

 

Example: Surface Driven vs Volumetric Displacement

...

...

Section
Column
width10%

 

Column
width40%


Surface driven displacement

 

Column
width40%


Volumetric displacement.
Note the small islands floating above the original surface.

 

Column
width10%

 

...

 

 

Fire Opacity Modes

...

There is a well-defined connection between the transparency and the emissive light in the real world. As an example, for smoke (diffuse light), the connection is pretty clear and everyone has intuitive sense of how it works. For the emissive light, however, most of the people will give the wrong answer when asked, "Is a smokeless fire fully transparent?" The common, yet wrong, answer is, "Yes it is. If there is no smoke, the flame is fully transparent and will cast no shadows." However, the correct answer is "No, the fully transparent gases cannot emit any light, even if they are hot enough." This is why acetylene flame is less bright than a candle, despite its higher temperature. It just produces less smoke. However, this way of shading can seem strange and inconvenient, because there is no clearly separated control over the smoke and flame. Be careful when trying to achieve denser smoke, because the result can be an undesired brighter flame.

For this reason, Phoenix FD provides Phoenix provides different modes of shading: physical and detached. This is controlled by the Fire Opacity Mode parameter in the Fire rollout. In Fully Visible mode, the emissive part is fully independent of the transparency and you are not obligated to keep in mind the aforementioned connection. In Use Smoke Opacity mode, the smoke's alpha controls the Fire's opacity. There is also the Use Own Opacity mode where the fire has a separate opacity curve that can be adjusted independently from that of the smoke.

...

There are three different modes of shading for spherical particles - bubbles, cellular, and splashes. In each mode, a particle is represented as a sphere with a radius equal to its size and with certain optical properties. The "bubble" and "cellular" modes are intended for foam rendering and have the same optical properties of the surface. They differ in the geometry representation only - bubble mode uses simple spheres, whereas cellular mode builds polyhedron-like cells, similar to real foam. The cell walls are not flat, but slightly curved, which provides a more realistic appearance.

 

 

 

Example: Rendering of Foam and Splashes

 

 

...

Section
Column
width5%

 

Column
width30%


Bubble mode

 

Column
width30%


Cellular mode 

Column
width30%


Splashes mode

 

Column
width5%

 

 

Resimulation

...

There are several particle types that the PhoenixFD SimulatorPhoenix Simulator exports:

Fancy Bullets
typecircle
  • Foam
  • Splashes
  • Mist
  • Wetmap
  • Drag

...

Fancy Bullets
typecircle
  • 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. For overlapping with other volumetrics, Volumetric Geometry mode is recommended.

 

...