Fluid Properties¶
Module Reference¶
Fluid property calculations.
All dimensional inputs and outputs use SI units, except explicitly identified Celsius temperatures.
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_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 | |
kinematic_viscosity
¶
kinematic_viscosity(dynamic_viscosity: ArrayLike, density: ArrayLike) -> float | np.ndarray
Calculate kinematic viscosity in m²/s.
nu = mu / rho
Dynamic viscosity in Pa.s. Density in kg/m³.
Source code in src/fluidmec/core/properties.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
dynamic_viscosity
¶
dynamic_viscosity(kinematic_viscosity: ArrayLike, density: ArrayLike) -> float | np.ndarray
Calculate dynamic viscosity in Pa.s.
mu = rho * nu
Source code in src/fluidmec/core/properties.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
_validate_water_temperature
¶
_validate_water_temperature(temperature: ArrayLike) -> np.ndarray
Validate freshwater temperature in Celsius.
Empirical model range: 0 to 100°C.
Source code in src/fluidmec/core/properties.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
water_density
¶
water_density(temperature: ArrayLike = 20.0) -> float | np.ndarray
Estimate freshwater density in kg/m³.
Temperature in degrees Celsius.
Assumes liquid freshwater near atmospheric pressure, using an empirical correlation.
Source code in src/fluidmec/core/properties.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
water_dynamic_viscosity
¶
water_dynamic_viscosity(temperature: ArrayLike = 20.0) -> float | np.ndarray
Estimate freshwater dynamic viscosity in Pa.s.
Temperature in degrees Celsius.
Source code in src/fluidmec/core/properties.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
water_kinematic_viscosity
¶
water_kinematic_viscosity(temperature: ArrayLike = 20.0) -> float | np.ndarray
Estimate freshwater kinematic viscosity in m²/s.
Temperature in degrees Celsius.
Source code in src/fluidmec/core/properties.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
air_density
¶
air_density(temperature: ArrayLike = 20.0, pressure: ArrayLike = ATMOSPHERIC_PRESSURE) -> float | np.ndarray
Calculate dry air density in kg/m³.
Uses the ideal gas equation.
Temperature in degrees Celsius. Absolute pressure in Pa.
Source code in src/fluidmec/core/properties.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
reduced_gravity
¶
reduced_gravity(density: ArrayLike, reference_density: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY) -> float | np.ndarray
Calculate signed reduced gravity in m/s².
g_prime = g * (rho - rho_ref) / rho_ref
Density values in kg/m³.
Source code in src/fluidmec/core/properties.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
specific_weight
¶
specific_weight(density: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY) -> float | np.ndarray
Calculate specific weight in N/m³.
gamma = rho * g
Source code in src/fluidmec/core/properties.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
specific_gravity
¶
specific_gravity(density: ArrayLike, reference_density: ArrayLike = 1000.0) -> float | np.ndarray
Calculate dimensionless specific gravity.
SG = rho / rho_ref
Default reference density is nominal freshwater density of 1000 kg/m³.
Source code in src/fluidmec/core/properties.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |