3  Hydrostatics

Hydrostatics is the branch of fluid mechanics that studies fluids at rest and the forces and pressures they exert on immersed or containing surfaces. Key principles include Pascal’s law (pressure applied to an enclosed fluid is transmitted undiminished in all directions), Archimedes’ principle (buoyant force on a submerged body equals the weight of displaced fluid), and the hydrostatic pressure distribution in a fluid column, expressed as \(p = \rho g h\), where \(p\) is gauge pressure, \(\rho\) is fluid density, \(g\) is gravitational acceleration, and \(h\) is depth below the free surface.

3.1 Pressure Head

In fluid mechanics, pressure head is the height of a fluid column that corresponds to a specific pressure at a given point, assuming the fluid is static. It’s expressed as \(h_p = \frac{p}{\rho g}\), where \(p\) is the pressure above atmospheric, \(\rho\) is the fluid density, and \(g\) is the acceleration due to gravity. The unit is typically meters (or feet) of the fluid column. Pressure head represents the potential energy per unit weight due to pressure and is a component of the total hydraulic head, which is the sum of pressure head and elevation head.

Figure 3.1: Barometer
Figure 3.2: U-tube manometer

3.2 Load On Immersed Surfaces

The load on an immersed surface is the total hydrostatic force exerted by a fluid on a surface submerged in a static fluid. This force arises from the pressure variation with depth, governed by the hydrostatic pressure equation \(p = \rho g h\), where \(\rho\) is fluid density, \(g\) is gravitational acceleration, and \(h\) is the depth below the free surface.

The pressure acts perpendicular to the surface, resulting in a distributed load. The total force \(F\) is calculated as \(F = \rho g A \bar{h}\), where \(A\) is the surface area and \(\bar{h}\) is the depth of the centroid of the area.

Example 3.1 A vertical rectangular bulkhead is 7 m wide and extends over the full height of the water column. Fresh water stands 6 m deep on one side and is assumed to be at zero level on the other side. Calculate the total hydrostatic load (thrust) on the bulkhead. Density of fresh water = 1000 kg/m³.

"""
Hydrostatic Load Calculator

Calculates the total hydrostatic force on a vertical rectangular bulkhead
submerged in water. The force acts at the centroid of the pressure
distribution.
"""

# ====================================
# INPUT PARAMETERS
# ====================================

bulkhead_width_m = 7.0  # Horizontal width of bulkhead in meters
water_depth_m = 6.0  # Depth of water on one side in meters
water_density_kg_per_m3 = 1000.0  # Density of fresh water (kg/m³)
gravitational_acceleration_m_per_s2 = 9.81  # Acceleration due to gravity

# ====================================
# CALCULATIONS
# ====================================

# Calculate submerged area of bulkhead
submerged_area_m2 = bulkhead_width_m * water_depth_m

# Calculate depth to centroid of pressure distribution
# (for rectangular area, centroid is at half the water depth)
centroid_depth_m = water_depth_m / 2

# Calculate total hydrostatic force using:
# F = ρ · g · h_c · A
# where ρ = water density, g = gravity, h_c = centroid depth, A = area
hydrostatic_force_n = (
    water_density_kg_per_m3
    * gravitational_acceleration_m_per_s2
    * centroid_depth_m
    * submerged_area_m2
)

# Convert force from Newtons to kilonewtons
hydrostatic_force_kn = hydrostatic_force_n / 1000

# Convert force from kilonewtons to meganewtons for additional output
hydrostatic_force_mn = hydrostatic_force_kn / 1000

# ====================================
# OUTPUT RESULTS
# ====================================

print("=== Hydrostatic Load on Bulkhead ===")
print(f"Bulkhead width         : {bulkhead_width_m} m")
print(f"Water depth            : {water_depth_m} m")
print(f"Submerged area         : {submerged_area_m2:.1f} m²")
print(f"Depth of centroid      : {centroid_depth_m} m")
print(
    f"Total water load       : {hydrostatic_force_kn:,.0f} kN  "
    f"({hydrostatic_force_mn:.3f} MN)"
)

Example 3.2 A 10-meter-long, 4-meter-wide, and 6-meter-high tank is filled with oil (specific gravity = 0.9). The oil rises 5 meters up a vent pipe above the tank’s top. Calculate the load on one end plate and the bottom of the tank.

"""
Oil Tank Hydrostatic Load Calculator

Calculates hydrostatic forces on the end plates and bottom plate of a
rectangular oil tank with a sounding pipe. The oil rises above the tank
top in the sounding pipe, increasing the pressure on all surfaces.
"""

# ==================================
# INPUT PARAMETERS
# ==================================

