Fluid Dynamics Plane

Hydrodynamics within AnimatLab can simulate buoyancy and drag. In order to use hydrodynamics you must first add one or more fluid planes. If you would like to have layers of fluids with different densities then you can do this by adding multiple fluid planes on top of each other and setting each ones fluid density to the desired value. When you add a fluid you can set its height and density. The density you specify for the plane is the fluid density that is used at the specified height and down till it hits a new fluid plane. So you can have one regular ground plane at a height of 0, a fluid plane with a density of 1 g/cm3 at a height of 1 meters, and a second fluid plane with a density of 1.5 g/cm3 above that at a height of 2 m. When an object is within that area of that fluid plane then all hydrodynamic calculations use the fluid density of the layer it is within.

When a fluid plane is first added to the simulation it sets the "Simulate Hydrodynamics" property of the environment to be true to turn on hydrodynamics calculations. You can set this back to false to turn off hydrodynamics. The buoyancy of a rigid body is determined by its density relative to the density of the fluid it is contained in. The drag force exerted on a body is determined by the equation F_D\, =\, \tfrac12\, \rho\, v^2\, C_D\, A, where p is the fluid density, v is the velocity, Cd is the drag coefficient, and A is the area in the direction of movement. You can specify a drag coefficient for each axis of a part. You can also enable or disable hydrodynamics calculations for each part individually by setting the "Enable Fluids" property of a rigid body part. There are a few other parameters on the rigid body related to hydrodynamics, and they are outlined below.