Skip to content

Quick Start

Reynolds Number

from fluidmec.core import reynolds_number

Re = reynolds_number(2.0, 0.5, 1e-6)
print(Re)
\[ Re = \frac{|U|L}{\nu} \]

Hydrostatic Pressure

from fluidmec.core import hydrostatic_pressure

p = hydrostatic_pressure(
    depth=10,
    density=1000
)

print(p)

Expected pressure: 98100 Pa using \(g=9.81\) m/s².

Bernoulli Equation

from fluidmec.core import bernoulli_pressure

p2 = bernoulli_pressure(
    pressure_1=150000,
    velocity_1=2,
    velocity_2=8,
    density=1000
)

print(p2)

Expected pressure: 120000 Pa for equal elevations.

Pipe Flow

from fluidmec.core import colebrook_friction_factor

f = colebrook_friction_factor(
    reynolds_number=100000,
    relative_roughness=0.001
)

print(f)

Expected Darcy friction factor: approximately 0.0221745.

Open Channel Flow

from fluidmec.core import critical_depth

yc = critical_depth(unit_discharge=4)

print(yc)
\[ y_c = \left(\frac{q^2}{g}\right)^{1/3} \]

This expression applies to a rectangular channel.

Vectorised Calculations

import numpy as np
from fluidmec.core import reynolds_number

velocity = np.array([1.0, 2.0, 3.0])

Re = reynolds_number(
    velocity,
    length=1.0,
    kinematic_viscosity=1e-6
)

print(Re)

Most direct engineering calculations support NumPy arrays. Individual numerical solvers may require scalar inputs.