Versions Compared

Key

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

...

Section
Column
width40%

A Phoenix Liquid Simulation with Active Bodies consists of the following elements:

  1. A Liquid Simulator – used for the simulation of water.
  2. One or more scene objects – converted to Active Bodies at simulation time.
  3. An Active Body Solver – specified under the Liquid rollout of the Simulator - used to simulate the Active Bodies and to set some global options for the Active Body simulation.
  4. An Active Body Interaction set and an Active Body Cloned Bodies set - automatically generated when creating an Active Body Solver node.
  5. A Center of Mass Gizmo – automatically generated for each object when included in the Active Body simulation through the Active Body Solver Interaction set.
Column
width60%

Image RemovedImage Added

...

 

 

Section
Column
width40%

To add an Active Body Solver, go to Phoenix FD Menu → Create → Active Body Solver.

Enable Use Active Bodies under the Liquid rollout of the Simulator, and hit the Set Selected Object as Active Body Solver with the Solver Node and the Simulator selected.

Finally, place the source geometry into the Interaction set of the Active Body Solver. Phoenix will automatically generate a Center of Mass Gizmo for each Active Body and parent it to its source geometry.

UI Text Box
typeinfo

The Active Body Solver is separated from the Phoenix Simulator to allow extra flexibility when setting up the simulation. Multiple Liquid Simulators can be set up to use the same Solver, or alternatively, you can switch between several Active Body Solvers with different settings and geometries with the same Simulator.

Column
width60%

Image RemovedImage Added

 

...

 

Section
Column
width40%

When you start the simulation, the Active Body Solver will create a duplicate of your object and keyframe its Position and Rotation for every single frame.

A couple of things to note here:

  1. The ship is sinking - this happens because its Density is too high. The Density of the Active Body can be tweaked from the original object's Phoenix Properties.
  2. The Center of Mass Gizmo is above the ship's deck, right at the base of the middle mast - the is causing the ship to tilt to the side. Instead of relying on the Active Body Solver to guess the correct position for the Center of Mass Gizmo, its position can be overridden from the Phoenix Properties of the original object and tweaked manually.
UI Text Box
typewarning

The original geometry's visibility will be set to Bounding Box, and the duplicate will be shown in the Viewport instead.

When tweaking the Phoenix Properties of an object, take extra care to select the original, source object, rather than the clone. Existing clones are deleted when a simulation is re-started, thus any changes made in the Phoenix Properties window of the clone are lost.

Column
width60%
Align
aligncenter
HTML
<iframe width="720" height="480" src="https://www.youtube.com/embed/OqYe24Yv3Dc?version=3&loop=1&playlist=OqYe24Yv3Dc" frameborder="0" allowfullscreen></iframe>

...

Section
Column
width40%

To tweak the Density of the Active Body, select the original geometry and open the Attribute Editor. Under the Shape node, open the Extra Phoenix FD Attributes rollout.

You can either manually type an exact value in the Object Density parameter, or choose one of the provided Density Presets.

UI Text Box
typeinfo

The Density of an object is its mass divided by its volume. Different materials have different densities, e.g. Wood is less dense than Water which allows it to float. Objects float above water because the upward force acting on them by the water (called Buoyancy) is stronger than the force of Gravity. How much an object sinks, and how far underwater it sinks before stabilizing depends on the object's density in relation to the density of the fluid it's floating over.

For example: the density of wood is 700kg/m3, or 70% of the density of water (1000 kg/m3). Therefore, assuming the object was a perfect sphere, 70% of it would sink below the surface, and 30% will stay above.

Column
width60%
Image Removed

Image Added

 

...

 

Section
Column
width40%

With a lower Density, the object does not now sink entirely underwater.

The erratic spinning of the ship is caused by the incorrectly placed Center of Mass Gizmo. Placing the Center of Mass somewhere close to the center of an object would make sense for a sphere but not for a ship which is usually bottom-heavy.

UI Text Box
typeinfo

The Active Body Solver will compute the Center of Mass of an object by looking at its volume. To simplify things, an assumption is made that all parts of the object have an equal weight.

In the case of a ship, however, this is not true. The masts and sails of a ship make up a large portion of its volume but contribute little to its total mass.

Column
width60%
Align
aligncenter
HTML
<iframe width="720" height="480" src="https://www.youtube.com/embed/lmg8Re80LK0?version=3&loop=1&playlist=lmg8Re80LK0" frameborder="0" allowfullscreen></iframe>

...

Section
Column
width40%

Select the Center Of Mass Gizmo parented under the original object and set its Translate XYZ to (0, 0, 0).

UI Text Box
typeinfo

The Center of Mass of a real object is a point in space where force can be applied to move the object in a straight line, without changing its orientation. For example: pushing a rectangular plank of wood floating over lake along its center of mass would move it in a straight line. However, pushing the plank along one of its corners would also cause it to tilt or rotate.

Column
width60%
Image Removed

Image Added

 

...

 

Section
Column
width40%

Under the Phoenix FD Extra Attributes of the original object, enable the Override Center of Mass toggle.

UI Text Box
typewarning

By default, this option is disabled. Running the simulation will reset the Center of Mass back to the center of the object.

Column
width60%
Image Removed

Image Added

 

...

 

Section
Column
width40%

Now that the Center of Mass is placed at the bottom, the ship is no longer capsizing.

It is clear, however, that the specified Density is too high, causing the ship to sink too far below the surface.

UI Text Box
typeinfo

There is no magic formula to determine what the density/mass of your Active Body should be. You can try looking up the real-world weight of an object similar to the one being simulated and use that as a starting point.

The behavior of Active Bodies is fairly consistent between low and high resolution simulations so setting things up at a low resolution, where the simulation is fast to compute, is preferable.

Column
width60%
Align
aligncenter
HTML
<iframe width="720" height="480" src="https://www.youtube.com/embed/7llwiAFoEb0?version=3&loop=1&playlist=7llwiAFoEb0" frameborder="0" allowfullscreen></iframe>

...

Section
Column
width40%

Select the original object and reduce the Density from the Phoenix Properties to make the ship lighter.

In this example, the Density is set to 250.

Column
width60%
Image Removed

Image Added

 

...

 

Section
Column
width40%

With a lower Density, the ship is no longer sinking.

Note that from the video to the right, it appears the ship is quite front-heavy. This is caused by the placement of the Center of Mass Gizmo. If required, you could take advantage of this behavior to simulate an unbalanced Active Body – to achieve this, you would place the Center of Mass Gizmo's to the side or exaggerate its front/back location.

In this case, the ship is in perfectly calm waters and should not be swinging so heavily up and down. Because it appears front-heavy, the Center of Mass should be pulled back.

Column
width60%
Align
aligncenter
HTML
<iframe width="720" height="480" src="https://www.youtube.com/embed/07rhoKGTXjQ?version=3&loop=1&playlist=07rhoKGTXjQ" frameborder="0" allowfullscreen></iframe>

...