Optimize pipe diameter and pressure drop
Optimal pipe diameter is usually found thanks to technical Log-Log charts in which the commercial pipe diameter is drawn together with the fluid velocity, associated fluid flow rate and acceptable pressure drop. These charts can be applied only for a particular pipe and for the most common, pre-defined fluids, such as water or air.
What happens if the pipe material changes or a "less popular" fluid shall be conveyed (chemical compound, fossil fuel ...)?
In this project, the best design is the smallest pipe diameter that causes the lowest pressure drop. The user can choose the pipe roughness and fluid properties (density and viscosity).
The mathematical problem has:
- bounded search variable (the pipe diameter can vary according to user choice)
- 2 competitive objectives
- a feasibility constraint on the fluid velocity (user can update the constraint)
The Pareto front is found with the multi-objective version of the genetic algorithm (gamultiobj). The best compromise solution is chosen according to topsis method.
If the calculation is carried out for multiple mass flow rates (e.g. the user wants to investigate partial loads), all solutions are plotted, with respect to the flow rates, pressure drops and fluid velocities.
Run the main program with custom inputs. Look at the explanatory comments.
Cite As
Giulio Rizzi (2026). Optimize pipe diameter and pressure drop (https://github.com/giuliots95/Optimize_pipe_diameter_and_pressure_drop/releases/tag/v1.0), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0 |
