Hydrostatics & Buoyancy | Fluid Mechanics with Python | Skill-Lync Resources

50% OFF - Ends Soon!

Lesson 3 of 13 30 min

Hydrostatics & Buoyancy

Dams hold back millions of tonnes of water. Ships carry enormous cargo without sinking. Submarines dive and surface on command. All of these rely on hydrostatics — the study of fluids at rest — and on buoyancy, the upward force that keeps things afloat.

In this lesson, we'll quantify the forces a static fluid exerts on surfaces and learn how to predict whether a floating body is stable.

Hydrostatic Pressure Variation

In a fluid at rest, pressure varies only with depth. The fundamental relation is:

Sponsored

Harshal got placed at Fiat Chrysler as Design Engineer

Watch his video testimonial on how the program helped him

See His Journey

$$\frac{dp}{dz} = -\rho g$$

For an incompressible fluid with the $z$-axis pointing up, integrating gives:

$$p = p_0 + \rho g h$$

Sponsored

April batch closing soon — only 42 seats remaining

Join 3,000+ engineers who got placed at top companies

Reserve Your Seat

Where $h$ is the depth below the reference point. Pressure is the same at all points on a horizontal plane within a connected fluid — the basis of manometry.

Manometry

A manometer measures pressure by balancing a column of liquid. Walking through the tube, pressure increases as we go down by $\rho g h$ and decreases as we go up. Setting the two ends equal lets us solve for an unknown pressure.

For a simple U-tube manometer connecting a pressurized gas to the atmosphere through a liquid of density $\rho_m$:

Sponsored

Gaurav Jadhav is now a CAE Engineer

Practical projects and mock interviews made the difference

See His Journey

$$p_{gas} = p_{atm} + \rho_m g \Delta h$$

Manometer Solver

import numpy as np

def manometer_pressure(p_atm, segments):
    """
    Walk through a manometer summing rho*g*h contributions.
    segments: list of (rho, dh) where dh > 0 means going DOWN
    (pressure increases) and dh < 0 means going UP.
    Returns pressure at the far end.
    """
    g = 9.81
    p = p_atm
    for rho, dh in segments:
        p += rho * g * dh
    return p

# Example: gas line -> down 0.0 in gas (negligible), then a
# mercury column. Reading the manometer from open (atmosphere)
# side back to the gas line.
p_atm = 101325.0
rho_hg = 13550.0   # mercury
rho_w = 998.0      # water

# Open end at atmosphere; mercury rises 0.25 m toward gas side,
# then 0.40 m of water down to the gas tap.
segments = [
    (rho_hg, -0.25),   # up through mercury (pressure drops)
    (rho_w,  +0.40),   # down through water (pressure rises)
]
p_gas = manometer_pressure(p_atm, segments)
print(f"Atmospheric pressure: {p_atm/1000:.2f} kPa")
print(f"Gas pressure: {p_gas/1000:.2f} kPa")
print(f"Gauge pressure: {(p_gas - p_atm)/1000:.2f} kPa")
Output:
Atmospheric pressure: 101.32 kPa
Gas pressure: 68.42 kPa
Gauge pressure: -32.91 kPa

The negative gauge pressure tells us the gas line is under partial vacuum — exactly the kind of result a manometer reveals.

🎯 3,000+ Engineers Placed
Sponsored
Harshal Sukenkar

Harshal

Fiat Chrysler

Abhishek

Abhishek

TATA ELXSI

Srinithin

Srinithin

Xitadel

Ranjith

Ranjith

Core Automotive

Gaurav Jadhav

Gaurav

Automotive Company

Bino K Biju

Bino

Design Firm

Aseem Shrivastava

Aseem

EV Company

Puneet

Puneet

Automotive Company

Vishal Kumar

Vishal

EV Startup

Hydrostatic Force on a Plane Surface

The resultant pressure force on a submerged plane surface of area $A$ acts at the centroid depth:

$$F_R = \rho g \bar{h} A = p_c A$$

Where $\bar{h}$ is the depth of the centroid. But the force does not act at the centroid — because pressure increases with depth, the resultant acts lower, at the center of pressure:

