Hydrostatic Forces¶
Module Reference¶
Hydrostatic force and centre of pressure calculations.
All dimensional quantities use SI units.
Depth is positive downwards. Inclination angles are measured from the horizontal and supplied in degrees.
Analytical gate calculations assume fully submerged plane surfaces and constant fluid density.
as_float_array
¶
as_float_array(value: ArrayLike, name: str) -> np.ndarray
Convert input to a finite floating-point array.
Source code in src/fluidmec/core/_validation.py
13 14 15 16 17 18 19 20 21 22 23 24 | |
format_output
¶
format_output(result: ArrayLike) -> float | np.ndarray
Return a Python float for scalar results.
Source code in src/fluidmec/core/_validation.py
69 70 71 72 73 74 75 76 77 78 79 | |
validate_non_negative
¶
validate_non_negative(value: ArrayLike, name: str) -> np.ndarray
Validate non-negative numerical inputs.
Source code in src/fluidmec/core/_validation.py
41 42 43 44 45 46 47 48 49 50 51 52 | |
validate_positive
¶
validate_positive(value: ArrayLike, name: str) -> np.ndarray
Validate strictly positive numerical inputs.
Source code in src/fluidmec/core/_validation.py
27 28 29 30 31 32 33 34 35 36 37 38 | |
hydrostatic_pressure
¶
hydrostatic_pressure(depth: ArrayLike, density: ArrayLike = WATER_DENSITY, gravity: ArrayLike = ENGINEERING_GRAVITY) -> float | np.ndarray
Calculate hydrostatic gauge pressure in Pa.
p = rho * g * h
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
depth
|
ArrayLike
|
Depth below the fluid surface in m. |
required |
density
|
ArrayLike
|
Fluid density in kg/m³. |
WATER_DENSITY
|
gravity
|
ArrayLike
|
Gravitational acceleration in m/s². |
ENGINEERING_GRAVITY
|
Source code in src/fluidmec/core/hydrostatics.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
_inclination_sine
¶
_inclination_sine(angle: ArrayLike) -> np.ndarray
Validate inclination and return its sine.
Source code in src/fluidmec/core/hydrostatic_forces.py
30 31 32 33 34 35 36 37 38 39 40 | |
hydrostatic_force
¶
hydrostatic_force(area: ArrayLike, centroid_depth: ArrayLike, density: ArrayLike = WATER_DENSITY, gravity: ArrayLike = ENGINEERING_GRAVITY) -> float | np.ndarray
Calculate resultant hydrostatic force in N.
F = rho * g * h_c * A
Area in m². Centroid depth in m.
Source code in src/fluidmec/core/hydrostatic_forces.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
centre_of_pressure
¶
centre_of_pressure(area: ArrayLike, centroid_depth: ArrayLike, second_moment: ArrayLike, angle: ArrayLike = 90.0) -> float | np.ndarray
Calculate vertical centre of pressure depth in m.
h_cp = h_c + I_G * sin(theta)^2 / (A * h_c)
Second moment of area in m^4.
Source code in src/fluidmec/core/hydrostatic_forces.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
rectangular_gate_force
¶
rectangular_gate_force(width: ArrayLike, length: ArrayLike, top_depth: ArrayLike = 0.0, angle: ArrayLike = 90.0, density: ArrayLike = WATER_DENSITY, gravity: ArrayLike = ENGINEERING_GRAVITY) -> float | np.ndarray
Calculate hydrostatic force on a rectangular gate.
Width is parallel to the free surface. Length is measured along the inclined gate. Top depth is the vertical depth of its upper edge.
Source code in src/fluidmec/core/hydrostatic_forces.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
rectangular_gate_centre_of_pressure
¶
rectangular_gate_centre_of_pressure(width: ArrayLike, length: ArrayLike, top_depth: ArrayLike = 0.0, angle: ArrayLike = 90.0) -> float | np.ndarray
Calculate vertical centre of pressure depth for a fully submerged rectangular gate.
Source code in src/fluidmec/core/hydrostatic_forces.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
_validate_circular_gate
¶
_validate_circular_gate(radius: ArrayLike, centre_depth: ArrayLike, angle: ArrayLike) -> tuple[np.ndarray, np.ndarray]
Validate a fully submerged circular gate.
Source code in src/fluidmec/core/hydrostatic_forces.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
circular_gate_force
¶
circular_gate_force(radius: ArrayLike, centre_depth: ArrayLike, angle: ArrayLike = 90.0, density: ArrayLike = WATER_DENSITY, gravity: ArrayLike = ENGINEERING_GRAVITY) -> float | np.ndarray
Calculate force on a fully submerged circular gate.
Source code in src/fluidmec/core/hydrostatic_forces.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |
circular_gate_centre_of_pressure
¶
circular_gate_centre_of_pressure(radius: ArrayLike, centre_depth: ArrayLike, angle: ArrayLike = 90.0) -> float | np.ndarray
Calculate vertical centre of pressure depth for a fully submerged circular gate.
Source code in src/fluidmec/core/hydrostatic_forces.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
hydrostatic_moment
¶
hydrostatic_moment(force: ArrayLike, lever_arm: ArrayLike) -> float | np.ndarray
Calculate signed moment in N.m.
M = F * d
Lever arm is the perpendicular distance from the axis to the force's line of action.
Its sign defines the moment direction.
Source code in src/fluidmec/core/hydrostatic_forces.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
_validate_pressure_profile
¶
_validate_pressure_profile(coordinate: ArrayLike, pressure: ArrayLike, width: ArrayLike) -> tuple[np.ndarray, np.ndarray]
Validate a sampled plane-surface pressure profile.
Coordinate is distance along the surface. Width is perpendicular to that coordinate within the plane of the surface.
Source code in src/fluidmec/core/hydrostatic_forces.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
_trapezoidal_integral
¶
_trapezoidal_integral(coordinate: ndarray, values: ndarray) -> float
Integrate sampled values using trapezoids.
Source code in src/fluidmec/core/hydrostatic_forces.py
275 276 277 278 279 280 281 282 283 284 285 | |
integrated_pressure_force
¶
integrated_pressure_force(coordinate: ArrayLike, pressure: ArrayLike, width: ArrayLike = 1.0) -> float
Numerically integrate pressure over a plane.
F = integral(p * b * ds)
Coordinate in m. Pressure in Pa. Width in m.
Returns force in N.
Source code in src/fluidmec/core/hydrostatic_forces.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
integrated_centre_of_pressure
¶
integrated_centre_of_pressure(coordinate: ArrayLike, pressure: ArrayLike, width: ArrayLike = 1.0) -> float
Calculate centre of pressure along a surface.
s_cp = integral(s * p * b * ds) / F
Returns the position in the supplied coordinate system, not necessarily vertical depth.
Source code in src/fluidmec/core/hydrostatic_forces.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
buoyancy_force
¶
buoyancy_force(displaced_volume: ArrayLike, density: ArrayLike = WATER_DENSITY, gravity: ArrayLike = ENGINEERING_GRAVITY) -> float | np.ndarray
Calculate upward buoyancy force in N.
F_B = rho * g * V
Displaced volume in m³.
Source code in src/fluidmec/core/hydrostatic_forces.py
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | |