Skip to content

Dynamics of Fluid Forces ​

This page writes out the forces that fluids put on a body and the motion they produce. How to add water, air and waves to a world is described in Fluids.

The page follows the notation of Conventions and Notations. In addition:

  • v and ω are the velocity of a body's center of mass and its angular velocity; together they form its twist ν=(v,ω).
  • vf is the velocity of the fluid: the current of a volume or the wind, plus the motion of its waves.
  • νr=(v−vf,ω) is the twist of the body relative to the fluid.
  • ρ and μ are the density and the dynamic viscosity of a fluid. Where a liquid and the ambient fluid both touch a body, ρℓ and ρa tell them apart.
  • g is the gravity of the world and g=|g|.

Equation of motion ​

Fluids act on every dynamic body through its collision shapes. Each shape adds its share, and the shares of all shapes of a body add up. With ν˙=(v˙,ω˙) the accelerations in the world frame, a rigid body moves as

(MB+MA)ν˙+CB(ν)ν=fg+fb+fa+fd+fμ+fM+fe+fr+fK+fc.
  • MB is the rigid body's spatial inertia, in the world frame about its center of mass, and CB(ν)ν=(0,ω×Iω) its gyroscopic term.
  • MA is the added mass: the fluid that moves with the body. fK is the force that this fluid puts on the body as the body turns (Kirchhoff's equations; see Added mass).
  • On the right are gravity fg, buoyancy fb, the push of an accelerating liquid fa, pressure drag and lift with skin friction fd, viscous drag fμ, Magnus lift fM, water entry fe and wave radiation fr. fc are contacts, joints and every other force.

Every wrench here is a force and a moment about the center of mass. A force f at a point r from the center of mass adds the moment r×f.

Which fluid touches a shape ​

A collision shape belongs to the first volume of liquid in which:

  • its centroid lies within the volume's horizontal bounds and above its bottom;
  • the shape reaches below the volume's surface.

The surface cuts the shape into two parts:

  • the part below it lies in the liquid, with volume Vs and centroid cs;
  • the rest lies in the ambient fluid, with volume V−Vs, where V is the volume of the shape.

A shape that belongs to no volume lies wholly in the ambient fluid. Each part feels the fluid it lies in, with that fluid's density, viscosity and velocity.

The surface ​

A shape sees the surface as one plane, through a point at height ηs with the upward normal ns:

  • A volume without waves or a sampler has a still, horizontal surface at its surfaceHeightz¯.
  • A sampler gives the plane through its sample at the shape's centroid, tilted by its normal.
  • Waves give the plane of the waves averaged over the shape's extent (below).

The cut of the shape by this plane is exact for every shape:

  • a sphere's cap and its waterplane, a disc, in closed form;
  • a box or a mesh by cutting its faces;
  • a cylinder or a capsule by integrating the circular segments under the plane, and the chords of its waterplane, along its axis.

Waves ​

Each wave j of a volume is a linear wave on deep water. It travels along the horizontal unit vector dj with wavenumber kj=2π/λj, amplitude aj, phase φj and frequency Ωj=gkj. The surface over the horizontal point x at the world time t is

η(x,t)=z¯+∑jajcos⁡θj,θj=kjdj⋅x−Ωjt+φj.

Under the surface, at the height z, the liquid moves with the velocity of the current plus

vw=∑jajΩjekjz′[cos⁡θjdjsin⁡θj],z′=min(z−z¯, η−z¯).

The motion decays with the depth below the mean level z¯. Above the mean level, up to the surface, it keeps growing as the same exponential. For waves low against their length, each parcel of liquid turns on a circle of radius ajekjz′: forward under a crest, back under a trough.

The acceleration of the liquid is that of a parcel as it moves, not of the flow at a fixed point:

aw=∂vf∂t+(∇vf)vf,

with vf the whole velocity of the liquid, current included. The second term carries the change of the flow along the path of the parcel. With it, a particle as dense as the liquid moves with the liquid. Over many waves it keeps its depth and drifts forward with the Stokes drift of low waves, ∑jaj2Ωjkje2kjz′.

The plane over a body on waves ​

A body on waves sees them averaged over its extent. Let Σ be the horizontal second moments of its volume about its centroid, per unit volume: 13diag(hx2,hy2) for a level box of half sizes hx,hy, r24I for an upright cylinder, and r25I for a sphere. Each wave j reaches the plane with its height and its slope weakened by how far the body extends along it:

ηs=z¯+∑jaje−σjcos⁡θc,j,G=−∑jajkje−0.6σjsin⁡θc,jdj,σj=12kj2djTΣdj.

Here θc,j is the phase of the wave at the body's centroid. The plane passes through ηs over the centroid with the horizontal slope G, and ns∝(−G,1).

The weights are those of a least-squares fit of the surface over the body. The height comes from a Gaussian of covariance Σ, and to second order in the body's size against the wave it is the mean of the surface over the body. The slope comes from a Gaussian of 0.6Σ, which gives, to the same order, the least-squares slope over a body uniform along the wave, such as a box seen along a side. A disc would take 2/3, so for other shapes the slope is a close calibration rather than exact.

  • Wall-sided bodies. A box or an upright cylinder displaces the liquid over its bottom, and its buoyancy and its pitch and roll moments follow the true surface closely. In RaiSim's tests, a 2 m box on a 4 m wave of amplitude 0.06 m is within 0.14 % of the buoyancy of the water over its bottom and 0.13 % of its moment, where the tangent plane misses by 3 % and 18 %. With the crest over its middle and the wave along its length, a box of the same length misses by 0.7 %.
  • Small bodies. A body small against the waves sees the plane tangent to them, σj→0.
  • Smooth and symmetric. The plane changes smoothly as a body turns. It is the same for a sphere in any orientation, and for a cylinder or a capsule spun about its axis.

A raft half a wave long tilted from a trough to a crest, with a row of crates in front riding the wave at different heights

A raft half a wave long on an 8 m wave, at the moment its middle sits on a node: one end lies in the trough and the other on the crest, and the raft tilts along the wave. The crates in front, small against the wave, ride the surface at its own height and slope.

The velocity vf and acceleration aw of the liquid are taken at the centroid of the shape. For the velocity of a sphere wholly below the surface this is exact, since the mean of a potential flow over a sphere is its value at the center. The acceleration's part (∇vf)vf, and longer bodies, are approximations.

Buoyancy ​

Each fluid pushes the part of the shape in it up with the weight of the fluid that part displaces. The force acts at the centroid of that part:

fb=−ρℓVsg at cs−ρa(V−Vs)g at the centroid of the rest.

Since it acts at the centroid of the displaced volume, the restoring moment of a floating body is that of hydrostatics. A body floats upright where its metacenter lies above its center of mass. A body whose density lies between the ambient fluid's and the liquid's floats at the depth where fb balances its weight.

Bodies at rest in a pool: a half-dense cube with an edge up, an ice block mostly under water, a plank, a log and a light ball riding high

The bodies of the fluid pool example at rest. Each floats at the depth where it displaces its own weight: the light ball rides high, and the ice block, at 92 % of the water's density, floats almost wholly under. The half-dense cube turns an edge up: on a face, its metacenter lies below its center of mass.

Accelerating liquid ​

Liquid that accelerates pushes a body as it would push the liquid the body displaces. It also carries the body's added mass along. This is the inertia force of Morison's equation, and the dynamic part of the Froude–Krylov force of the waves:

fa=ρℓVs[awcs×aw]+MA,ℓ[aw0],

where MA,ℓ is the part of the added mass in the liquid. A sampler may give an acceleration as well. A liquid at rest or with a steady current gives none.

Drag and lift ​

The surface of each shape is made of faces. A face i has the area Ai, the outward normal ni and the centroid ri, and it moves through the fluid with

wi=v+ω×ri−vf.

A face that meets the flow, wi⋅ni>0, feels a pressure along its normal. Every face is rubbed along its plane by skin friction:

fd,i=−12ρAi(κiCD|wi|max(0,wi⋅ni)ni+Cf|wt,i|wt,i),wt,i=wi−(wi⋅ni)ni.
  • CD is the shape's drag coefficient (FluidCoefficients::drag, or its own; see Fluids) and Cf the skin friction coefficient.
  • The factor κi makes the pressure over the whole shape add up to the textbook drag 12ρCDAp|w|w on the area Ap the shape shows to the flow. It is 32 on a sphere and on the ends of a capsule, 4π on the side of a cylinder or capsule, and 1 on flat faces.

A face of a shape cut by the surface is cut too:

  • the part below the surface feels the liquid;
  • the part above feels the ambient fluid.

Summing over faces gives the moments as well, so:

  • a plate at an angle of attack α feels lift CDsin⁡αcos⁡α and drag CDsin2⁡α;
  • a link that swings is braked more at its tip;
  • a body that turns meets the flow faster on its outer faces.

A sphere feels the face pressure integrated exactly over the part of it in each fluid, with w the velocity of its center relative to that fluid. Wholly in one fluid, its drag is −12ρπr2CD|w|w. Cut by the surface, the liquid pushes on the wet cap only, so a sphere half under water that moves sideways is pushed back and lifted. The force changes smoothly as the sphere sinks in, and it does not depend on how the sphere is turned. Its spin feels skin friction, −3π28ρCfr5|ω|ω in each fluid, in proportion to the area that fluid wets.

Viscous drag ​

The viscosity drags each part of a shape like the sphere of the same volume, of diameter d (Stokes):

fμ=−VmV[3πμdwcm×3πμdw+πμd3ω],

with Vm and cm the volume and centroid of the part in that fluid, and w its velocity relative to the fluid at cm. It dominates at low Reynolds number.

A sphere's drag coefficient follows its Reynolds number Re=ρ|w|d/μ, with w the velocity of the shape's centroid relative to the fluid, by Brown and Lawler's correlation (a fluid without viscosity takes 0.47, and a drag coefficient of 0 or more replaces it):

CD(Re)=24Re(1+0.15Re0.681)+0.4071+8710/Re.

The face pressure carries all of it but the Stokes part 24/Re, which is fμ. A grain therefore settles at Stokes' speed, and a ball sinks at the speed the correlation gives.

Magnus lift ​

A sphere that spins, and a cylinder or capsule that spins about its axis, is lifted across the flow:

fM=CMρVmωs×w,

at cm, with ωs the spin (the whole ω of a sphere, its axial part for a cylinder or capsule) and CM the magnusLift coefficient.

Added mass ​

A body that accelerates also accelerates the fluid around it. The fluid that moves with it is the added mass, a symmetric 6×6 inertia about the center of mass:

MA=cA(ρℓVsV+ρaV−VsV)XTM^AX.
  • M^A is the shape's added mass per unit density about its centroid, in its principal axes. It comes from Lamb's coefficients for ellipsoids and DNV-RP-C205 for boxes, plates and cylinders (see Fluids).
  • X moves it to the body's center of mass and frame.
  • cA is the addedMass coefficient.

Inertia. MA joins the rigid inertia on the left of the equation of motion. Contacts, joints and tendons act on a body as heavy as MB+MA. A ping-pong ball under water starts up at ρV−mm+12ρVg, not ρV−mmg.

Turning. The fluid carried along has the momentum (p,h)=MAνr, and it pushes the body as the body turns (Kirchhoff). In the world frame,

fK=MA[ω×(v−vf)0]−[ω×pω×h+(v−vf)×p].

The second term is Kirchhoff's, the one the body frame would show. The first appears because ν˙ are world-frame accelerations: the added mass resists the acceleration of the body's frame, not of the world's. For a sphere, whose added mass is the same in every direction, the two cancel. Here vf is the velocity of the fluids around the body, each weighted by the added mass it carries.

The term (v−vf)×p is the Munk moment, which turns a long body toward broadside to its motion through the fluid. A body wholly in one still, inviscid fluid, with no other force on it, keeps its kinetic energy 12νT(MB+MA)ν.

A floating log shoved along at an angle to its axis, yawing and curving as it glides, from faint to solid

A floating log shoved at 2.5 m/s at 34° to its axis, shown every 0.16 s. The water it carries yaws it, and the drag slows it and bends its path, so it swings round as it glides.

Water entry ​

As a body sinks into the liquid, its added mass in the liquid grows, and the body hands its momentum to the liquid it sets moving (von Kármán). While its waterplane of area Awp sinks at the speed s˙=−w⋅ns>0, with w the velocity of the waterplane's centroid relative to the liquid, the submerged volume grows at V˙s=Awps˙. A body rising out of the liquid feels no such force. The added mass in the liquid grows as fast as that in the ambient fluid shrinks, and the body trades momentum with both:

fe=−cAV˙sVXTM^AX(ρℓνr,ℓ−ρaνr,a),

with νr,ℓ and νr,a the body's twist relative to the liquid and to the ambient fluid.

It is quadratic in the sinking speed. A flat plate that falls flat onto the water slows at once to mv0/(m+mA), where mA is its added mass in the water.

A plate and a ball of the same density falling into a pool, shown every 50 ms from faint to solid

A plate and a ball, both of 0.3 times the water's density, let go 1 m over a pool and shown every 50 ms. The plate meets the water with its whole face. The water it sets moving as it sinks in is many times its own mass (26 times once wholly under), so it stops on the surface at once, from 4.2 m/s to 0.3 m/s within 50 ms. The ball's added mass is under twice its own and grows gradually as it sinks in: it plunges and bobs back up.

Wave radiation ​

A body that heaves through the surface makes waves, which carry its energy away. At the waterplane centroid, along ns, it feels

fr=−b(w⋅ns)ns,b=bsbwbs+bw,bs=ρωh3Awp22g,bw=ρgAwp2ωh,

with w the velocity of the waterplane centroid relative to the liquid and ρ=ρℓ.

  • ωh=(ρℓ−ρa)gAwp/(ρℓVs+mA,h) estimates the body's natural heave frequency from the liquid it displaces and its added mass in heave mA,h.
  • bs is Haskind's damping of a body small against the waves it makes, and bw caps it for a wide body.
  • The volume's waveRadiation scales b.

A time step ​

During a step from t to t+Δt:

  • The added mass is part of the body's inertia for the whole step, so contacts, joints and tendons see it.
  • Drag acts at the end of the step. Drag, skin friction, viscous drag, wave radiation and water entry act as f(νt+1)≈f(νt)−D(νt+1−νt). D is a symmetric, positive approximation of the forces' derivative: each face's pressure along its normal, a bound on skin friction, and the sphere's drag coefficient held for the step. Along the flow, a sphere's D is the derivative of its drag, twice the drag per unit speed as for any force quadratic in the speed, also where the surface cuts it. With the inertia and the motion of the sphere's center held over the step, this drag cannot add kinetic energy in still fluid, whatever the inertia. A body that turns within the step is not covered: with its added mass switched off, a 1 g body spinning at about 150 rad/s, whose sphere, 1 m across, displaces half a tonne of water, gains about 2.5×10−6 of its energy in a 1 ms step with the sphere cut by the surface, and 3.4×10−5 with it wholly under water. Water entry, quadratic in the sinking speed, adds its derivative along the waterplane's normal, at half weight for a body that moves by the mean of its old and new velocities. The step moves the body as if its inertia were MB+MA+ΔtD. A grain whose drag would stop it within a fraction of a step settles at its terminal speed without overshoot. A rod sliding along its length slows down without turning around.
  • Other fluid forces are taken at the state the step starts from.
  • Waves sampled at the step's center. Waves and their liquid are sampled where the step centers its forces. A body that moves by the mean of its old and new velocities (a free single body, or an articulated system integrating with TRAPEZOID) samples them half a step ahead in time, at its position half a step ahead, and lays that surface on the body where it is. A body that moves by its new velocity (SEMI_IMPLICIT, or a single body in contact or held by a tendon) samples them at the start. Particles carried by the waves therefore keep their orbits over many periods.
  • Turning and added mass in a free single body. It integrates its turning and the turning of its added mass by the midpoint rule, so wholly in one still, inviscid fluid and with no other force on it, it keeps its energy.

Object::getFluidForce() and Object::getFluidTorque() report, for the last step, fb+fa+fd+fμ+fM+fe+fr+fK at the state the step started from. They leave out the part of the added mass that resists the body's acceleration, −MAν˙, and the change the drag makes over the step as the velocity changes.

Articulated systems ​

Each link of an articulated system is a rigid body with its own fluid wrench fi, added mass MA,i and drag derivative Di. Let Ji be the Jacobian of the twist of link i at its center of mass. The fluids add the generalized force ∑iJiTfi, and the step moves the system with the mass matrix

M~=M+∑iJiT(MA,i+ΔtDi)Ji

besides its joint damping (see Dynamics and Control).

  • Di includes water entry as for a single body, by the integration scheme.
  • A floating base feels its fluid wrench like a single body.
  • A fixed base feels none.
  • A leg swinging through water is braked and loaded at every link. The joints and the contacts see the water the legs carry along.

A body at rest in a fluid ​

A body that floats or hovers comes to rest where the forces balance:

ρℓVs+ρa(V−Vs)=m,

with the centroid of the displaced fluid on the vertical through the center of mass.

A body without contacts whose fluids leave it out of balance by more than a thousandth of gravity never falls asleep. Neither does a body within the horizontal bounds of a volume with waves or a sampler, since the surface may move while it rests.

RaiSim — physics for robotics and AI.