tank_length_m = 10.0  # Length of tank in meters
tank_width_m = 4.0  # Width of tank in meters
tank_height_m = 6.0  # Height of tank in meters
sounding_pipe_height_m = 5.0  # Oil rise above tank top in meters
oil_specific_gravity = 0.9  # Specific gravity of oil (unitless)
oil_density_kg_per_m3 = oil_specific_gravity * 1000  # Density in kg/m³
gravitational_acceleration_m_per_s2 = 9.81  # Acceleration due to gravity

# ==================================
# CALCULATED VALUES
# ==================================

# Total head from tank bottom to oil surface in sounding pipe
total_head_m = tank_height_m + sounding_pipe_height_m

# End plate dimensions (vertical wall at short end of tank)
end_plate_height_m = tank_height_m
end_plate_width_m = tank_width_m
end_plate_area_m2 = end_plate_height_m * end_plate_width_m

# Depth of centroid of end plate below oil surface
# (centroid is at mid-height of plate, plus sounding pipe height)
end_plate_centroid_depth_m = sounding_pipe_height_m + (tank_height_m / 2)

# Hydrostatic force on one end plate using F = ρ · g · h_c · A
force_end_plate_n = (
    oil_density_kg_per_m3
    * gravitational_acceleration_m_per_s2
    * end_plate_centroid_depth_m
    * end_plate_area_m2
)

# Bottom plate dimensions and force
bottom_plate_area_m2 = tank_length_m * tank_width_m

# Hydrostatic force on bottom plate using F = ρ · g · h · A
# (pressure at bottom is based on total head)
force_bottom_plate_n = (
    oil_density_kg_per_m3
    * gravitational_acceleration_m_per_s2
    * total_head_m
    * bottom_plate_area_m2
)

# Convert forces from Newtons to kilonewtons
force_end_plate_kn = force_end_plate_n / 1000
force_bottom_plate_kn = force_bottom_plate_n / 1000

# ==================================
# OUTPUT RESULTS
# ==================================

print("=== Hydrostatic Loads on Oil Tank ===")
print(
    f"Tank dimensions       : {tank_length_m} m × {tank_width_m} m × "
    f"{tank_height_m} m (L×W×H)"
)
print(f"Oil rise in sounding pipe : {sounding_pipe_height_m} m")
print(f"Oil density           : {oil_density_kg_per_m3} kg/m³")
print()
print(
    f"End plate (one wall)  : {end_plate_height_m} m high × "
    f"{end_plate_width_m} m wide = {end_plate_area_m2} m²"
)
print(
    f"Horizontal load on one end plate : {force_end_plate_n:,.0f} N = "
    f"{force_end_plate_kn:.0f} kN"
)
print()
print(
    f"Bottom plate          : {tank_length_m} m × {tank_width_m} m = "
    f"{bottom_plate_area_m2} m²"
)
print(
    f"Vertical load on bottom          : {force_bottom_plate_n:,.0f} N = "
    f"{force_bottom_plate_kn:.0f} kN"
)

Example 3.3 A rectangular dock gate measures 4 meters wide. If the water level is 5.5 meters high on one side and 3.5 meters high on the other, what horizontal thrust will act on the gate? Assume the water density is 1000 kg/m³.

"""
Hydrostatic Thrust Calculator for Gate

Calculates the net horizontal thrust on a vertical gate separating two
different water levels. The net thrust is the difference between forces
from the high and low sides.
"""

# ====================================
# INPUT PARAMETERS
# ====================================

gate_width_m = 4.0  # Width of gate in meters
water_depth_high_side_m = 5.5  # Water depth on higher side in meters
water_depth_low_side_m = 3.5  # Water depth on lower side in meters
water_density_kg_per_m3 = 1000.0  # Density of water (kg/m³)
gravitational_acceleration_m_per_s2 = 9.81  # Acceleration due to gravity

# ====================================
# CALCULATIONS - HIGH SIDE
# ====================================

# Area of gate submerged on high side
area_high_side_m2 = water_depth_high_side_m * gate_width_m

# Depth to centroid of pressure distribution on high side
# (for rectangular area, centroid is at half the water depth)
centroid_depth_high_side_m = water_depth_high_side_m / 2

# Hydrostatic force from high side using F = ρ · g · h_c · A
force_high_side_n = (
    water_density_kg_per_m3
    * gravitational_acceleration_m_per_s2
    * centroid_depth_high_side_m
    * area_high_side_m2
)

# ====================================
# CALCULATIONS - LOW SIDE
# ====================================

# Area of gate submerged on low side
area_low_side_m2 = water_depth_low_side_m * gate_width_m

# Depth to centroid of pressure distribution on low side
centroid_depth_low_side_m = water_depth_low_side_m / 2

# Hydrostatic force from low side using F = ρ · g · h_c · A
force_low_side_n = (
    water_density_kg_per_m3
    * gravitational_acceleration_m_per_s2
    * centroid_depth_low_side_m
    * area_low_side_m2
)

# ====================================
# NET THRUST CALCULATION
# ====================================

# Net horizontal thrust (force from high side minus force from low side)
net_thrust_n = force_high_side_n - force_low_side_n

# ====================================
# OUTPUT RESULTS
# ====================================

print("=== Hydrostatic Thrust Calculation ===")
print(
    f"Force from higher side ({water_depth_high_side_m} m): "
    f"{force_high_side_n:.0f} N"
)
print(
    f"Force from lower side  ({water_depth_low_side_m} m): " f"{force_low_side_n:.0f} N"
)
print(f"Net horizontal thrust on gate: {net_thrust_n:.0f} N")

Example 3.4 A rectangular dock gate measures 12 meters wide. When the sea is 9 meters deep on one side and 4.5 meters deep on the other, what horizontal thrust will act on the gate? Assume the density of seawater is 1025 kg/m³.

"""
Dock Gate Hydrostatic Thrust Calculator

Calculates the net horizontal thrust on a vertical dock gate separating
two different water levels. Accounts for seawater density and provides
results in multiple units (N, kN, MN).
"""

# =====================================
# INPUT PARAMETERS
# =====================================

gate_width_m = 12.0  # Width of dock gate in meters
water_depth_deep_side_m = 9.0  # Water depth on deeper side in meters
water_depth_shallow_side_m = 4.5  # Water depth on shallower side in meters
seawater_density_kg_per_m3 = 1025.0  # Density of seawater (kg/m³)
gravitational_acceleration_m_per_s2 = 9.81  # Acceleration due to gravity

# =====================================
# CALCULATIONS - DEEPER SIDE
# =====================================

# Area of gate submerged on deeper side
area_deep_side_m2 = water_depth_deep_side_m * gate_width_m

# Depth to centroid of pressure distribution on deeper side
# (for rectangular area, centroid is at half the water depth)
centroid_depth_deep_side_m = water_depth_deep_side_m / 2

# Hydrostatic force from deeper side using F = ρ · g · h_c · A
force_deep_side_n = (
    seawater_density_kg_per_m3
    * gravitational_acceleration_m_per_s2
    * centroid_depth_deep_side_m
    * area_deep_side_m2
)

# =====================================
# CALCULATIONS - SHALLOWER SIDE
# =====================================

# Area of gate submerged on shallower side
area_shallow_side_m2 = water_depth_shallow_side_m * gate_width_m

# Depth to centroid of pressure distribution on shallower side
centroid_depth_shallow_side_m = water_depth_shallow_side_m / 2

# Hydrostatic force from shallower side using F = ρ · g · h_c · A
force_shallow_side_n = (
    seawater_density_kg_per_m3
    * gravitational_acceleration_m_per_s2
    * centroid_depth_shallow_side_m
    * area_shallow_side_m2
)

# =====================================
# NET THRUST CALCULATION
# =====================================

# Net horizontal thrust (force from deep side minus force from shallow side)
net_thrust_n = force_deep_side_n - force_shallow_side_n

# Convert forces to additional units for output
force_deep_side_mn = force_deep_side_n / 1e6
force_shallow_side_mn = force_shallow_side_n / 1e6
net_thrust_kn = net_thrust_n / 1000
net_thrust_mn = net_thrust_n / 1e6

# =====================================
# OUTPUT RESULTS
# =====================================

print("=== Dock Gate Hydrostatic Thrust Calculation ===")
print(
    f"Force from {water_depth_deep_side_m} m side : "
    f"{force_deep_side_n:,.0f} N  ({force_deep_side_mn:.3f} MN)"
)
print(
    f"Force from {water_depth_shallow_side_m} m side : "
    f"{force_shallow_side_n:,.0f} N  ({force_shallow_side_mn:.3f} MN)"
)
print(
    f"Resultant horizontal thrust: {net_thrust_n:,.0f} N  "
    f"({net_thrust_kn:.1f} kN or {net_thrust_mn:.3f} MN)"
)

Example 3.5 Seawater has flooded an oil tanker’s oil tank to a depth of 4 meters, and a 10-meter layer of oil sits atop the seawater. Calculate the pressure at the bottom of the tank. Note: The density of oil is 0.85 g/cm³, the density of seawater is 1.02 t/m³, and the atmospheric pressure is 101.3 kPa.

"""
Layered Fluid Pressure Calculator

Calculates the hydrostatic pressure at the bottom of a tank containing
two immiscible fluid layers (oil on top of seawater). Computes both
gauge pressure and absolute pressure.
"""

