Understanding how pyro works

Simulation fields ¶

Pyro is a purely volumetric fluid solver: the data that represents the state of a pyro fluid lives in various scalar and vector fields. The Smoke object takes care of creating these fields, and the node has extensive options for visualizing them during the simulation.

• The `vel` vector field contains the fluid’s instantaneous velocities. The smoke’s motion is governed by its velocity field.

• The `density` scalar field captures the amount of visible soot. Regions with high `density` will appear to have thicker smoke.

• The `temperature` scalar field captures the distribution of heat. Hotter gas tends to rise due to buoyancy. It is recommended that contents of this field remain normalized (that is, sourced values should be between `0` and some convenient upper bound, such as `1`). The physical meaning behind values in this field is controlled by Ambient Temp (K) and Reference Temp (K) parameters on the pyro solver.

These parameter values are in Kelvin. The conversion formulas between Kelvin and other common temperature units are provided in the table below.

 To Kelvin From Kelvin (`K`) Degrees Celsius (`C`) `C + 273.15` `K - 273.15` Degrees Fahrenheit (`F`) `(F - 32) * 5/9 + 273.15` `(K - 273.15) * 9/5 + 32`
• The `flame` scalar field stores the remaining lifetime of reactants. See the Flames page for a more detailed explanation of this field.

• The `divergence` scalar field captures the desired expansion and compression. See the Pressure Projection section below for more information.

• The `pressure` is an auxiliary scalar field containing the fluid’s internal pressure. It may be useful to visualize this field, but it’s otherwise not useful.

• The `collision` and `collisionvel` fields contain a mask signaling the presence of colliders and their velocities, respectively. The `collision` field is positive in the areas that are occupied by a collider and negative everywhere else. See the Colliders section below for more information about adding colliders to pyro simulations.

• The `active` mask field captures the active simulation region when the solver is set to operate in sparse mode. See the Sparse vs Dense help page for more information on sparse simulations.

Inside the Pyro Solver ¶

The pyro solver takes care of evolving the simulation fields mentioned above in a manner consistent with smoke. At each timestep, the following steps are performed by the solver:

1. `temperature` is diffused and cooled:

Diffusion represents the transfer of heat from hotter to colder areas, and cooling captures the radiative loss of heat.

2. `density`, `temperature`, `flame`, and `vel` are advected:

Advection refers to the transport of fluid quantities by the flow. This step is responsible for applying the motion to all relevant fields.

3. `flame` field is aged and its outputs generated:

The `flame` field stores the remaining lifetime of reactants. This step simulates their reaction. See the Flames help page for more information.

4. `density` is dissipated:

Dissipation reduces the smoke density over time, causing it to gradually disappear.

5. Sourcing is performed:

The solver’s Sourcing input should be used to add new quantities into the simulation (such as `density` or `temperature`).

6. The simulation container is resized:

Resizing must be done to ensure that the simulation domain is large enough to accommodate motion within the timestep, but also small enough to avoid unnecessary computations.

7. Force nodes are applied:

If there are any force nodes in the simulation network (such as gravity, wind, etc.), their effect is applied to the `vel` field.

8. Buoyancy is applied:

Hot gas is less dense and rises due to buoyancy. This effect is driven by `temperature` and added to `vel`.

9. Viscosity is incorporated into `vel`:

Viscosity refers to dynamic “thickness” of a fluid. More viscous fluids tends to exhibit less chaotic motion. For example, honey is more viscous than water.

10. Shape operators are applied:

The pyro solver includes several shape operators that affect the motion and emergent shape of the smoke: disturbance, shredding, and turbulence. See pyro workflow for information on how to control these forces.

11. Custom forces are applied:

Custom forces can be introduced by attaching nodes to the solver’s Forces input.

12. Pressure projection is performed:

Pressure projection is a key step in the simulation. It ensures that `vel` field at the end of the time step agrees with expansion and shrinking prescribed by goal divergence. See Pressure Projection for a deeper discussion of this step.

Colliders ¶

You can make the smoke or fire interact with other objects by adding them as colliders to the pyro simulation. The simplest way to do this is by using a Static Object (for colliders that don’t move or change shape) or a Deforming Object (for dynamic colliders). These are easily applied using the tools located on the Collisions shelf. These tools automate the tasks of collision detection and velocity sampling. For most scenarios, this method of setting up colliders is sufficient.

An alternate way to introduce colliders is by manually sourcing into `collision` and `collisionvel` simulation fields. This approach requires a little more effort, but offers greater control over collision velocities. You can use the Collide with Objects tool on the Populate Containers shelf to streamline this process. If you chose to go with this more manual approach, it is important to attach the volume source node to the solver’s Forces input.

The two described methods for adding colliders differ only in the way that the `collision` and `collisionvel` fields are built. Collision enforcement itself is done the same way in both cases. In particular, the pressure projection stage mediates the transfer of momentum between the gas and colliders. This is done by alternating collision enforcement and projection passes. The IOP Iterations parameter on the Advanced ▸ Collisions tab of the pyro solver controls the number of times this process is iterated. By default, this is only done once However, if your colliders are fast or you notice smoke tunneling through them, consider increasing the number of IOP Iterations.

Pressure projection ¶

Pressure projection is a critical stage in a fluid simulation. It is responsible for coupling the fluid with the colliders, for giving rise to vortices in incompressible flow, as well as causing the sudden and rapid expansion for an explosion.

The `divergence` field is considered when performing pressure projection. If nothing is adding to the `divergence` field in the simulation (that is, the `divergence` field remains constantly zero), then the flow will be incompressible or divergence-free. The result of making a simple velocity field divergence-free is given below. Initially, the field is zero everywhere except the circular region, where there are upward velocities. Pressure projection adds velocities around its sides to channel the flow back to the bottom of the circular region.

Intuitively, positive regions of the `divergence` field will correspond to expansion (outward-pointing velocity vectors), while negative areas will result in “shrinking” (inward-pointing velocity vectors). The diagrams below illustrate this explanation.

The left column shows the goal divergence field: red areas are positive, blue areas are negative, and green represents zero regions. Images in the right column contain the resulting vector field after pressure projection.

The Sparse Fireball shelf tool demonstrates the two recommended ways of interacting with the `divergence` field. First, there is direct sourcing into it, which is responsible for the powerful initial blast. To ensure that the rising fireball continues to expand, the `flame` field also contributes to `divergence`, since Add Expansion is enabled in the solver’s Flames tab. See the Flames help page for more details about the `flame` field.

Pyro

Legacy Pyro ¶

• Creates a clustered (partitioned) pyro simulation with multiple containers, using the selected point geometry as sources. This is useful for large or sparse sources, and for distributing simulations to a farm.