$$y_{cp} = \bar{y} + \frac{I_{xx}}{\bar{y} A}$$

Where $\bar{y}$ is the centroid distance along the surface from the free surface (measured along the plane), and $I_{xx}$ is the second moment of area about the centroidal axis. For a rectangle of width $b$ and height $L$, $I_{xx} = bL^3/12$.

Force and Center of Pressure on a Submerged Gate

import numpy as np

# Vertical rectangular gate, top edge at the water surface.
rho = 998.0
g = 9.81
b = 3.0      # gate width (m)
L = 4.0      # gate height (m)

A = b * L
y_bar = L / 2.0              # centroid depth (vertical gate, top at surface)
h_bar = y_bar               # depth of centroid

# Resultant force
F_R = rho * g * h_bar * A
print(f"Gate area: {A:.1f} m^2")
print(f"Centroid depth: {h_bar:.2f} m")
print(f"Resultant force: {F_R/1000:.2f} kN")

# Center of pressure
I_xx = b * L**3 / 12.0
y_cp = y_bar + I_xx / (y_bar * A)
print(f"Second moment I_xx: {I_xx:.3f} m^4")
print(f"Center of pressure depth: {y_cp:.3f} m")
print(f"(Acts {y_cp - y_bar:.3f} m below the centroid)")
Output:
Gate area: 12.0 m^2
Centroid depth: 2.00 m
Resultant force: 235.13 kN
Second moment I_xx: 16.000 m^4
Center of pressure depth: 2.667 m
(Acts 0.667 m below the centroid)

For a gate with its top at the surface, the center of pressure sits at $2L/3$ from the top — a classic result, here $2.667$ m.

Hydrostatic Force on a Curved Surface

For curved surfaces, it is easiest to resolve the force into components:

  • Horizontal component $F_H$ equals the force on the vertical projection of the surface.
  • Vertical component $F_V$ equals the weight of the fluid (real or virtual) directly above the surface.

The resultant is $F_R = \sqrt{F_H^2 + F_V^2}$.

import numpy as np

# Quarter-circle gate of radius R and width b, water on the
# concave side, top of gate at the free surface.
rho = 998.0
g = 9.81
R = 2.0      # radius (m)
b = 5.0      # width into page (m)

# Horizontal force = force on vertical projection (a rectangle R x b)
h_bar_proj = R / 2.0
F_H = rho * g * h_bar_proj * (R * b)

# Vertical force = weight of water above the curved surface
# Volume above quarter circle = (R^2 - pi R^2/4) * b for this geometry
V = (R**2 - np.pi * R**2 / 4.0) * b
F_V = rho * g * V

F_R = np.hypot(F_H, F_V)
angle = np.degrees(np.arctan2(F_V, F_H))

print(f"Horizontal force F_H: {F_H/1000:.2f} kN")
print(f"Vertical force F_V:   {F_V/1000:.2f} kN")
print(f"Resultant force F_R:  {F_R/1000:.2f} kN at {angle:.1f} deg")
Output:
Horizontal force F_H: 98.10 kN
Vertical force F_V:   42.10 kN
Resultant force F_R:  106.75 kN at 23.2 deg

Archimedes' Principle and Buoyancy

Archimedes' principle states that the buoyant force on a submerged or floating body equals the weight of the fluid it displaces:

$$F_B = \rho_{fluid} g V_{disp}$$

A body floats when $F_B$ equals its weight, which means it sinks until it displaces its own weight of fluid.

import numpy as np

# Will a steel ball float? A wooden block? Compare weight vs buoyancy.
rho_water = 998.0
g = 9.81

def floats(rho_body, V):
    weight = rho_body * g * V
    F_B_full = rho_water * g * V    # if fully submerged
    return F_B_full >= weight, weight, F_B_full