# ===============================
# INPUT PARAMETERS
# ===============================

oil_density_g_per_cm3 = 0.85  # Density of oil in g/cm³
oil_layer_height_m = 10.0  # Height of oil layer in meters
seawater_density_t_per_m3 = 1.02  # Density of seawater in t/m³
seawater_layer_height_m = 4.0  # Height of seawater layer in meters
atmospheric_pressure_kpa = 101.3  # Atmospheric pressure in kPa
gravitational_acceleration_m_per_s2 = 9.81  # Acceleration due to gravity

# ===============================
# UNIT CONVERSIONS
# ===============================

# Convert oil density from g/cm³ to kg/m³
oil_density_kg_per_m3 = oil_density_g_per_cm3 * 1000

# Convert seawater density from t/m³ to kg/m³
seawater_density_kg_per_m3 = seawater_density_t_per_m3 * 1000

# =================================
# HYDROSTATIC PRESSURE CALCULATIONS
# =================================

# Pressure contribution from oil layer using P = ρ · g · h
pressure_from_oil_kpa = (
    oil_density_kg_per_m3 * gravitational_acceleration_m_per_s2 * oil_layer_height_m
) / 1000  # Convert Pa to kPa

# Pressure contribution from seawater layer using P = ρ · g · h
pressure_from_seawater_kpa = (
    seawater_density_kg_per_m3
    * gravitational_acceleration_m_per_s2
    * seawater_layer_height_m
) / 1000  # Convert Pa to kPa

# Total gauge pressure (pressure above atmospheric)
total_gauge_pressure_kpa = pressure_from_oil_kpa + pressure_from_seawater_kpa

# Absolute pressure (gauge pressure plus atmospheric pressure)
absolute_pressure_kpa = atmospheric_pressure_kpa + total_gauge_pressure_kpa

# ===============================
# OUTPUT RESULTS
# ===============================

print(f"Pressure due to oil layer       : {pressure_from_oil_kpa:.4f} kPa")
print(f"Pressure due to seawater layer  : " f"{pressure_from_seawater_kpa:.4f} kPa")
print(f"Total gauge pressure            : {total_gauge_pressure_kpa:.4f} kPa")
print(f"Absolute pressure at the bottom : {absolute_pressure_kpa:.4f} kPa")

3.3 Hydraulic Jacks

Hydraulic jacks use Pascal’s law to lift heavy loads with minimal input force. Pascal’s law states that pressure applied to an enclosed fluid is transmitted equally in all directions. In a hydraulic jack as shown in Figure 3.3 , two pistons of different sizes are connected by a confined fluid. Applying an effort force to the smaller piston generates a pressure that is transmitted to the larger piston, producing an output force. Calculations involving hydraulic jacks, such as determining system pressure, required input force, or lifted load, rely on this principle under ideal conditions, neglecting friction and fluid compressibility.

Figure 3.3: Hydraulic lift

Example 3.6 A force of 150 N is transmitted from a piston of 25 mm² to one of 100 mm². Determine the system pressure and the load carried by the larger piston.

"""
Hydraulic Press Calculator

Calculates the load capacity of a hydraulic press using Pascal's principle.
Given the force applied to a small piston and the areas of both pistons,
determines the system pressure and the load that can be lifted by the
larger piston.
"""

# ===============================
# INPUT PARAMETERS
# ===============================

small_piston_area_mm2 = 25.0  # Area of small piston in mm²
large_piston_area_mm2 = 100.0  # Area of large piston in mm²
force_on_small_piston_n = 150.0  # Force applied to small piston in N

# ===============================
# UNIT CONVERSIONS
# ===============================

# Convert piston areas from mm² to m² (1 mm² = 10⁻⁶ m²)
small_piston_area_m2 = small_piston_area_mm2 * 1e-6
large_piston_area_m2 = large_piston_area_mm2 * 1e-6

# ===============================
# HYDRAULIC SYSTEM CALCULATIONS
# ===============================

# Calculate system pressure using P = F / A (Pascal's principle)
# Pressure is uniform throughout the hydraulic fluid
system_pressure_pa = force_on_small_piston_n / small_piston_area_m2

# Calculate load carried by large piston using F = P · A
load_on_large_piston_n = system_pressure_pa * large_piston_area_m2

# Convert pressure to MPa for additional output
system_pressure_mpa = system_pressure_pa / 1e6

# ===============================
# OUTPUT RESULTS
# ===============================

print(
    f"System pressure: {system_pressure_pa:.2f} Pa "
    f"(or {system_pressure_mpa:.1f} MPa)"
)
print(f"Load carried by larger piston: {load_on_large_piston_n:.1f} N")