Basic Naiad Graphs
This webpage serves as a repository of very simple Naiad graphs to demonstrate the basics of fluid simulation, meshing/surfacing, particle and secondary simulation, using Naiad.
To download the Dambreak Graph, please click here.
Basic Graph 1: Dam-break

As the title implies, this is one of the simplest possible fluid simulation graphs possible. It is simply a dam-break (a solid slab of water, being pulled down by gravity and contained inside a large container).
The graph is to be read from left to right, and then downward, and it represents what "happens" in the simulation for each time-step (and frame):
- Make a Particle-Liquid body to represent the fluid (this Origin operator will only create the body on the first frame, after that the body is re-used each time-step/frame). I will use the term "fluid body" and "Particle-Liquid body" to refer to the same body.
- Emit (on frame 1) fluid particles into the fluid body. (The "frame==1" NEL expression in the Enabled parameter on the Liquid-Emit-Distance op is the reason why emission only happens on frame 1). The region of emission is defined by a rectangular distance-field generated from a volume, which in turn is generated from a Box-Mesh primitive. This is a good time to recall that a lot of 3D "regions" in Naiad need to be represented volumetrically, either in bodies or as fields. Typically the volumetric representation is a "distance field", as is the case here.
- Add acceleration due to gravity to the fluid body (using an Acceleration op).
- Feed the fluid container volume body into the main body pipeline. The fluid container volume is defined by another Box-Mesh primitive (upper right).
- Feed both fluid body and fluid container volume into the Dynamics op. This will cause them to interact (the fluid colliding with the container etc) and the fluid to compute a new velocity field arising from the fluid dynamics calculation for each time-step.
- Filter out all bodies except the Particle-Liquid (the fluid container volume is terminated here)
- Write bodies to disk (into an EMP file). The only body arriving to this terminal op is of course the Particle-Liquid, since the other body was just filtered out in the op above.
Using the Tile-Scope To Visualize the Fluid Body's Adaptive Domain (Tile-Layout)
In Naiad there is no single, large "fluid domain" or "fluid box". Instead, each body has its own local domain. These local body domains are called tile-layouts. The domain is divided into subdomains called "tiles", in which the cells (voxels) are stored.
A body's tile-layout is sparse (meaning it can be fragmented, irregular and contain large "holes"), adaptive (meaning it tries to fit the geometry of the body instead of simply covering the entire bounding box of the body), and dynamic (meaning it tracks the body's geometry over time - if the body changes shape, so will the tile-layout).
You can visualize the tile-layout of any body using the tile-scope in Naiad Studio. In this dam-break graph, there is a tile-scope connected to the EMP-Terminal op, so we can see the tile-layout of the fluid body at the end of each time-step or frame of the simulation. Simply turn it on by clicking on the little button to the right of the scope. Below we present a few screenshots of the tile-scope in action, revealing what the sparse, adaptive and dynamic tile-layout looks like for the fluid body in this simulation:

The dambreak is just beginning, the tile-layout (pictured in tanslucent green) is nearly rectangular. The yellow squares along the bottom shows us the world-space size of each cell (voxel) in the tiles. This is also a good way to get a visual read on the resolution of a body.

As the fluid pushes out from the wall, the tile-layout expands to cover the new space occupied by the fluid body.

After some splashing and sloshing, the fluid body's particles have become a bit fragmented and disconnected. The tile-layout has no problem with this - it too becomes suitably fragmented and disconnected.
To download the Dambreak Graph, please click here.