for name, rho_body in [("Pine wood", 500), ("Ice", 917), ("Steel", 7850)]:
    V = 0.01  # 0.01 m^3 body
    can_float, W, FB = floats(rho_body, V)
    status = "FLOATS" if can_float else "SINKS"
    # submerged fraction for floating bodies
    frac = rho_body / rho_water
    print(f"{name:10s}: weight {W:6.1f} N, max buoyancy {FB:6.1f} N -> "
          f"{status} (submerged frac {min(frac,1.0):.2f})")
Output:
Pine wood : weight  49.0 N, max buoyancy  98.0 N -> FLOATS (submerged frac 0.50)
Ice       : weight  90.0 N, max buoyancy  98.0 N -> FLOATS (submerged frac 0.92)
Steel     : weight 770.2 N, max buoyancy  98.0 N -> SINKS (submerged frac 1.00)

Ice floats with about 92% submerged — which is why only the "tip of the iceberg" shows above water.

Stability of Floating Bodies: Metacentric Height

A floating body is stable if, when tilted slightly, it returns upright. Stability is governed by the metacentric height $GM$:

$$GM = \frac{I_{wp}}{V_{disp}} - BG$$

Where $I_{wp}$ is the second moment of the waterplane area, $V_{disp}$ is the displaced volume, and $BG$ is the distance from the center of buoyancy $B$ to the center of gravity $G$. If $GM > 0$, the body is stable; if $GM < 0$, it capsizes.

Metacentric Height Calculation

import numpy as np

# Rectangular barge: length L, beam (width) W, draft d.
rho_water = 1025.0   # seawater
g = 9.81

L = 20.0     # length (m)
W = 6.0      # beam (m)
d = 1.5      # draft, depth submerged (m)
KG = 2.0     # height of center of gravity above keel (m)

V_disp = L * W * d                  # displaced volume
I_wp = L * W**3 / 12.0              # waterplane second moment (about long axis)

KB = d / 2.0                        # center of buoyancy above keel
BM = I_wp / V_disp                  # metacentric radius
KM = KB + BM                        # metacenter above keel
GM = KM - KG                        # metacentric height

print(f"Displaced volume: {V_disp:.1f} m^3 ({rho_water*V_disp/1000:.1f} tonnes)")
print(f"KB = {KB:.3f} m, BM = {BM:.3f} m, KM = {KM:.3f} m")
print(f"Metacentric height GM = {GM:.3f} m")
print("STABLE" if GM > 0 else "UNSTABLE - will capsize")
Output:
Displaced volume: 180.0 m^3 (184.5 tonnes)
KB = 0.750 m, BM = 2.000 m, KM = 2.750 m
Metacentric height GM = 0.750 m
STABLE

A positive $GM$ of 0.75 m means the barge is stable. Raising the cargo (increasing $KG$) reduces $GM$ — load a ship too high and it can capsize.

Common Pitfalls

  • Putting the resultant force at the centroid. The force acts at the center of pressure, which is always below the centroid for a submerged surface.
  • Sign errors in manometers. Going down increases pressure; going up decreases it. Be consistent about direction.
  • Using the wrong area moment. $y_{cp}$ uses the centroidal $I_{xx}$, and $GM$ uses the waterplane $I_{wp}$ — they are different geometries.
  • Forgetting fluid density changes. Seawater ($\rho \approx 1025$) gives more buoyancy and force than fresh water ($\rho \approx 998$).

Key Takeaways

  • Hydrostatic pressure varies as $p = p_0 + \rho g h$; horizontal planes are isobars.
  • Resultant force on a plane surface is $F_R = \rho g \bar{h} A$, acting at $y_{cp} = \bar{y} + I_{xx}/(\bar{y}A)$.
  • Curved-surface forces resolve into horizontal (vertical projection) and vertical (weight of fluid above) components.
  • Archimedes' principle: buoyant force equals the weight of displaced fluid.
  • Floating-body stability requires metacentric height $GM > 0$.

In the next lesson, we'll set fluids in motion and derive the continuity and Bernoulli equations.

3,000+ Engineers Placed in Top Companies
Career Growth

3,000+ Engineers Placed in Top Companies

Join the ranks of successful engineers at Bosch, Tata, L&T, and 500+ hiring partners.