Class: TypeOfFlow
The TypeOfFlow class determines the type of fluid flow based on the Reynolds number (Re).
It is part of the ProcessPI Calculations module and inherits from CalculationBase.
๐ Description
The flow regime describes how fluid moves through a pipe or channel.
It is classified into Laminar, Transitional, or Turbulent flow, depending on the Reynolds number.
- Laminar Flow โ Smooth, orderly flow with little mixing (
Re < 2000) - Transitional Flow โ Unstable regime, switching between laminar & turbulent (
2000 โค Re โค 4000) - Turbulent Flow โ Chaotic, highly mixed flow (
Re > 4000)
๐ Formula / Criteria
The classification is based on the Reynolds number:
Where:
| Symbol | Description | Units |
|---|---|---|
| \( Re \) | Reynolds number | โ (dimensionless) |
| \( \rho \) | Fluid density | kg/mยณ |
| \( v \) | Fluid velocity | m/s |
| \( D \) | Pipe diameter | m |
| \( \mu \) | Dynamic viscosity | Paยทs |
โ๏ธ Inputs
reynolds_numberโ Reynolds number (dimensionless)
๐ค Output
Returns a StringUnit object containing the determined flow type:
- "Laminar"
- "Transitional"
- "Turbulent"
๐ ๏ธ Methods
validate_inputs()
Ensures the required input reynolds_number is provided.
Raises ValueError if missing.
calculate()
Classifies the flow regime based on Reynolds number:
- If
Re < 2000โ"Laminar" - If
2000 โค Re โค 4000โ"Transitional" - If
Re > 4000โ"Turbulent"
Returns:
StringUnit: The computed flow type.
๐ป Example Usage
Using the TypeOfFlow
from processpi.calculations import TypeOfFlow
from processpi.units import Dimensionless
# Example Reynolds number
Re = Dimensionless(3500)
# Create calculation instance
flow_calc = TypeOfFlow(reynolds_number=Re)
# Perform calculation
flow_type = flow_calc.calculate()
print(f"Flow Type: {flow_type}")
**Using the CalculationEngine
from processpi.engine import CalculationEngine
from processpi.units import Dimensionless
# Initialize engine
engine = CalculationEngine()
# Example Reynolds number
Re = Dimensionless(3500)
# Perform flow type classification using the engine
flow_type = engine.calculate(
"type_of_flow",
reynolds_number=Re
)
print(f"Flow Type (via Engine): {flow_type}")