You can guide a liquid simulation using a polygon mesh. This creates a detailed, high-resolution simulation that is restricted to the top surface layer to reduce memory and computation time. Guides provide an efficient method for simulating the behavior of oceans and other large bodies of liquids.
Creating a Mesh-Guided Simulation
You can use a deforming plane or other flat mesh to guide the surface of a liquid simulation, while restricting the simulation to one or more specific regions. This is useful for scenes such as a ship on an ocean, where a large expanse of water must be rendered even if splashes and other simulated effects only appear on a smaller area.
There are three elements involved in mesh-guided simulations:
- A guide mesh
- An emission region
- Any added colliders
Guide Mesh
The guide mesh defines the liquid surface by animating vertex positions in order to provide the velocity that guides the simulation. By deforming the mesh, you can control how the surface waves behave.
For best results, the velocity should have both horizontal and vertical components. In addition, the waves in the guide mesh should move in a manner that's not too different from real waves. If the waves are extremely fast, slow, or big, then the simulation may have artifacts or produce other unexpected results.
In a typical workflow, you might also use the mesh for rendering the non-simulated regions of the liquid surface, and then blend between the simulated and non-simulated renderings during compositing.
Emission Region
Emission regions define the volume in which liquid is emitted. Limiting the emission in this way saves memory and computation time.
As an alternative to using a separate mesh to define an emission region as illustrated, you can use the same meshes currently being used as colliders, and specify the thickness of an emission region around them.
The emission regions can be both animated and deforming. As the regions move, new particles are seeded in formerly empty areas, and particles outside the regions die after a set time interval. The emission regions should not extend horizontally beyond the guide meshes.
Collider
A collider, such as a boat or rocks, creates effects such as splashes, wakes, and bow waves.
Creating a Guided Simulation (Example)
- In the Create panel, choose Geometry > Fluids, then click the Liquid button and drag in the viewport. This adds a liquid simulation to the scene, but there are no particles yet as no emitters have been defined.
- Create a basic scene for the guide simulation with:
- A plane. In its Parameters rollout, enter 125 in the Length field, 125 in the Width field, 300 in the Length Segs field, and 300 in the Width Segs field.
- A teapot. In its Parameters rollout, enter 9 in the Radius field. Move the teapot within the plane as if floating in water.
- Add a Wave modifier to the plane. In its Parameters rollout, enter -2.5 in the Amplitude 1 field, 1.8 in the Amplitude 2 field, and 42.5 in the Wave Length field.
- Animate the phase of the wave to 0.6 at frame 100.
- Add a Noise modifier to the plane. In its Parameters rollout, enter 42 in the Scale field, select Fractal and then enter 5 in the Iterations field, and 13 in the Z Strength field. Enable Animate Noise and at frame 100, animate the Phase to 10.
- Add a Push modifier to the plane. In its Parameters rollout, enter -1.6 in the Push field.
- Add a second Noise modifier to the plane. In its Parameters rollout, enter 1.0 in the Scale field, select Fractal and then enter 6 in the Iterations field, and 0.33 in the Z Strength field. Enable Animate Noise and at frame 100, animate the Phase to 33.
- Animate the teapot moving across the surface of the plane.
- Select the Liquid object, and then in the Setup rollout, click the Simulation View button to open the Simulation View window.
- Under Liquid Attributes > Guide System > Add Guide Emitter, click Pick and select the teapot. Click Pick again to disable object selection.
- In the Add Guide Mesh area, click Pick and select the plane object. Click Pick again to disable object selection.
- Under Liquid Attributes > Colliders/Kill Planes > Add Colliders, click Pick and add the teapot as a collider. Click Pick again to disable object selection.
- In the Solver Parameters panel, under Guide System in the List view, click teapot001 (Guide emitter). Under Guide Emitter Parameters > Conversion, increase the Thickness to 30. This will increase the size of the emission mesh.
- Under Simulation Parameters > General Parameters > Scale, disable Use System Scale and set the Fluid Scale to 1.0 = 1 meter. If you want a more detailed simulation, decrease the base voxel size to 0.3.
- In the Management System area, click
to run the solver and simulate.
The simulation will display liquid and foam splashing across the teapot's surface as it moves through the waves.