There are different methods to compute the average velocity for a pipeline. One of them that we can use is the Manning's equation, which relates the average velocity V
with the hydraulic radius R
, slope S
, and Manning's roughness coefficient n
:
main.m28 chars2 lines
To plot the velocity profile, we can use the analytical solution for fully developed flow in a circular pipe, which is parabolic and can be expressed as:
main.m39 chars2 lines
where V_max
is the maximum velocity at the center of the pipe, D
is the diameter of the pipe, r
is the radial coordinate, and R = D/2
is the hydraulic radius.
Here's some example code that reads the diameter, slope, and roughness coefficient from user input, and plots the velocity profile together with the original (uniform) velocity distribution:
main.m1077 chars28 lines
This code produces a plot like the following:
gistlibby LogSnag