# Plotting velocity vectors for pressure driven pipe flow

So I find the velocity profile for Pressure driven pipe flow and it looks like:

$$u = \frac{h^2}{2 \mu} \frac{\mathrm{d}P}{\mathrm{d}x}\left[1 - \left(\frac{y}{h}\right)^2\right]$$

Here, a fluid flows between two walls separated by a distance $h$. The pressure gradient $\mathrm{d}P/\mathrm{d}X$ drives the flow. The vertical coordinate axis is $y$.

How do I plot this as a velocity profile (VelocityPlot)? When I try do plot this with

μ = 0.02; Px = -0.5; h = 1.0;
VectorPlot[{(h^2/(2 μ)) Px (1 - (y/h)^2), 0}, {x, 0, 3}, {y, -3, 3}]


I get the following figure:

However, the velocity profile is parabolic and should look like:

I apologize for the low quality vector plot from ansys but what went wrong with my VectorPlot[...] definition?

-
you are plotting outside the region of validity of your equation. Change {y,-h,h} instead of {y,-3,3} –  gpap Oct 14 '13 at 14:59

Some comments: 1. The formula for velocity profile should be $-\frac{dP}{dx}$ as flow travels down a pressure gradient not up. 2. As gpap observes the region of interest is -h,h within the flow region. The "pipe" walls are separated by $2h$ (radius $h$). 3. In the following I have retained same Px but corrected formula so to show flow from left to right. If intention was right to left flow then Px should be positive. 4. I have coloured vector by magnitude of x direction #3&. I have just plotted points at zero to demonstrate parabolic flow profile.

\[Mu] = 0.02; Px = -0.5; h = 1.0;
f = (h^2/(2 \[Mu])) (-Px) (1 - (y/h)^2)
VectorPlot[{f, 0}, {x, 0, 3}, {y, -h, h},
VectorPoints -> Table[{0, j}, {j, -1, 1, 0.1}],
VectorScale -> {1, 0.2}, VectorColorFunction -> (Hue[#3*.6] &),
PlotRange -> {{0, 4}, {-1.1, 1.1}},
Epilog -> {{Red, Thick, Line[{{0, 1}, {4, 1}}]}, {Red, Thick,
Line[{{0, -1}, {4, -1}}]}}]


yields:

-