Optimize pipe diameter and pressure drop

Version 1.0 (28.8 KB) by Giulio Rizzi
Solves the problem of finding the smallest diameter for a straight pipe that causes the lowest pressure drop for a custom fluid.
198 Downloads
Updated 30 Nov 2020

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
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Version Published Release Notes
1.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.