Square or rectangular pipes have a greater weight and a greater pressure drop compared with a circular pipe with the same useful section.
This app gives the diameter with the equivalent area and the hydraulic diameter, the first one is simply the needed diameter to obtain the same section and velocity of the square or rectangular channel, the second one is the diameter that gives the same pressure drop and the maximum savings.
The calculation is valid also for fluid transportation pipes at the liquid state.
Channel side 1
Channel side 2
Diameter with equal section
Useful passage area
Useful area with the hydraulic diameter
The hydraulic diameter is valid when the roughness of the rectangular pipe and of the circular pipe are the same, really almost always the rectangular channels have a greater roughness and so still greater pressure drops that make it possible to reduce further the diameter.
To appreciate the differences in details see the calculation function complete for rectangular pipes, where it is possible to vary the material and the roughness.
Circular pipe with hydraulic diameter will have the same pressure drop of the rectangular channel but a greater average velocity.