Buoyancy Torque Equations for Irregular Hulls

This article outlines the mathematical equations and numerical formulations used to calculate buoyancy torque for partially submerged, irregular 3D hulls in real-time nautical game development. It details the classical continuous hydrostatics based on Archimedes' principle, the transition to surface integral formulations via the divergence theorem, the classical metacentric height approximation, and the discretized numerical methods essential for game physics engines.


The Fundamental Buoyancy Torque Equation

Buoyancy torque \(\boldsymbol{\tau}_B\) represents the rotational moment exerted on a vessel by the displacement of fluid around its hull. In standard Newtonian mechanics, this torque is evaluated relative to the vessel's Center of Mass (\(\mathbf{r}_{\text{CoM}}\)):

\[\boldsymbol{\tau}_B = (\mathbf{r}_B - \mathbf{r}_{\text{CoM}}) \times \mathbf{F}_B\]

Where:

  • \(\mathbf{F}_B\) is the buoyant force vector.
  • \(\mathbf{r}_B\) is the Center of Buoyancy (the geometric centroid of the submerged volume).
  • \(\mathbf{r}_{\text{CoM}}\) is the center of mass of the rigid body.
  • \(\times\) denotes the vector cross product.

By Archimedes' principle, the buoyant force acts antiparallel to gravity:

\[\mathbf{F}_B = \rho g V_{\text{sub}} \hat{\mathbf{k}}\]

Where \(\rho\) is the fluid density, \(g\) is the acceleration due to gravity, \(V_{\text{sub}}\) is the total submerged volume, and \(\hat{\mathbf{k}}\) is the normalized upward unit vector perpendicular to the undisturbed water surface.


Volumetric Integration for Irregular Geometries

For irregular 3D hull shapes, \(V_{\text{sub}}\) and \(\mathbf{r}_B\) are dynamic quantities that change continuously as the ship translates and rotates. They are defined analytically by volume integrals over the submerged domain \(\Omega_{\text{sub}}\):

\[V_{\text{sub}} = \iiint_{\Omega_{\text{sub}}} dV\]

\[\mathbf{r}_B = \frac{1}{V_{\text{sub}}} \iiint_{\Omega_{\text{sub}}} \mathbf{r} \, dV\]

Because evaluating 3D spatial grids dynamically is computationally prohibitive in game engines, these volume integrals are converted to surface integrals across the submerged boundary surface \(\partial \Omega_{\text{sub}}\) using the Divergence Theorem (\(\iiint_\Omega \nabla \cdot \mathbf{F} \, dV = \iint_{\partial\Omega} \mathbf{F} \cdot \hat{\mathbf{n}} \, dA\)):

\[V_{\text{sub}} = \frac{1}{3} \iint_{\partial \Omega_{\text{sub}}} (\mathbf{r} \cdot \hat{\mathbf{n}}) \, dA\]

\[\mathbf{r}_B = \frac{1}{2 V_{\text{sub}}} \iint_{\partial \Omega_{\text{sub}}} \mathbf{r} (\mathbf{r} \cdot \hat{\mathbf{n}}) \, dA\]

Where \(\hat{\mathbf{n}}\) is the outward-pointing unit normal of the submerged surface elements, and \(dA\) is the differential surface area.


Direct Hydrostatic Pressure Surface Integration

An alternative formulation directly integrates hydrostatic pressure over the wetted hull mesh, bypassing the separate calculation of \(\mathbf{r}_B\). The hydrostatic pressure \(P\) at depth \(d(\mathbf{r})\) below the water surface is:

\[P(\mathbf{r}) = \rho g \max(0, z_{\text{water}} - z)\]

The differential force \(d\mathbf{F}\) exerted on an infinitesimal surface patch with area \(dA\) and inward normal \(-\hat{\mathbf{n}}\) is:

\[d\mathbf{F} = P(\mathbf{r}) (-\hat{\mathbf{n}}) \, dA\]

The net buoyancy torque relative to the center of mass becomes:

\[\boldsymbol{\tau}_B = \iint_{S_{\text{wetted}}} (\mathbf{r} - \mathbf{r}_{\text{CoM}}) \times \big(-\rho g \max(0, z_{\text{water}} - z) \hat{\mathbf{n}}\big) \, dA\]

This integral inherently accounts for the orientation and tilt of the hull without requiring explicit recalculation of a 3D centroid.


Metacentric Restoration for Small Tilt Angles

In simplified game physics where small angles of heel (roll) \(\theta\) are assumed, the restoring torque around the longitudinal axis is governed by the metacentric equation:

\[\tau_{\text{restore}} = -\Delta \cdot \overline{GM} \cdot \sin(\theta)\]

Where:

  • \(\Delta = \rho g V_{\text{sub}}\) is the displacement weight.
  • \(\overline{GM}\) is the transverse metacentric height.

The metacentric height is calculated using the vertical positions of the center of buoyancy (\(K B\)), the center of gravity (\(K G\)), and the metacentric radius (\(B M\)):

\[\overline{GM} = \overline{KB} + \overline{BM} - \overline{KG}\]

The metacentric radius depends directly on the second moment of area (transverse moment of inertia) \(I_T\) of the waterline plane cut by the hull:

\[\overline{BM} = \frac{I_T}{V_{\text{sub}}} = \frac{\iint_{A_{wp}} y^2 \, dA}{V_{\text{sub}}}\]

Where \(A_{wp}\) is the waterplane surface area and \(y\) is the transverse distance from the rotation axis. While computationally inexpensive, this linear formulation fails during steep waves, large capsizing angles, or for highly irregular geometries.


Discretization Methods in Game Engines

For arbitrary hull geometry subjected to dynamic waves, game engines solve these equations using two primary numerical approximations:

1. Discrete Triangle Clipping

The hull mesh is clipped against the water surface plane (or wave displacement field). For each submerged triangle \(i\) with area \(A_i\), centroid \(\mathbf{c}_i\), and inward normal \(\mathbf{n}_i\):

\[\mathbf{F}_i = \rho g \, \text{depth}(\mathbf{c}_i) A_i \mathbf{n}_i\]

\[\boldsymbol{\tau}_B = \sum_{i} (\mathbf{c}_i - \mathbf{r}_{\text{CoM}}) \times \mathbf{F}_i\]

2. Voxel or Point-Cloud Approximation

The hull is approximated by an array of discrete volume samples \(j\), each representing a volume \(V_j\) located at position \(\mathbf{r}_j\):

\[\mathbf{F}_B = \sum_{j} \rho g V_j \hat{\mathbf{k}} \quad \text{for all } z_j < z_{\text{water}}(\mathbf{r}_j)\]

\[\boldsymbol{\tau}_B = \sum_{j} (\mathbf{r}_j - \mathbf{r}_{\text{CoM}}) \times (\rho g V_j \hat{\mathbf{k}})\]

This discrete summation ensures stable real-time torque response on irregular, non-convex hulls across all tilt angles and wave configurations.