54. Appendix 1

54.1. Added mass

When a body moves in a fluid (e.g. water), parts of the fluid has to move around the body. When the body accelerates, so must also the fluid. Therefore, the force required to give a body certain acceleration is larger than it would have to be in vacuum. AGX supports the notation of added mass. The added mass enters the equations of motion except for when calculating the gravitational force, i.e. the gravitational mass is unchanged. It is also used in the mass matrix when AGX solves for constraint forces. The added mass can be specified for each axis through the API calls:

rigidBody->getMassProperties()->setMassCoefficients( const Vec3& coefficients );
rigidBody->getMassProperties()->setInertiaTensorCoefficients( const Vec3& coefficients );

These coefficients will enter the velocity update equation in the \(C_A\) matrix. Given the 6x6 mass matrix \(M_0\) (linear mass and inertia) and the added mass coefficients \(C_A\), the velocity from the previous time step \(V_k\), the constraint Jacobian G and the Lagrange multipliers \(\lambda\), time step \(h\) and external forces (including gravity) \(f_e\) we write the velocity update as:

\(V_{k+1}=V_k+[(1+C_A ) M_0]^{-1} [G^T \lambda+hf_e ]\)

Gravity will be calculated with the original gravitational mass as: \(F_g = mg\), where \(m\) is the original mass.

Note that \(C_A\) matrix with the added mass coefficient is a scale of the linear mass \(M_0\).

54.2. Velocity damping

AGX has a damping term (angular and linear) one for each coordinate axis (in the body’s local coordinate system). It can be specified through the API as:

rigidBody->setLinearVelocityDamping( const Vec3f& damping );
rigidBody->setAngularVelocityDamping( const Vec3f& damping );

With this damping term D and the gravitational mass m, we will get a new mass matrix M’ such that:

\[\begin{split}M' = m \begin{bmatrix} (1 + D_xh) & & \\ & (1 + D_yh) & \\ & & (1 + D_zh) \end{bmatrix}\end{split}\]

Analogous for the moment of inertia tensor.

Now given this effective mass matrix M’ and the original mass matrix M we get the velocity integration equation:

\[V_{k+1} = M'^{-1} MV_k + M'^{-1} G^T \lambda+ M'^{-1} hf_e\]

This means that if damping > 0, the term \(M' M\) will be < 0 and the velocity will be damped with a viscous damping term. The effective mass (including damping) will enter the system of equation on the left side, illustrated in the simplified linearized stepping equation below:

\[\begin{split}\begin{bmatrix} M' & -G^T \\ G & \epsilon \end{bmatrix} \left[\begin{smallmatrix} V_{k+1} \\ \lambda \end{smallmatrix}\right] = \begin{bmatrix} -hf_e \\ g + G'v \end{bmatrix}\end{split}\]

For a more complete description see equation 4.31 in [2].